Elastic search is the first component of the ELK stack that gives powerful search and analytics capabilities to DevOps and development teams. We have discussed how to install Elastic Cloud for Kubernetes (ECK) in previous blog post. In this blog, let's learn how to install elastic stack on Kubernetes.
Pre-requites:
- Azure Kubernetes Cluster
- Full administrative access to the Kubernetes Cluster
- Workstation with kubectl installed
- Elastic Cloud on Kubernetes is installed
Open a shell or use the Azure Kubernetes Service 'Run Command' to run the script below and create an Elasticsearch node.
cat <<EOF | kubectl apply -f -
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: quickstart
spec:
version: 8.16.1
nodeSets:
- name: default
count: 1
config:
node.store.allow_mmap: false
EOF
Run the following command to check the pod status.
kubectl get pods --selector='elasticsearch.k8s.elastic.co/cluster-name=quickstart'
The command will return a pod status similar to the output shown below
kubectl get service quickstart-es-http
The command will return cluster IP information similar to below
PASSWORD=$(kubectl get secret quickstart-es-elastic-user -o go-template='{{.data.elastic | base64decode}}')
curl -u "elastic:$PASSWORD" -k "https://quickstart-es-http:9200"
kubectl port-forward service/quickstart-es-http 9200
No comments:
Post a Comment