Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.02 KB

6.statefulset-etcd.MD

File metadata and controls

39 lines (29 loc) · 1.02 KB

Install helm

https://github.com/helm/helm/releases

Download bitnami etcd

helm repo add bitnami https://charts.bitnami.com/bitnami
helm pull bitnami/etcd
tar -xvf etcd-6.8.4.tgz
vi etcd/values.yaml

And set persistence to false:

persistence:
  ## @param persistence.enabled If true, use a Persistent Volume Claim. If false, use emptyDir.
  ##
  enabled: false

Install etcd by helm chart

helm install my-release ./etcd

Start etcd client

kubectl run my-release-etcd-client --restart='Never' --image docker.io/bitnami/etcd:3.5.0-debian-10-r94 --env ROOT_PASSWORD=$(kubectl get secret --namespace default my-release-etcd -o jsonpath="{.data.etcd-root-password}" | base64 --decode) --env ETCDCTL_ENDPOINTS="my-release-etcd.default.svc.cluster.local:2379" --namespace default --command -- sleep infinity
kubectl exec --namespace default -it my-release-etcd-client -- bash
etcdctl --user root:$ROOT_PASSWORD put /message Hello
etcdctl --user root:$ROOT_PASSWORD get /message