30d7ec0fb1415e9d3ed46052057e977fbab8f620
[multicloud/k8s.git] /
1 {{- if .Values.customResources.createEtcdClusterCRD -}}
2 1. Watch etcd cluster start
3   kubectl get pods -l etcd_cluster={{ .Values.etcdCluster.name }} --namespace {{ .Release.Namespace }} -w
4
5 2. Confirm etcd cluster is healthy
6   $ kubectl run --rm -i --tty --env="ETCDCTL_API=3" --env="ETCDCTL_ENDPOINTS=http://{{ .Values.etcdCluster.name }}-client:2379" --namespace {{ .Release.Namespace }} etcd-test --image quay.io/coreos/etcd --restart=Never -- /bin/sh -c 'watch -n1 "etcdctl  member list"'
7
8 3. Interact with the cluster!
9   $ kubectl run --rm -i --tty --env ETCDCTL_API=3 --namespace {{ .Release.Namespace }} etcd-test --image quay.io/coreos/etcd --restart=Never -- /bin/sh
10   / # etcdctl --endpoints http://{{ .Values.etcdCluster.name }}-client:2379 put foo bar
11   / # etcdctl --endpoints http://{{ .Values.etcdCluster.name }}-client:2379 get foo
12   OK
13   (ctrl-D to exit)
14   
15 4. Optional
16   Check the etcd-operator logs
17   export POD=$(kubectl get pods -l app={{ template "etcd-operator.fullname" . }} --namespace {{ .Release.Namespace }} --output name)
18   kubectl logs $POD --namespace={{ .Release.Namespace }}
19
20 {{- else -}}
21 1. etcd-operator deployed.
22   If you would like to deploy an etcd-cluster set 'customResources.createEtcdClusterCRD' to true in values.yaml
23   Check the etcd-operator logs
24     export POD=$(kubectl get pods -l app={{ template "etcd-operator.fullname" . }} --namespace {{ .Release.Namespace }} --output name)
25     kubectl logs $POD --namespace={{ .Release.Namespace }}
26
27 {{- end -}}