Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]how to set elasticsearch cluster password #8196

Closed
shuoshadow opened this issue Sep 24, 2024 · 3 comments
Closed

[BUG]how to set elasticsearch cluster password #8196

shuoshadow opened this issue Sep 24, 2024 · 3 comments
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@shuoshadow
Copy link

shuoshadow commented Sep 24, 2024

I set the Elasticsearch cluster’s user password using environment variables, but it doesn’t take effect.

apiVersion: v1
kind: Secret
metadata:
  name: elastic-credentials
  namespace: kb-cloud
type: Opaque
stringData:
  username: elastic
  password: vYxdfazdfIJnnKas
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  annotations:
    kubeblocks.io/extra-env: '{"mdit-roles":"master,data,ingest,transform","mode":"multi-node"}'
  labels:
    app.kubernetes.io/instance: dev-es
    app.kubernetes.io/version: 7.10.1
    helm.sh/chart: elasticsearch-cluster-0.9.0
  name: dev-es
  namespace: kb-cloud
spec:
  tolerations:
    - key: "node-type"
      operator: "Equal"
      value: "mid"
      effect: "NoSchedule"
  affinity:
    podAntiAffinity: Required
    tenancy: SharedNode
    #topologyKeys:
    #- kubernetes.io/hostname
    nodeLabels:
      node-type: "mid"
  componentSpecs:
    - componentDef: elasticsearch-7
      disableExporter: false
      env:
        - name: ELASTIC_USERNAME
          valueFrom:
            secretKeyRef:
              name: elastic-credentials
              key: username
        - name: ELASTIC_PASSWORD
          valueFrom:
            secretKeyRef:
              name: elastic-credentials
              key: password
      name: mdit
      replicas: 3
      resources:
        limits:
          cpu: "4"
          memory: 8Gi
        requests:
          cpu: "4"
          memory: 8Gi
      serviceAccountName: null
      serviceVersion: 7.10.1
      services: null
      systemAccounts:
      - name: elastic
      volumeClaimTemplates:
      - name: data
        spec:
          accessModes:
          - ReadWriteOnce
          resources:
            requests:
              storage: 500Gi
          storageClassName: openebs-hostpath
  terminationPolicy: Delete
@shuoshadow shuoshadow added the kind/bug Something isn't working label Sep 24, 2024
@shanshanying
Copy link
Contributor

Hi @shuoshadow

thanks for reporting the issue. In ES addon, we did not explicitly set the password for any accounts, and the ENVs (ELASTIC_USERNAME, ELASTIC_USERNAME ) are not recognized during bootstarp stage to create accounts.

You can fire a feature issue in our KubeBlocks-Addon repo and specify how would you prefer to provision the account for ES:
https://github.com/apecloud/kubeblocks-addons/issues

@shuoshadow
Copy link
Author

shuoshadow commented Sep 25, 2024

@shanshanying
Tanks, I submitted an issue in the addon repository apecloud/kubeblocks-addons#1062

@shanshanying
Copy link
Contributor

Hi @shuoshadow

Got it. I will close this issue then.

@github-actions github-actions bot added this to the Release 0.9.2 milestone Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants