Skip to content

[BUG] elasticsearch master spec.containers[3].ports[0].hostPort: Duplicate value #10502

Description

@JashBook

Describe the bug

kbcli version
Kubernetes: v1.30.4-vke.4
KubeBlocks: 1.1.0-beta.7
kbcli: 1.0.2
WARNING: version difference between kbcli (1.0.2) and kubeblocks (1.1.0-beta.7) 
➜  ~ helm get notes -n kb-system kb-addon-elasticsearch
NOTES:
--------------------------------------------------------------------------------
ENTERPRISE SOFTWARE — LICENSE NOTICE

This Helm chart is part of KubeBlocks Enterprise Addons, proprietary software
owned by ApeCloud Co., Ltd.

A valid KubeBlocks Enterprise License Agreement is required to install and use
this software. Unauthorized use, copying, or distribution is prohibited.

  License terms : see the LICENSE file included with this chart
  Licensing info : support@apecloud.com
  Website        : https://www.apecloud.com
--------------------------------------------------------------------------------


Release Information:
  Commit ID: "31bf21fb58a145357c90f1945942a720ae8571c2"
  Commit Time: "2026-06-22 15:21:19 +0800"
  Release Branch: "v1.1.0-beta.7"
  Release Time:  "2026-06-24 17:46:17 +0800"
  Enterprise: "true"

*instance-set-controller create v1.Pod default/elastics-hnrvav-master-2 failed: Pod "elastics-hnrvav-master-2" is invalid: spec.containers[3].ports[0].hostPort: Duplicate value: "TCP//56595"

To Reproduce
Steps to reproduce the behavior:

  1. create cluster
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  name: elastics-hnrvav
  namespace: default
spec:
  terminationPolicy: Delete
  componentSpecs:
    - name: master
      componentDef: elasticsearch-master-8-1.1.0-alpha.0
      serviceVersion: 8.15.5
      configs:
      - name: es-cm
        variables:
          version: 8.15.5
      schedulingPolicy:
        affinity:
          podAntiAffinity:
            preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app.kubernetes.io/instance: elastics-hnrvav
                    apps.kubeblocks.io/component-name: master
                topologyKey: kubernetes.io/hostname
              weight: 100
      disableExporter: false
      replicas: 3
      resources:
        requests:
          cpu: 500m
          memory: 2Gi
        limits:
          cpu: 500m
          memory: 2Gi
      persistentVolumeClaimRetentionPolicy:
        whenDeleted: Delete
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName: 
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
      tls: false
    - name: data
      componentDef: elasticsearch-data-8-1.1.0-alpha.0
      serviceVersion: 8.15.5
      configs:
      - name: es-cm
        variables:
          version: 8.15.5
      schedulingPolicy:
        affinity:
          podAntiAffinity:
            preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app.kubernetes.io/instance: elastics-hnrvav
                    apps.kubeblocks.io/component-name: data
                topologyKey: kubernetes.io/hostname
              weight: 100
      disableExporter: false
      replicas: 3
      resources:
        requests:
          cpu: 500m
          memory: 2Gi
        limits:
          cpu: 500m
          memory: 2Gi
      persistentVolumeClaimRetentionPolicy:
        whenDeleted: Delete
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName: 
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
      tls: false
    - name: kibana
      componentDef: kibana-8-1.1.0-alpha.0
      serviceVersion: 8.15.5
      replicas: 1
      podUpdatePolicy: PreferInPlace
      disableExporter: false
      resources:
        requests:
          cpu: 500m
          memory: 2Gi
        limits:
          cpu: 500m
          memory: 2Gi
      tls: false
  1. network host ports test
run network-host-ports test on cluster elastics-hnrvav component master
resolved runtime port name: http
target network base path: /spec/componentSpecs/0/network
ensure /spec/componentSpecs/0/network exists
network-host-ports patch content:
- op: add
  path: /spec/componentSpecs/0/network/hostPorts
  value:
    - name: http
      port: 56595
patch cluster elastics-hnrvav network hostPorts with port http:56595
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  annotations:
    kubeblocks.io/crd-api-version: apps.kubeblocks.io/v1
  creationTimestamp: "2026-07-02T05:01:36Z"
  finalizers:
  - cluster.kubeblocks.io/finalizer
  generation: 4
  name: elastics-hnrvav
  namespace: default
  resourceVersion: "242370123"
  uid: f2950dab-0af6-4c93-9472-30a9dc52f8d7
spec:
  componentSpecs:
  - componentDef: elasticsearch-master-8-1.1.0-alpha.0
    configs:
    - name: es-cm
      variables:
        version: 8.15.5
    disableExporter: false
    flatInstanceOrdinal: false
    name: master
    network:
      hostNetwork: false
      hostPorts:
      - name: http
        port: 56595
    persistentVolumeClaimRetentionPolicy:
      whenDeleted: Delete
    podUpdatePolicy: PreferInPlace
    replicas: 3
    resources:
      limits:
        cpu: 500m
        memory: 2Gi
      requests:
        cpu: 500m
        memory: 2Gi
    schedulingPolicy:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchLabels:
                  app.kubernetes.io/instance: elastics-hnrvav
                  apps.kubeblocks.io/component-name: master
              topologyKey: kubernetes.io/hostname
            weight: 100
    serviceVersion: 8.15.5
    tls: false
    volumeClaimTemplates:
    - name: data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
  - componentDef: elasticsearch-data-8-1.1.0-alpha.0
    configs:
    - name: es-cm
      variables:
        version: 8.15.5
    disableExporter: false
    flatInstanceOrdinal: false
    name: data
    persistentVolumeClaimRetentionPolicy:
      whenDeleted: Delete
    podUpdatePolicy: PreferInPlace
    replicas: 3
    resources:
      limits:
        cpu: 500m
        memory: 2Gi
      requests:
        cpu: 500m
        memory: 2Gi
    schedulingPolicy:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchLabels:
                  app.kubernetes.io/instance: elastics-hnrvav
                  apps.kubeblocks.io/component-name: data
              topologyKey: kubernetes.io/hostname
            weight: 100
    serviceVersion: 8.15.5
    tls: false
    volumeClaimTemplates:
    - name: data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
  - componentDef: kibana-8-1.1.0-alpha.0
    disableExporter: false
    flatInstanceOrdinal: false
    name: kibana
    podUpdatePolicy: PreferInPlace
    replicas: 1
    resources:
      limits:
        cpu: 500m
        memory: 2Gi
      requests:
        cpu: 500m
        memory: 2Gi
    serviceVersion: 8.15.5
    tls: false
  terminationPolicy: WipeOut
  1. See error
kubectl get cluster  elastics-hnrvav       
NAME              CLUSTER-DEFINITION   TERMINATION-POLICY   STATUS     AGE
elastics-hnrvav                        WipeOut              Updating   131m
➜  ~ 
➜  ~ kubectl get cmp -l app.kubernetes.io/instance=elastics-hnrvav
NAME                     DEFINITION                             SERVICE-VERSION   STATUS     AGE
elastics-hnrvav-data     elasticsearch-data-8-1.1.0-alpha.0     8.15.5            Running    131m
elastics-hnrvav-kibana   kibana-8-1.1.0-alpha.0                 8.15.5            Running    131m
elastics-hnrvav-master   elasticsearch-master-8-1.1.0-alpha.0   8.15.5            Updating   131m
➜  ~ 
➜  ~ kubectl get pod -l app.kubernetes.io/instance=elastics-hnrvav
NAME                       READY   STATUS    RESTARTS   AGE
elastics-hnrvav-data-0     4/4     Running   0          132m
elastics-hnrvav-data-1     4/4     Running   0          132m
elastics-hnrvav-data-2     4/4     Running   0          132m
elastics-hnrvav-kibana-0   1/1     Running   0          132m
elastics-hnrvav-master-0   4/4     Running   0          132m
elastics-hnrvav-master-1   4/4     Running   0          132m
➜  ~ 
➜  ~ kubectl get its -l app.kubernetes.io/instance=elastics-hnrvav
NAME                     DESIRED   UP-TO-DATE   READY   AVAILABLE   AGE
elastics-hnrvav-data     3         3            3       3           132m
elastics-hnrvav-kibana   1         1            1       1           132m
elastics-hnrvav-master   3                      2       2           132m

describe its

kubectl describe its elastics-hnrvav-master 
Name:         elastics-hnrvav-master
Namespace:    default
Labels:       app.kubernetes.io/instance=elastics-hnrvav
              app.kubernetes.io/managed-by=kubeblocks
              apps.kubeblocks.io/component-name=master
Annotations:  app.kubernetes.io/component: elasticsearch-master-8-1.1.0-alpha.0
              apps.kubeblocks.io/replicas-status:
                {"replicas":3,"status":[{"name":"elastics-hnrvav-master-2","generation":"1","creationTimestamp":"0001-01-01T00:00:00Z","provisioned":true}...
              apps.kubeblocks.io/service-version: 8.15.5
              kubeblocks.io/crd-api-version: workloads.kubeblocks.io/v1
              kubeblocks.io/generation: 4
              monitor.kubeblocks.io/path.headless.its: /metrics
              monitor.kubeblocks.io/port.headless.its: 9114
              monitor.kubeblocks.io/scheme.headless.its: http
              monitor.kubeblocks.io/scrape.headless.its: true
              workloads.kubeblocks.io/service-account-in-use: kb-elastics-hnrvav-master
API Version:  workloads.kubeblocks.io/v1
Kind:         InstanceSet
Metadata:
  Creation Timestamp:  2026-07-02T05:01:36Z
  Finalizers:
    component.kubeblocks.io/finalizer
    instanceset.workloads.kubeblocks.io/finalizer
  Generation:  3
  Owner References:
    API Version:           apps.kubeblocks.io/v1
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  Component
    Name:                  elastics-hnrvav-master
    UID:                   214e3a9c-d392-4013-99b0-01b8978a678e
  Resource Version:        242370082
  UID:                     8f806510-b56b-43e5-a0da-5b36f51a5651
Spec:
  Disable Default Headless Service:  false
  Flat Instance Ordinal:             false
  Lifecycle Actions:
    Template Vars:
      ALL_CMP_REPLICA_FQDN:     data:elastics-hnrvav-data-0.elastics-hnrvav-data-headless.default.svc.cluster.local,elastics-hnrvav-data-1.elastics-hnrvav-data-headless.default.svc.cluster.local,elastics-hnrvav-data-2.elastics-hnrvav-data-headless.default.svc.cluster.local;master:elastics-hnrvav-master-0.elastics-hnrvav-master-headless.default.svc.cluster.local,elastics-hnrvav-master-1.elastics-hnrvav-master-headless.default.svc.cluster.local,elastics-hnrvav-master-2.elastics-hnrvav-master-headless.default.svc.cluster.local
      ALL_CMP_REPLICA_LIST:     data:elastics-hnrvav-data-0,elastics-hnrvav-data-1,elastics-hnrvav-data-2;master:elastics-hnrvav-master-0,elastics-hnrvav-master-1,elastics-hnrvav-master-2
      CLUSTER_DOMAIN:           cluster.local
      CLUSTER_NAME:             elastics-hnrvav
      CLUSTER_NAMESPACE:        default
      ELASTICSEARCH_HOST:       elastics-hnrvav-master-http
      ELASTICSEARCH_PORT:       9200
      ELASTICSEARCH_ROLES:      master,ingest
      ELASTICSEARCH_VERSION:    8.15.5
      ELASTIC_PASSWORD:         $(ELASTIC_USER_PASSWORD)
      ELASTIC_USERNAME:         elastic
      ES_COMPONENT_NAME:        elastics-hnrvav-master
      ES_COMPONENT_SHORT_NAME:  master
      ZONE_AWARE_ENABLED:       false
  Member Update Strategy:       Parallel
  Min Ready Seconds:            0
  Ordinals:
  Parallel Pod Management Concurrency:  100%
  Persistent Volume Claim Retention Policy:
    When Deleted:         Delete
    When Scaled:          Delete
  Pod Management Policy:  Parallel
  Pod Update Policy:      PreferInPlace
  Pod Upgrade Policy:     ReCreate
  Replicas:               3
  Selector:
    Match Labels:
      app.kubernetes.io/instance:         elastics-hnrvav
      app.kubernetes.io/managed-by:       kubeblocks
      apps.kubeblocks.io/component-name:  master
      apps.kubeblocks.io/release-phase:   stable
  Template:
    Metadata:
      Labels:
        app.kubernetes.io/component:         elasticsearch-master-8-1.1.0-alpha.0
        app.kubernetes.io/instance:          elastics-hnrvav
        app.kubernetes.io/managed-by:        kubeblocks
        apps.kubeblocks.io/component-name:   master
        apps.kubeblocks.io/release-phase:    stable
        apps.kubeblocks.io/service-version:  8.15.5
    Spec:
      Affinity:
        Pod Anti Affinity:
          Preferred During Scheduling Ignored During Execution:
            Pod Affinity Term:
              Label Selector:
                Match Labels:
                  app.kubernetes.io/instance:         elastics-hnrvav
                  apps.kubeblocks.io/component-name:  master
              Topology Key:                           kubernetes.io/hostname
            Weight:                                   100
      Containers:
        Command:
          sh
          -c
          /mnt/remote-scripts/entrypoint.sh

        Env:
          Name:  ELASTIC_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      ELASTIC_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      KIBANA_SYSTEM_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-kibana-system
          Name:      POD_IP
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   status.podIP
          Name:             POD_NAME
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   metadata.name
          Name:             NODE_NAME
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   spec.nodeName
          Name:             KB_NAMESPACE
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   metadata.namespace
          Name:             POD_FQDN
          Value:            $(POD_NAME).$(ES_COMPONENT_NAME)-headless.$(KB_NAMESPACE).svc.$(CLUSTER_DOMAIN)
          Name:             READINESS_PROBE_PROTOCOL
          Value:            http
          Name:             NSS_SDB_USE_CACHE
          Value:            no
          Name:             CLUSTER_FORMED_FILE
          Value:            /usr/share/elasticsearch/data/cluster-formed
        Env From:
          Config Map Ref:
            Name:           elastics-hnrvav-master-env
            Optional:       false
        Image:              apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/elasticsearch:8.15.5
        Image Pull Policy:  IfNotPresent
        Lifecycle:
          Post Start:
            Exec:
              Command:
                bash
                -c
                /mnt/remote-scripts/post-start-hook.sh > /tmp/post-start-hook.log 2>&1

          Pre Stop:
            Exec:
              Command:
                bash
                -c
                /mnt/remote-scripts/pre-stop-hook.sh > /tmp/pre-stop-hook.log 2>&1

        Name:  elasticsearch
        Ports:
          Container Port:  9200
          Host Port:       56595
          Name:            http
          Protocol:        TCP
          Container Port:  9300
          Name:            transport
          Protocol:        TCP
        Readiness Probe:
          Exec:
            Command:
              bash
              -c
              /mnt/remote-scripts/readiness-probe-script.sh
          Failure Threshold:      3
          Initial Delay Seconds:  30
          Period Seconds:         5
          Success Threshold:      1
          Timeout Seconds:        5
        Resources:
          Limits:
            Cpu:     500m
            Memory:  2Gi
          Requests:
            Cpu:     500m
            Memory:  2Gi
        Security Context:
          Allow Privilege Escalation:  false
          Capabilities:
            Drop:
              ALL
          Privileged:                 false
          Read Only Root Filesystem:  true
          Run As Non Root:            true
          Run As User:                1000
        Volume Mounts:
          Mount Path:  /usr/share/elasticsearch/bin
          Name:        local-bin
          Mount Path:  /usr/share/elasticsearch/config
          Name:        local-config
          Mount Path:  /usr/share/elasticsearch/plugins
          Name:        local-plugins
          Mount Path:  /usr/share/elasticsearch/data
          Name:        data
          Mount Path:  /usr/share/elasticsearch/logs
          Name:        log
          Mount Path:  /mnt/remote-config
          Name:        es-cm
          Read Only:   true
          Mount Path:  /mnt/remote-scripts
          Name:        scripts
          Read Only:   true
          Mount Path:  /tmp
          Name:        tmp-volume
        Command:
          sh
          -c
          /mnt/remote-scripts/exporter-entrypoint.sh

        Env:
          Name:  ELASTIC_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      ELASTIC_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      KIBANA_SYSTEM_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-kibana-system
          Name:      SERVICE_PORT
          Value:     9114
        Env From:
          Config Map Ref:
            Name:      elastics-hnrvav-master-env
            Optional:  false
        Image:         apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/elasticsearch-exporter:v1.7.0
        Liveness Probe:
          Http Get:
            Path:                 /healthz
            Port:                 metrics
          Initial Delay Seconds:  5
          Period Seconds:         5
          Timeout Seconds:        5
        Name:                     exporter
        Ports:
          Container Port:  9114
          Name:            metrics
          Protocol:        TCP
        Readiness Probe:
          Http Get:
            Path:                 /healthz
            Port:                 metrics
          Initial Delay Seconds:  1
          Period Seconds:         5
          Timeout Seconds:        5
        Resources:
          Limits:
            Cpu:     0
            Memory:  0
        Volume Mounts:
          Mount Path:  /mnt/remote-scripts
          Name:        scripts
          Read Only:   true
        Command:
          /usr/share/elasticsearch/bin/es-agent
        Env:
          Name:  ELASTIC_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      ELASTIC_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      KIBANA_SYSTEM_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-kibana-system
          Name:      POD_IP
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   status.podIP
          Name:             POD_NAME
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   metadata.name
          Name:             KB_NAMESPACE
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   metadata.namespace
          Name:             POD_FQDN
          Value:            $(POD_NAME).$(ES_COMPONENT_NAME)-headless.$(KB_NAMESPACE).svc.$(CLUSTER_DOMAIN)
          Name:             NODE_NAME
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   spec.nodeName
          Name:             ELASTIC_USERNAME
          Value:            elastic
          Name:             ELASTIC_PASSWORD
          Value:            $(ELASTIC_USER_PASSWORD)
          Name:             ELASTICSEARCH_HOST
          Value:            localhost
          Name:             ELASTICSEARCH_PORT
          Value:            9200
          Name:             AGENT_PORT
          Value:            8080
        Env From:
          Config Map Ref:
            Name:           elastics-hnrvav-master-env
            Optional:       false
        Image:              apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/elasticsearch:8.15.5
        Image Pull Policy:  IfNotPresent
        Liveness Probe:
          Http Get:
            Path:                 /health
            Port:                 agent
          Initial Delay Seconds:  10
          Period Seconds:         10
          Timeout Seconds:        5
        Name:                     es-agent
        Ports:
          Container Port:  8080
          Name:            agent
          Protocol:        TCP
        Readiness Probe:
          Http Get:
            Path:                 /health
            Port:                 agent
          Initial Delay Seconds:  5
          Period Seconds:         5
          Timeout Seconds:        5
        Resources:
          Limits:
            Cpu:     0
            Memory:  0
        Security Context:
          Allow Privilege Escalation:  false
          Capabilities:
            Drop:
              ALL
          Privileged:                 false
          Read Only Root Filesystem:  false
          Run As Non Root:            true
          Run As User:                1000
        Volume Mounts:
          Mount Path:  /usr/share/elasticsearch/bin
          Name:        local-bin
          Mount Path:  /usr/share/elasticsearch/config
          Name:        local-config
          Mount Path:  /usr/share/elasticsearch/data
          Name:        data
        Args:
          --port
          3501
          --streaming-port
          3502
        Command:
          /kubeblocks/kbagent
        Env:
          Name:  ELASTIC_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      ELASTIC_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      KIBANA_SYSTEM_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-kibana-system
          Name:      KB_AGENT_NAMESPACE
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   metadata.namespace
          Name:             KB_AGENT_POD_NAME
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   metadata.name
          Name:             KB_AGENT_POD_UID
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   metadata.uid
          Name:             KB_AGENT_NODE_NAME
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   spec.nodeName
          Name:             KB_AGENT_ACTION
          Value:            [{"name":"memberLeave","exec":{"command":["/bin/sh","-c","/mnt/remote-scripts/member-leave.sh"]}}]
          Name:             KB_AGENT_PROBE
          Value:            null
        Env From:
          Config Map Ref:
            Name:           elastics-hnrvav-master-env
            Optional:       false
        Image:              apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/curl-jq:0.1.0
        Image Pull Policy:  IfNotPresent
        Name:               kbagent
        Ports:
          Container Port:  3501
          Host Port:       56595
          Name:            http
          Protocol:        TCP
          Container Port:  3502
          Name:            streaming
          Protocol:        TCP
        Resources:
          Limits:
            Cpu:     0
            Memory:  0
        Security Context:
          Run As Group:  1000
        Startup Probe:
          Tcp Socket:
            Port:  3501
        Volume Mounts:
          Mount Path:  /kubeblocks
          Name:        kubeblocks
          Mount Path:  /usr/share/elasticsearch/bin
          Name:        local-bin
          Mount Path:  /usr/share/elasticsearch/config
          Name:        local-config
          Mount Path:  /usr/share/elasticsearch/plugins
          Name:        local-plugins
          Mount Path:  /usr/share/elasticsearch/data
          Name:        data
          Mount Path:  /usr/share/elasticsearch/logs
          Name:        log
          Mount Path:  /mnt/remote-config
          Name:        es-cm
          Read Only:   true
          Mount Path:  /mnt/remote-scripts
          Name:        scripts
          Read Only:   true
          Mount Path:  /tmp
          Name:        tmp-volume
          Mount Path:  /etc/kubeblocks/pod-metadata
          Name:        kubeblocks-role-label
          Read Only:   true
      Dns Policy:      ClusterFirst
      Init Containers:
        Command:
          sh
          -c
          if [ -d /plugins ]; then
  echo "install plugins: $(ls /plugins)"
  cp -r /plugins/* /tmp/plugins/
else
  echo "there is no plugins"
fi

        Env:
          Name:  ELASTIC_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      ELASTIC_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      KIBANA_SYSTEM_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-kibana-system
        Env From:
          Config Map Ref:
            Name:           elastics-hnrvav-master-env
            Optional:       false
        Image:              apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/elasticsearch-plugins:0.1.0
        Image Pull Policy:  IfNotPresent
        Name:               prepare-plugins
        Resources:
          Limits:
            Cpu:     0
            Memory:  0
        Security Context:
          Privileged:   true
          Run As User:  0
        Volume Mounts:
          Mount Path:  /tmp/plugins
          Name:        plugins
        Command:
          sh
          -c
          /plugins/pick-plugins.sh all $ELASTICSEARCH_VERSION /mnt/local-plugins

        Env:
          Name:  ELASTIC_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      ELASTIC_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      KIBANA_SYSTEM_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-kibana-system
        Env From:
          Config Map Ref:
            Name:           elastics-hnrvav-master-env
            Optional:       false
        Image:              apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/elasticsearch-custom-plugins:0.1.3
        Image Pull Policy:  IfNotPresent
        Name:               prepare-custom-plugins
        Resources:
          Limits:
            Cpu:     0
            Memory:  0
        Security Context:
          Allow Privilege Escalation:  false
          Capabilities:
            Drop:
              ALL
          Privileged:       false
          Run As Non Root:  true
          Run As User:      1000
        Volume Mounts:
          Mount Path:  /mnt/local-plugins
          Name:        local-plugins
        Command:
          sh
          -c
          set -x
sh /mnt/remote-scripts/install-plugins.sh
sh /mnt/remote-scripts/prepare-fs.sh

        Env:
          Name:  ELASTIC_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      ELASTIC_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      KIBANA_SYSTEM_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-kibana-system
        Env From:
          Config Map Ref:
            Name:           elastics-hnrvav-master-env
            Optional:       false
        Image:              apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/elasticsearch:8.15.5
        Image Pull Policy:  IfNotPresent
        Name:               install-plugins
        Resources:
          Limits:
            Cpu:     0
            Memory:  0
        Security Context:
          Allow Privilege Escalation:  false
          Capabilities:
            Drop:
              ALL
          Privileged:       false
          Run As Non Root:  true
          Run As User:      1000
        Volume Mounts:
          Mount Path:  /mnt/remote-config
          Name:        es-cm
          Read Only:   true
          Mount Path:  /mnt/remote-scripts
          Name:        scripts
          Read Only:   true
          Mount Path:  /mnt/local-bin
          Name:        local-bin
          Mount Path:  /mnt/local-config
          Name:        local-config
          Mount Path:  /mnt/local-plugins
          Name:        local-plugins
          Mount Path:  /tmp/plugins
          Name:        plugins
        Command:
          sh
          -c
          cp /usr/local/bin/agent /mnt/local-bin/es-agent

        Env:
          Name:  ELASTIC_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      ELASTIC_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      KIBANA_SYSTEM_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-kibana-system
        Env From:
          Config Map Ref:
            Name:           elastics-hnrvav-master-env
            Optional:       false
        Image:              apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/elasticsearch-agent:0.1.1
        Image Pull Policy:  IfNotPresent
        Name:               install-es-agent
        Resources:
          Limits:
            Cpu:     0
            Memory:  0
        Security Context:
          Allow Privilege Escalation:  false
          Capabilities:
            Drop:
              ALL
          Privileged:       false
          Run As Non Root:  true
          Run As User:      1000
        Volume Mounts:
          Mount Path:  /mnt/local-bin
          Name:        local-bin
        Command:
          cp
          -r
          /bin/kbagent
          /kubeblocks/
        Env:
          Name:  ELASTIC_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      ELASTIC_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      KIBANA_SYSTEM_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-kibana-system
        Env From:
          Config Map Ref:
            Name:           elastics-hnrvav-master-env
            Optional:       false
        Image:              apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks-tools:1.1.0-beta.7
        Image Pull Policy:  IfNotPresent
        Name:               init-kbagent
        Resources:
          Limits:
            Cpu:     0
            Memory:  0
        Volume Mounts:
          Mount Path:  /kubeblocks
          Name:        kubeblocks
        Args:
          --server=false
        Command:
          /kubeblocks/kbagent
        Env:
          Name:  ELASTIC_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      ELASTIC_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-elastic
          Name:      KIBANA_SYSTEM_USER_PASSWORD
          Value From:
            Secret Key Ref:
              Key:   password
              Name:  elastics-hnrvav-master-account-kibana-system
          Name:      KB_AGENT_NAMESPACE
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   metadata.namespace
          Name:             KB_AGENT_POD_NAME
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   metadata.name
          Name:             KB_AGENT_POD_UID
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   metadata.uid
          Name:             KB_AGENT_NODE_NAME
          Value From:
            Field Ref:
              API Version:  v1
              Field Path:   spec.nodeName
          Name:             KB_AGENT_ACTION
          Value:            [{"name":"memberLeave","exec":{"command":["/bin/sh","-c","/mnt/remote-scripts/member-leave.sh"]}}]
          Name:             KB_AGENT_PROBE
          Value:            null
        Env From:
          Config Map Ref:
            Name:           elastics-hnrvav-master-env
            Optional:       false
        Image:              apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/curl-jq:0.1.0
        Image Pull Policy:  IfNotPresent
        Name:               kbagent-worker
        Resources:
          Limits:
            Cpu:     0
            Memory:  0
        Security Context:
          Run As Group:  1000
        Volume Mounts:
          Mount Path:  /kubeblocks
          Name:        kubeblocks
          Mount Path:  /usr/share/elasticsearch/bin
          Name:        local-bin
          Mount Path:  /usr/share/elasticsearch/config
          Name:        local-config
          Mount Path:  /usr/share/elasticsearch/plugins
          Name:        local-plugins
          Mount Path:  /usr/share/elasticsearch/data
          Name:        data
          Mount Path:  /usr/share/elasticsearch/logs
          Name:        log
          Mount Path:  /mnt/remote-config
          Name:        es-cm
          Read Only:   true
          Mount Path:  /mnt/remote-scripts
          Name:        scripts
          Read Only:   true
          Mount Path:  /tmp
          Name:        tmp-volume
      Security Context:
        Fs Group:            1000
      Service Account Name:  kb-elastics-hnrvav-master
      Volumes:
        Empty Dir:
        Name:  log
        Empty Dir:
        Name:  tmp-volume
        Empty Dir:
        Name:  local-bin
        Empty Dir:
        Name:  local-config
        Empty Dir:
        Name:  local-plugins
        Empty Dir:
        Name:  plugins
        Downward API:
          Items:
            Field Ref:
              Field Path:  metadata.labels['kubeblocks.io/role']
            Path:          role
        Name:              kubeblocks-role-label
        Empty Dir:
        Name:  data
        Empty Dir:
        Name:  kubeblocks
        Config Map:
          Default Mode:  292
          Name:          elastics-hnrvav-master-es-cm
        Name:            es-cm
        Config Map:
          Default Mode:  365
          Name:          elastics-hnrvav-master-scripts
        Name:            scripts
  Volume Claim Templates:
    Metadata:
      Name:  data
    Spec:
      Access Modes:
        ReadWriteOnce
      Resources:
        Requests:
          Storage:  20Gi
    Status:
Status:
  Available Replicas:  2
  Conditions:
    Last Transition Time:  2026-07-02T05:05:00Z
    Message:               ["elastics-hnrvav-master-2"]
    Observed Generation:   3
    Reason:                NotReady
    Status:                False
    Type:                  InstanceReady
    Last Transition Time:  2026-07-02T05:05:00Z
    Message:               []
    Observed Generation:   3
    Reason:                NotAvailable
    Status:                False
    Type:                  InstanceAvailable
  Current Replicas:        2
  Current Revision:        6c9d97f496
  Current Revisions:
    elastics-hnrvav-master-0:  6c9d97f496
    elastics-hnrvav-master-1:  6c9d97f496
    elastics-hnrvav-master-2:  6c9d97f496
  Init Replicas:               0
  Instance Status:
    Pod Name:           elastics-hnrvav-master-0
    Pod Name:           elastics-hnrvav-master-1
    Pod Name:           elastics-hnrvav-master-2
  Observed Generation:  3
  Ready Replicas:       2
  Replicas:             3
  Update Revision:      6985f7cdc9
  Update Revisions:
    elastics-hnrvav-master-0:  6985f7cdc9
    elastics-hnrvav-master-1:  6985f7cdc9
    elastics-hnrvav-master-2:  6985f7cdc9
Events:
  Type     Reason            Age                   From                     Message
  ----     ------            ----                  ----                     -------
  Normal   SuccessfulUpdate  7m3s (x96 over 132m)  instance-set-controller  update Service elastics-hnrvav-master-headless in InstanceSet elastics-hnrvav-master successful
  Warning  FailedReconcile   7m3s (x26 over 128m)  instance-set-controller  create *v1.Pod default/elastics-hnrvav-master-2 failed: Pod "elastics-hnrvav-master-2" is invalid: spec.containers[3].ports[0].hostPort: Duplicate value: "TCP//56595"

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions