环境阿里云托管版本 aks
控制台直接创建 storageclass 是disk 使用时要注意
apiVersion: elasticsearch.k8s.elastic.co/v1beta1
kind: Elasticsearch metadata: name: elasticsearch-7x6x2 namespace: devops spec: image: elasticsearch:7.6.2 version: 7.6.2 nodeSets: - name: node count: 1 volumeClaimTemplates: - metadata: name: elasticsearch-data spec: accessModes: - ReadWriteOnce resources: requests: storage: 10Gi storageClassName: disk config: node.master: true node.data: true node.ingest: true thread_pool.write.queue_size: 3000 xpack.security.enabled: "false" podTemplate: metadata: labels: es: "7" elk: "true" spec: nodeSelector: role: "devops" initContainers: - name: sysctl securityContext: privileged: true command: [‘sh‘, ‘-c‘, ‘sysctl -w vm.max_map_count=262144‘] containers: - name: elasticsearch env: - name: xpack.security.enabled value: "false" - name: READINESS_PROBE_PROTOCOL value: http - name: ES_JAVA_OPTS value: -Xms8000m -Xmx8000m resources: requests: memory: 8Gi cpu: 1 limits: memory: 10Gi cpu: 8 readinessProbe: httpGet: path: / port: 9200 failureThreshold: 3 initialDelaySeconds: 60 periodSeconds: 50 successThreshold: 1 timeoutSeconds: 60 http: tls: selfSignedCertificate: disabled: true
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE d-2ze66d31yjlwualzz9se 100Gi RWO Retain Released devops/elasticsearch-data-elasticsearch-7x6x2-es-node-0 disk 43m ###### 手动删除 claimRef 进行二次利用 spec: accessModes: - ReadWriteOnce capacity: storage: 100Gi claimRef: apiVersion: v1 kind: PersistentVolumeClaim name: elasticsearch-data-elasticsearch-7x6x2-es-node-0 namespace: devops resourceVersion: "202011" uid: 5ad5f9a6-79a5-47e0-9edc-205cad5c1713
原文:https://www.cnblogs.com/leleyao/p/15305272.html