Deploying Elasticsearch latest version in Anthos on-prem K8s cluster

Hello Experts,

I'm new to Elasticsearch, I want to deploy elasticsearch v 8.9.1 into Anthos on-pre mK8s cluster, and I used the attached .yaml files for the same, I have the below questions.

  1. Is the attached yaml files are correct?
  2. When I tried Kind:Kibana, once it's worked and the nodes (pods) got created, and I deleted the pods and triying to create them again but it's not creating the nodes (pods) again, there was no event/errors in the kibana description (while I describe Kibana). and when I tried getting the Kibana, health, node and version were blank I waited for 20 minutes but no luck.
  3. I have two DNS for Elastic-Search and Kibana respectively and same IP has been registered for those DNS, and raised CSR and got the certificate for those DNS now I want to configure that cert for my deployment, how to do this?
ElasticSearch-kind.yaml 

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: elasticsearch
spec:
  version: 8.9.1
  http:
    tls:
      certificate:
        secretName: esuat-cert
  nodeSets:
  - name: master-nodes
    count: 3
    config:
      node.roles: ["master"]
    podTemplate:
      spec:
        initContainers:
        - name: sysctl
          securityContext:
            privileged: true
            runAsUser: 0
          command: ['sh', '-c', 'sysctl -w vm.max_map_count=262144']
          env:
            - name: ES_JAVA_OPTS
              value: -Xms2g -Xmx2g
            - name: bootstrap.memory_lock
              value: 'true'
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 2Gi
            cpu: 500m
            memory: 1Gi
          limits:
            cpu: 500m
            memory: 1Gi
        storageClassName: standard
  - name: data-nodes
    count: 3
    config:
      node.roles: ["data"]
    podTemplate:
      spec:
        initContainers:
        - name: sysctl
          securityContext:
            privileged: true
            runAsUser: 0
          command: ['sh', '-c', 'sysctl -w vm.max_map_count=262144']
          env:
            - name: ES_JAVA_OPTS
              value: -Xms2g -Xmx2g
            - name: bootstrap.memory_lock
              value: 'true'
    volumeClaimTemplates:
    - metadata:
        name: elasticsearch-data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 5Gi
            cpu: 2000m
            memory: 4Gi
          limits:
            cpu: 2000m
            memory: 4Gi
        storageClassName: standard


Kibana.deployment.yaml 
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kb-deployment
  labels:
    app: kibana
spec:
  replicas: 2
  selector:
    matchLabels:
      app: kibana
  template:
    metadata:
      labels:
        app: kibana
    spec:
      containers:
      - name: kibana
        image: docker.elastic.co/kibana/kibana:8.9.1
        imagePullPolicy: Always
        resources:
          limits:
            cpu: 2000m
            memory: "2048Mi"
          requests:
            cpu: 500m
            memory: "1024Mi"
        env:
          - name: ELASTICSEARCH_URL
            value: http://My-ES-IP:nodeport/
        ports:
        - containerPort: 5601
        volumeMounts:
        - name: kibana-tls-secret
          mountPath: /etc/kibana/certs
          readOnly: true
      volumes:
      - name: kibana-tls-secret
        secret:
          secretName: esuat-cert
---
apiVersion: v1
kind: Service
metadata:
  name: kibana-svc
  labels:
    app: kibana
spec:
  ports:
  - port: 443
    targetPort: 5601
  selector:
    app: kibana
  type: LoadBalancer
  loadBalancerIP: my-IP

Thanks in advance.

Kind Regards,
Esakki

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.