From 3d721af906deeb8ed875243d788d88f9e7e09a39 Mon Sep 17 00:00:00 2001 From: Ishan Tyagi <42602577+ishan16696@users.noreply.github.com> Date: Tue, 14 Jun 2022 15:24:18 +0530 Subject: [PATCH] Update the readiness/liveness Probes configuration. (#357) * Update the readiness/liveness Probes configuration. * Address review feedback * Fix the unit tests. --- charts/etcd/templates/etcd-statefulset.yaml | 3 +++ controllers/etcd_controller_test.go | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/charts/etcd/templates/etcd-statefulset.yaml b/charts/etcd/templates/etcd-statefulset.yaml index dfa0b90d6..09a4f8b81 100644 --- a/charts/etcd/templates/etcd-statefulset.yaml +++ b/charts/etcd/templates/etcd-statefulset.yaml @@ -79,6 +79,7 @@ spec: {{ end }} initialDelaySeconds: 15 periodSeconds: 5 + failureThreshold: 5 livenessProbe: exec: command: @@ -99,8 +100,10 @@ spec: # {{- end }} - get - foo + - --consistency=s initialDelaySeconds: 15 periodSeconds: 5 + failureThreshold: 5 ports: - containerPort: {{ .Values.etcd.serverPort }} name: server diff --git a/controllers/etcd_controller_test.go b/controllers/etcd_controller_test.go index 214557c31..d71df5139 100644 --- a/controllers/etcd_controller_test.go +++ b/controllers/etcd_controller_test.go @@ -1176,8 +1176,9 @@ func validateEtcdWithDefaults(instance *druidv1alpha1.Etcd, s *appsv1.StatefulSe "ETCDCTL_API=3": Equal("ETCDCTL_API=3"), "etcdctl": Equal("etcdctl"), fmt.Sprintf("--endpoints=http://%s-local:%d", instance.Name, clientPort): Equal(fmt.Sprintf("--endpoints=http://%s-local:%d", instance.Name, clientPort)), - "get": Equal("get"), - "foo": Equal("foo"), + "get": Equal("get"), + "foo": Equal("foo"), + "--consistency=s": Equal("--consistency=s"), }), })), }), @@ -1565,8 +1566,9 @@ func validateEtcd(instance *druidv1alpha1.Etcd, s *appsv1.StatefulSet, cm *corev "--key=/var/etcd/ssl/client/client/tls.key": Equal("--key=/var/etcd/ssl/client/client/tls.key"), "--cacert=/var/etcd/ssl/client/ca/ca.crt": Equal("--cacert=/var/etcd/ssl/client/ca/ca.crt"), fmt.Sprintf("--endpoints=https://%s-local:%d", instance.Name, clientPort): Equal(fmt.Sprintf("--endpoints=https://%s-local:%d", instance.Name, clientPort)), - "get": Equal("get"), - "foo": Equal("foo"), + "get": Equal("get"), + "foo": Equal("foo"), + "--consistency=s": Equal("--consistency=s"), }), })), }),