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

Issue 275: Made changes for configuring probes #290

Merged
merged 4 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,57 @@ spec:
- containerPort
type: object
type: array
probes:
description: Probes specifies the timeout values for the Readiness and
Liveness Probes for the zookeeper pods.
properties:
livenessProbe:
properties:
failureThreshold:
format: int32
minimum: 0
type: integer
initialDelaySeconds:
format: int32
minimum: 0
type: integer
periodSeconds:
format: int32
minimum: 0
type: integer
successThreshold:
format: int32
minimum: 0
type: integer
timeoutSeconds:
format: int32
minimum: 0
type: integer
type: object
readinessProbe:
properties:
failureThreshold:
format: int32
minimum: 0
type: integer
initialDelaySeconds:
format: int32
minimum: 0
type: integer
periodSeconds:
format: int32
minimum: 0
type: integer
successThreshold:
format: int32
minimum: 0
type: integer
timeoutSeconds:
format: int32
minimum: 0
type: integer
type: object
type: object
replicas:
description: "Replicas is the expected size of the zookeeper cluster.
The pravega-operator will eventually make the size of the running
Expand Down
9 changes: 9 additions & 0 deletions charts/zookeeper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ The following table lists the configurable parameters of the zookeeper chart and
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `domainName` | External host name appended for dns annotation | |
| `kubernetesClusterDomain` | Domain of the kubernetes cluster | `cluster.local` |
| `probes.readiness.initialDelaySeconds` | Number of seconds after the container has started before readiness probe is initiated | `10` |
| `probes.readiness.periodSeconds` | Number of seconds in which readiness probe will be performed | `10` |
| `probes.readiness.failureThreshold` | Number of seconds after which the readiness probe times out | `3` |
| `probes.readiness.successThreshold` | Minimum number of consecutive successes for the readiness probe to be considered successful after having failed | `1` |
| `probes.readiness.timeoutSeconds` | Number of times Kubernetes will retry after a readiness probe failure before restarting the container | `10` |
| `probes.liveness.initialDelaySeconds` | Number of seconds after the container has started before liveness probe is initiated | `10` |
| `probes.liveness.periodSeconds` | Number of seconds in which liveness probe will be performed | `10` |
| `probes.liveness.failureThreshold` | Number of seconds after which the liveness probe times out | `3` |
| `probes.liveness.timeoutSeconds` | Number of times Kubernetes will retry after a liveness probe failure before restarting the container | `10` |
| `labels` | Specifies the labels to be attached | `{}` |
| `ports` | Groups the ports for a zookeeper cluster node for easy access | `[]` |
| `pod` | Defines the policy to create new pods for the zookeeper cluster | `{}` |
Expand Down
18 changes: 18 additions & 0 deletions charts/zookeeper/templates/zookeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ spec:
domainName: {{ .Values.domainName }}
{{- end }}
kubernetesClusterDomain: {{ default "cluster.local" .Values.kubernetesClusterDomain }}
{{- if .Values.probes }}
probes:
{{- if .Values.probes.readiness }}
readinessProbe:
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds | default 10 }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds | default 10 }}
failureThreshold: {{ .Values.probes.readiness.failureThreshold | default 3}}
successThreshold: {{ .Values.probes.readiness.successThreshold | default 1 }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds | default 10}}
{{- end }}
{{- if .Values.probes.liveness }}
livenessProbe:
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds | default 10 }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds | default 10 }}
failureThreshold: {{ .Values.probes.liveness.failureThreshold | default 3 }}
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds | default 10 }}
{{- end }}
{{- end }}
{{- if .Values.containers }}
containers:
{{ toYaml .Values.containers | indent 4 }}
Expand Down
13 changes: 12 additions & 1 deletion charts/zookeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@ domainName:
labels: {}
ports: []
kubernetesClusterDomain: "cluster.local"

probes:
readiness:
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 3
successThreshold: 1
timeoutSeconds: 10
liveness:
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 3
timeoutSeconds: 10
pod:
# labels: {}
# nodeSelector: {}
Expand Down
51 changes: 51 additions & 0 deletions deploy/crds/zookeeper.pravega.io_zookeeperclusters_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2436,6 +2436,57 @@ spec:
- containerPort
type: object
type: array
probes:
description: Probes specifies the timeout values for the Readiness and
Liveness Probes for the zookeeper pods.
properties:
livenessProbe:
properties:
failureThreshold:
format: int32
minimum: 0
type: integer
initialDelaySeconds:
format: int32
minimum: 0
type: integer
periodSeconds:
format: int32
minimum: 0
type: integer
successThreshold:
format: int32
minimum: 0
type: integer
timeoutSeconds:
format: int32
minimum: 0
type: integer
type: object
readinessProbe:
properties:
failureThreshold:
format: int32
minimum: 0
type: integer
initialDelaySeconds:
format: int32
minimum: 0
type: integer
periodSeconds:
format: int32
minimum: 0
type: integer
successThreshold:
format: int32
minimum: 0
type: integer
timeoutSeconds:
format: int32
minimum: 0
type: integer
type: object
type: object
replicas:
description: "Replicas is the expected size of the zookeeper cluster.
The pravega-operator will eventually make the size of the running
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ module github.com/pravega/zookeeper-operator
go 1.13

require (
4d63.com/gochecknoglobals v0.0.0-20201008074935-acfc0b28355a // indirect
dmitri.shuralyov.com/go/generated v0.0.0-20170818220700-b1254a446363 // indirect
github.com/alecthomas/gocyclo v0.0.0-20150208221726-aa8f8b160214 // indirect
github.com/alexkohler/nakedret v1.0.0 // indirect
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/go-logr/logr v0.1.0
github.com/gordonklaus/ineffassign v0.0.0-20201107091007-3b93a8888063 // indirect
Expand All @@ -16,10 +19,9 @@ require (
github.com/pkg/errors v0.9.1
github.com/prometheus/common v0.9.1
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da
github.com/securego/gosec v0.0.0-20200401082031-e946c8c39989 // indirect
github.com/sirupsen/logrus v1.5.0
github.com/stripe/safesql v0.2.0 // indirect
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
golang.org/x/tools v0.0.0-20200331202046-9d5940d49312 // indirect
k8s.io/api v0.17.5
k8s.io/apimachinery v0.17.5
k8s.io/client-go v12.0.0+incompatible
Expand Down
Loading