Elastic cloud on kubernetes to set password to a constant value and not change on every installation

4/23/2020

I am using eck, and on every installation, the eck operator set a new password. Possible to fix the password to a constant value? anyone tried this?

-- Minisha
elastic-cloud
elasticsearch
kubernetes

1 Answer

4/23/2020

your secret name should be like : {clusterName}-es-elastic-user

kubectl create secret generic my-cluster-es-elastic-user --from-literal=elastic=foobar

secret/my-cluster-es-elastic-user created

$ cat <<'EOFTEST' | kubectl apply -f -
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: my-cluster
spec:
  version: 7.1.0
  nodes:
  - nodeCount: 1
EOFTEST

elasticsearch.elasticsearch.k8s.elastic.co/my-cluster configured

another terminal:
$ kubectl port-forward service/my-cluster-es 9200:9200
$ curl -k -u elastic:foobar https://localhost:9200
{
  "name" : "testing-es-5ps8sl8sfn",
  "cluster_name" : "my-cluster",
  ...
  "tagline" : "You Know, for Search"
}

For more info, you can visit official repo: https://github.com/elastic/cloud-on-k8s/issues/967#issuecomment-497636249

-- Harsh Manvar
Source: StackOverflow