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

Readiness probe improvements #8

Merged
merged 5 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion operator/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tasks:
- cassandra-env-sh.yaml
- jvm-options.yaml
- stateful-set.yaml
- cassandra-readiness-probe-sh.yaml
- node-readiness-probe-sh.yaml

plans:
deploy:
Expand Down
40 changes: 20 additions & 20 deletions operator/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@ NODE_STORAGE_CLASS:
description: "The storage class to be used in volumeClaimTemplates. By default, it is not required and the default storage class is used."
required: false

NODE_READINESS_PROBE_INITIAL_DELAY:
description: "Number of seconds after the container has started before the readiness check is initiated."
default: "0"

NODE_READINESS_PROBE_PERIOD:
description: "How often (in seconds) to perform the readiness check."
default: "5"

NODE_READINESS_PROBE_TIMEOUT:
description: "An amount of time in seconds to wait for a readiness check to succeed."
default: "60"

NODE_READINESS_PROBE_SUCCESS_THRESHOLD:
description: "Minimum consecutive successes for the probe to be considered successful after having failed."
default: "1"

NODE_READINESS_PROBE_FAILURE_THRESHOLD:
description: "When a Pod starts and the check fails, Kubernetes will try failure_threshold times before giving up. Giving up means marking the pod Unready."
default: "3"

OVERRIDE_CLUSTER_NAME:
description: "Override the name of the Cassandra cluster set by the operator. This shouldn't be explicit set, unless you know what you're doing."
default: ""
Expand Down Expand Up @@ -701,23 +721,3 @@ 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_PROBE_INITIAL_DELAY:
description: "Number of seconds after the container has started before the readiness check is initiated."
default: "0"

READINESS_PROBE_PERIOD:
description: "How often (in seconds) to perform the readiness check."
default: "5"

READINESS_PROBE_TIMEOUT:
description: "An amount of time in seconds to wait for a readiness check to succeed."
default: "60"

READINESS_PROBE_SUCCESS_THRESHOLD:
description: "Minimum consecutive successes for the probe to be considered successful after having failed."
default: "1"

READINESS_PROBE_FAILURE_THRESHOLD:
description: "When a Pod starts and the check fails, Kubernetes will try failure_threshold times before giving up. Giving up means marking the pod Unready."
default: "3"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cassandra-readiness-probe-sh
name: node-readiness-probe-sh
data:
cassandra-readiness-probe.sh: |
node-readiness-probe.sh: |
nodetool status -p {{ .Params.JMX_PORT }} | grep -q "UN ${POD_IP}"
22 changes: 11 additions & 11 deletions operator/templates/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ spec:
exec:
command:
- /bin/bash
- /etc/cassandra/cassandra-readiness-probe.sh
initialDelaySeconds: {{ .Params.READINESS_PROBE_INITIAL_DELAY }}
periodSeconds: {{ .Params.READINESS_PROBE_PERIOD }}
timeoutSeconds: {{ .Params.READINESS_PROBE_TIMEOUT }}
successThreshold: {{ .Params.READINESS_PROBE_SUCCESS_THRESHOLD }}
failureThreshold: {{ .Params.READINESS_PROBE_FAILURE_THRESHOLD }}
- /etc/cassandra/node-readiness-probe.sh
initialDelaySeconds: {{ .Params.NODE_READINESS_PROBE_INITIAL_DELAY }}
periodSeconds: {{ .Params.NODE_READINESS_PROBE_PERIOD }}
timeoutSeconds: {{ .Params.NODE_READINESS_PROBE_TIMEOUT }}
successThreshold: {{ .Params.NODE_READINESS_PROBE_SUCCESS_THRESHOLD }}
failureThreshold: {{ .Params.NODE_READINESS_PROBE_FAILURE_THRESHOLD }}
command:
- cassandra
- -f
Expand Down Expand Up @@ -143,9 +143,9 @@ spec:
- name: jvm-options
mountPath: /etc/cassandra/jvm.options
subPath: jvm.options
- name: cassandra-readiness-probe-sh
mountPath: /etc/cassandra/cassandra-readiness-probe.sh
subPath: cassandra-readiness-probe.sh
- name: node-readiness-probe-sh
mountPath: /etc/cassandra/node-readiness-probe.sh
subPath: node-readiness-probe.sh
volumes:
# Overwriting /etc/cassandra/ available in the Docker image.
- name: etc-cassandra
Expand All @@ -159,9 +159,9 @@ spec:
- name: jvm-options
configMap:
name: {{ .Name }}-jvm-options
- name: cassandra-readiness-probe-sh
- name: node-readiness-probe-sh
configMap:
name: {{ .Name }}-cassandra-readiness-probe-sh
name: {{ .Name }}-node-readiness-probe-sh
volumeClaimTemplates:
- metadata:
name: var-lib-cassandra
Expand Down
2 changes: 1 addition & 1 deletion templates/operator/operator.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tasks:
- cassandra-env-sh.yaml
- jvm-options.yaml
- stateful-set.yaml
- cassandra-readiness-probe-sh.yaml
- node-readiness-probe-sh.yaml

plans:
deploy:
Expand Down