Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Deploying Elasticsearch on Kubernetes Using the Operator

Tech Oct 5 17

The cpu request value directly afffects the Elasticsearch node.processors configuraton. For example, with resources.requests.cpu: 1, Elasticsearch effectively uses a single core.

Table 1. Default resource limits set by the operator

Type Requests Limits
APM Server 512Mi 512Mi
Elasticsearch 2Gi 2Gi
Kibana 1Gi 1Gi
Beat 200Mi 200Mi
Elastic Agent 350Mi 350Mi
Elastic Maps Server 200Mi 200Mi
Enterprise Search 4Gi 4Gi

Installation steps:

  1. Install custom resource definitions:

    kubectl create -f https://download.elastic.co/downloads/eck/2.1.0/crds.yaml
    

    The following custom resources are created:

    customresourcedefinition.apiextensions.k8s.io/agents.agent.k8s.elastic.co created
    customresourcedefinition.apiextensions.k8s.io/apmservers.apm.k8s.elastic.co created
    customresourcedefinition.apiextensions.k8s.io/beats.beat.k8s.elastic.co created
    customresourcedefinition.apiextensions.k8s.io/elasticmapsservers.maps.k8s.elastic.co created
    customresourcedefinition.apiextensions.k8s.io/elasticsearches.elasticsearch.k8s.elastic.co created
    customresourcedefinition.apiextensions.k8s.io/enterprisesearches.enterprisesearch.k8s.elastic.co created
    customresourcedefinition.apiextensions.k8s.io/kibanas.kibana.k8s.elastic.co created
    
  2. Install the operator along with its access controls:

    kubectl apply -f https://download.elastic.co/downloads/eck/2.1.0/operator.yaml
    

    By default, the ECK operator runs in the elastic-system namespace. It is advised to use a dedicated namespace for your workloads instead of elastic-system or default.

  3. Monitor the operator logs:

    kubectl -n elastic-system logs -f statefulset.apps/elastic-operator
    

The installation process performs the following actions:

  • Creates CustomResourceDefinition objects for all supported types (Elasticsearch, Kibana, APM Server, Enterprise Search, Beats, Elastic Agent, and Elastic Maps Server).
  • Sets up a Namespace called elastic-system to store all operator-related resources.
  • Adds a ServiceAccount, ClusterRole, and ClusterRoleBinding to allow the operator to manage cluster-wide resources.
  • Installs a ValidatingWebhookConfiguration to validate Elastic custom resources upon admission.
  • Deploys a StatefulSet, ConfigMap, Secret, and Service within the elastic-system namespace to run the operator application.

Uninstallation steps:

  1. Remove all Elastic resources across all namespaces:

    kubectl get namespaces --no-headers -o custom-columns=:metadata.name \
      | xargs -n1 kubectl delete elastic --all -n
    

    This removes all underlying Elastic Stack components, including thier Pods, Secrets, Services, and more.

  2. Uninstall the operator:

    kubectl delete -f https://download.elastic.co/downloads/eck/2.1.0/operator.yaml
    kubectl delete -f https://download.elastic.co/downloads/eck/2.1.0/crds.yaml
    

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.