The same yaml can be created successfully under version 1.16.3
kubectl create -f test.yaml
Error from server (Timeout): error when creating "test.yaml": Timeout: request did not complete within requested timeout 30s
kubectl -n elastic-system logs -f statefulset.apps/elastic-operator
Check the operator log and find no errors
> kind: StorageClass
> apiVersion: storage.k8s.io/v1
> metadata:
> name: elastic-local-volume
> provisioner: kubernetes.io/no-provisioner
> volumeBindingMode: WaitForFirstConsumer
>
> ---
> apiVersion: v1
> kind: PersistentVolume
> metadata:
> name: es-data-pv-0
> spec:
> capacity:
> storage: 5Gi
> accessModes:
> - ReadWriteOnce
> persistentVolumeReclaimPolicy: Recycle
> storageClassName: elastic-local-volume
> local:
> path: /data/elastic-pv0/
> nodeAffinity:
> required:
> nodeSelectorTerms:
> - matchExpressions:
> - key: kubernetes.io/hostname
> operator: In
> values:
> - '192.168.10.184'
> ---
> apiVersion: v1
> kind: PersistentVolume
> metadata:
> name: es-data-pv-1
> spec:
> capacity:
> storage: 50Gi
> accessModes:
> - ReadWriteOnce
> persistentVolumeReclaimPolicy: Recycle
> storageClassName: elastic-local-volume
> local:
> path: /data/elastic-pv1/
> nodeAffinity:
> required:
> nodeSelectorTerms:
> - matchExpressions:
> - key: kubernetes.io/hostname
> operator: In
> values:
> - '192.168.10.184'
> apiVersion: elasticsearch.k8s.elastic.co/v1
> kind: Elasticsearch
> metadata:
> name: elastic
> spec:
> version: 7.6.2
> image: ccr.ccs.tencentyun.com/elk-oss/elasticsearch:7.6.2
> nodeSets:
> - name: elastic-master
> count: 1
> config:
> node.master: true
> node.data: false
> node.ingest: false
> node.ml: false
> node.store.allow_mmap: false
> index.store.type: niofs
> cluster.remote.connect: false
> podTemplate:
> spec:
> containers:
> - name: elasticsearch
> resources:
> limits:
> memory: 2Gi
> cpu: 2
> env:
> - name: ES_JAVA_OPTS
> value: "-Xms2g -Xmx2g"
> volumeClaimTemplates:
> - metadata:
> name: elasticsearch-data
> spec:
> accessModes:
> - ReadWriteOnce
> resources:
> requests:
> storage: 5Gi
> storageClassName: elastic-local-volume
>
> - name: elastic-node
> count: 1
> config:
> node.master: false
> node.data: true
> node.ingest: true
> node.ml: false
> node.store.allow_mmap: false
> index.store.type: niofs
> cluster.remote.connect: false
> PodTemplate:
> spec:
> containers:
> - name: elasticsearch
> resources:
> limits:
> memory: 4Gi
> cpu: 2
> env:
> - name: ES_JAVA_OPTS
> value: "-Xms4g -Xmx4g"
> volumeClaimTemplates:
> - metadata:
> name: elasticsearch-data
> spec:
> accessModes:
> - ReadWriteOnce
> resources:
> requests:
> storage: 5Gi
> storageClassName: elastic-local-volume