apiVersion: apps/v1 kind: Deployment metadata: name: elasticsearch labels: app: elasticsearch spec: selector: matchLabels: app: elasticsearch strategy: type: Recreate template: metadata: labels: app: elasticsearch spec: subdomain: elasticsearch nodeSelector: kubernetes.io/hostname: gunter-nb containers: - name: elasticsearch image: elasticsearch:8.4.2 env: - name: ES_JAVA_OPTS value: -Xms1024m -Xmx1024m - name: http.cors.enabled value: "true" - name: http.cors.allow-origin value: /.*/ - name: http.cors.allow-headers value: X-Requested-With,Content-Length,Content-Type,Authorization - name: discovery.type value: single-node - name: xpack.security.enabled value: "false" ports: - containerPort: 9200 - containerPort: 9300 volumeMounts: - name: localtime mountPath: /etc/localtime readOnly: true - name: timezone mountPath: /etc/timezone readOnly: true - name: data mountPath: /usr/share/elasticsearch/data volumes: - name: localtime hostPath: path: /etc/localtime type: File - name: timezone hostPath: path: /etc/timezone type: File - name: data hostPath: path: /var/local/microk8s/esdatadir type: DirectoryOrCreate