deploy.yaml
基于nfs
apiVersion: v1 kind: PersistentVolume metadata: name: es-pv-data namespace: test spec: capacity: storage: 1Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain storageClassName: es-data-nfs nfs: path: /data/nfs/es/data server: 192.168.137.100 --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: es-data-pvc namespace: test spec: accessModes: - ReadWriteMany resources: requests: storage: 1Gi storageClassName: es-data-nfs --- apiVersion: v1 kind: PersistentVolume metadata: name: es-pv-ik namespace: test spec: capacity: storage: 1Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain storageClassName: es-ik-nfs nfs: path: /data/nfs/es/ik server: 192.168.137.100 --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: es-ik-pvc namespace: test spec: accessModes: - ReadWriteMany resources: requests: storage: 1Gi storageClassName: es-ik-nfs --- apiVersion: v1 kind: Service metadata: name: es-svc namespace: test spec: ports: - name: web-9200 port: 9200 - name: web-9300 port: 9300 selector: app: es type: ClusterIP --- apiVersion: apps/v1 kind: Deployment metadata: name: es namespace: test labels: app: es spec: strategy: type: Recreate selector: matchLabels: app: es template: metadata: labels: app: es spec: containers: - name: es image: elasticsearch:7.17.6 imagePullPolicy: Always env: - name: ES_JAVA_OPTS value: "-Xms512m -Xmx512m" - name: cluster.name value: "elasticsearch" - name: discovery.type value: "single-node" ports: - containerPort: 9200 - containerPort: 9300 volumeMounts: - name: es-data mountPath: /usr/share/elasticsearch/data - name: es-ik mountPath: /usr/share/elasticsearch/plugins/ik volumes: - name: es-data persistentVolumeClaim: claimName: es-data-pvc - name: es-ik persistentVolumeClaim: claimName: es-ik-pvc
es-ingress.yaml
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: es-ingress namespace: test spec: rules: - host: estest.demo.com http: paths: - path: / backend: serviceName: es-svc servicePort: 9200
标签:name,ik,nfs,k8s,data,es,metadata From: https://www.cnblogs.com/cgpei/p/17956425