Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Implement Readiness Probe #6

Merged
merged 10 commits into from
Oct 29, 2019
1 change: 1 addition & 0 deletions operator/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tasks:
- cassandra-env-sh.yaml
- jvm-options.yaml
- stateful-set.yaml
- cassandra-healthcheck-sh.yaml

plans:
deploy:
Expand Down
12 changes: 12 additions & 0 deletions operator/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -701,3 +701,15 @@ JVM_OPT_MAX_GC_PAUSE_MILLIS:
JVM_OPT_G1R_SET_UPDATING_PAUSE_TIME_PERCENT:
description: "Have the JVM do less remembered set work during STW, instead preferring concurrent GC. Reduces p99.9 latency."
default:

READINESS_CHECK_INITIAL_DELAY:
description: "An amount of time in seconds to wait before starting the readiness check attempts."
phrynchanka marked this conversation as resolved.
Show resolved Hide resolved
default: "0"

READINESS_CHECK_PERIOD:
description: "The period in seconds to wait after the last readiness check has completed to start the next check."
phrynchanka marked this conversation as resolved.
Show resolved Hide resolved
default: "5"

READINESS_CHECK_TIMEOUT:
description: "An amount of time in seconds to wait for a readiness check to succeed."
default: "60"
7 changes: 7 additions & 0 deletions operator/templates/cassandra-healthcheck-sh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cassandra-healthcheck-sh
data:
cassandra-healthcheck.sh: |
echo "Hello!"
phrynchanka marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 13 additions & 0 deletions operator/templates/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ spec:
command:
- nodetool
- drain
readinessProbe:
exec:
command:
- nodetool status -p {{ .Params.JMX_PORT }}
phrynchanka marked this conversation as resolved.
Show resolved Hide resolved
initialDelaySeconds: {{ .Params.READINESS_CHECK_INITIAL_DELAY }}
periodSeconds: {{ .Params.READINESS_CHECK_PERIOD }}
timeoutSeconds: {{ .Params.READINESS_CHECK_TIMEOUT }}
command:
- cassandra
- -f
Expand Down Expand Up @@ -133,6 +140,9 @@ spec:
- name: jvm-options
mountPath: /etc/cassandra/jvm.options
subPath: jvm.options
- name: cassandra-healthcheck-sh
mountPath: /etc/cassandra/cassandra-healthcheck.sh
subPath: cassandra-healthcheck.sh
volumes:
# Overwriting /etc/cassandra/ available in the Docker image.
- name: etc-cassandra
Expand All @@ -146,6 +156,9 @@ spec:
- name: jvm-options
configMap:
name: {{ .Name }}-jvm-options
- name: cassandra-healthcheck-sh
configMap:
name: {{ .Name }}-cassandra-healthcheck-sh
volumeClaimTemplates:
- metadata:
name: var-lib-cassandra
Expand Down
1 change: 1 addition & 0 deletions templates/operator/operator.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ tasks:
- cassandra-env-sh.yaml
- jvm-options.yaml
- stateful-set.yaml
- cassandra-healthcheck-sh.yaml

plans:
deploy:
Expand Down