IT.en_US/Cloud_OuterArchitecture

Install ELK Stack Using Kubernetes

동구멍폴로 2023. 2. 14. 23:26
반응형

 

# Create a new namespace for ELK
kubectl create namespace elk

# Deploy Elasticsearch
kubectl apply -f https://download.elastic.co/downloads/eck/1.7.0/all-in-one.yaml -n elk

# Deploy Kibana
kubectl apply -f https://github.com/elastic/helm-charts/releases/download/kibana-7.16.2/kibana-7.16.2.tgz -n elk

# Deploy Logstash
kubectl apply -f https://github.com/elastic/helm-charts/releases/download/logstash-7.16.2/logstash-7.16.2.tgz -n elk

 

This script does the following:

  1. Creates a new namespace called elk to isolate the ELK stack components.
  2. Deploys Elasticsearch using the Elastic Cloud on Kubernetes (ECK) operator. The all-in-one.yaml file contains the configuration for Elasticsearch, including the number of nodes and the resources allocated to each node.
  3. Deploys Kibana using a Helm chart from the Elastic Helm repository. The chart is configured to use the Elasticsearch cluster that was deployed in the previous step.
  4. Deploys Logstash using another Helm chart from the Elastic Helm repository. Logstash is configured to consume logs from the Kubernetes cluster and forward them to Elasticsearch.

After running this script, you should have a functioning ELK stack running in your Kubernetes cluster. You can access Kibana by creating a port-forward from your local machine to the Kibana service, or by exposing the service as a LoadBalancer or NodePort service.

반응형