Skip to content

Commit

Permalink
Liveness Readyness probes #65
Browse files Browse the repository at this point in the history
  • Loading branch information
vbradnitski committed Mar 27, 2023
1 parent 370b6a3 commit feb1eaa
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,25 +170,34 @@ spec:
value: {{ $env.value }}
{{- end }}

readinessProbe:
failureThreshold: 2

{{- if semverCompare "gt" $.Values.deployment.spec.xpVersion "1.0.0" }}
startupProbe:
httpGet:
{{- if not $.Values.deployment.clustered }}
# Single nodes
path: {{ $.Values.deployment.preInstalledCloudUtils | ternary "/cloud-utils/health?state=" "/_cluster/health?timeout=1s&wait_for_status=" }}green
{{- else if and (and $nodeGroup.data $.Values.deployment.clustered) $.Values.deployment.hasDedicatedFrontendNodes }}
# Cluster with dedicated frontend nodes
path: {{ $.Values.deployment.preInstalledCloudUtils | ternary "/cloud-utils/health?state=" "/_cluster/health?timeout=1s&wait_for_status=" }}green
{{ else }}
# Cluster with no dedicated cluster nodes
path: {{ $.Values.deployment.preInstalledCloudUtils | ternary "/cloud-utils/health?state=" "/_cluster/health?timeout=1s&wait_for_status=" }}yellow
{{- end }}
port: {{ $.Values.deployment.preInstalledCloudUtils | ternary 4848 9200 }}
path: "/healthz"
port: 2609
scheme: HTTP
failureThreshold: 20
initialDelaySeconds: 30
periodSeconds: 8
successThreshold: 3
periodSeconds: 5
timeoutSeconds: 2
livenessProbe:
httpGet:
path: "/healthz"
port: 2609
scheme: HTTP
failureThreshold: 10
timeoutSeconds: 2
readinessProbe:
httpGet:
path: "/ready"
port: 2609
scheme: HTTP
failureThreshold: 2
timeoutSeconds: 2
{{ else }}
{{- end }}


{{- if $.Values.deployment.clustered }}
lifecycle:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,13 @@ spec:
command:
- "/bin/bash"
- "/enonic-xp/home/extra-config/preStop.sh"
livenessProbe:
failureThreshold: 10
httpGet:
path: "/healthz"
port: 2609
scheme: "HTTP"
timeoutSeconds: 2
name: "exp"
ports:
- containerPort: 2609
Expand All @@ -825,12 +832,9 @@ spec:
readinessProbe:
failureThreshold: 2
httpGet:
path: "/_cluster/health?timeout=1s&wait_for_status=yellow"
port: 9200
path: "/ready"
port: 2609
scheme: "HTTP"
initialDelaySeconds: 30
periodSeconds: 8
successThreshold: 3
timeoutSeconds: 2
resources:
limits:
Expand All @@ -845,6 +849,15 @@ spec:
- "ALL"
runAsNonRoot: true
runAsUser: 1337
startupProbe:
failureThreshold: 20
httpGet:
path: "/healthz"
port: 2609
scheme: "HTTP"
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 2
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: "File"
volumeMounts:
Expand Down Expand Up @@ -1068,6 +1081,13 @@ spec:
command:
- "/bin/bash"
- "/enonic-xp/home/extra-config/preStop.sh"
livenessProbe:
failureThreshold: 10
httpGet:
path: "/healthz"
port: 2609
scheme: "HTTP"
timeoutSeconds: 2
name: "exp"
ports:
- containerPort: 2609
Expand All @@ -1085,12 +1105,9 @@ spec:
readinessProbe:
failureThreshold: 2
httpGet:
path: "/_cluster/health?timeout=1s&wait_for_status=green"
port: 9200
path: "/ready"
port: 2609
scheme: "HTTP"
initialDelaySeconds: 30
periodSeconds: 8
successThreshold: 3
timeoutSeconds: 2
resources:
limits:
Expand All @@ -1105,6 +1122,15 @@ spec:
- "ALL"
runAsNonRoot: true
runAsUser: 1337
startupProbe:
failureThreshold: 20
httpGet:
path: "/healthz"
port: 2609
scheme: "HTTP"
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 2
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: "File"
volumeMounts:
Expand Down Expand Up @@ -1351,6 +1377,13 @@ spec:
command:
- "/bin/bash"
- "/enonic-xp/home/extra-config/preStop.sh"
livenessProbe:
failureThreshold: 10
httpGet:
path: "/healthz"
port: 2609
scheme: "HTTP"
timeoutSeconds: 2
name: "exp"
ports:
- containerPort: 2609
Expand All @@ -1368,12 +1401,9 @@ spec:
readinessProbe:
failureThreshold: 2
httpGet:
path: "/_cluster/health?timeout=1s&wait_for_status=yellow"
port: 9200
path: "/ready"
port: 2609
scheme: "HTTP"
initialDelaySeconds: 30
periodSeconds: 8
successThreshold: 3
timeoutSeconds: 2
resources:
limits:
Expand All @@ -1388,6 +1418,15 @@ spec:
- "ALL"
runAsNonRoot: true
runAsUser: 1337
startupProbe:
failureThreshold: 20
httpGet:
path: "/healthz"
port: 2609
scheme: "HTTP"
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 2
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: "File"
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,13 @@ spec:
\ -Dhazelcast.shutdownhook.policy=GRACEFUL -Dhazelcast.graceful.shutdown.max.wait=600"
image: "enonic/xp:7.7.0-ubuntu"
imagePullPolicy: "IfNotPresent"
livenessProbe:
failureThreshold: 10
httpGet:
path: "/healthz"
port: 2609
scheme: "HTTP"
timeoutSeconds: 2
name: "exp"
ports:
- containerPort: 2609
Expand All @@ -642,12 +649,9 @@ spec:
readinessProbe:
failureThreshold: 2
httpGet:
path: "/_cluster/health?timeout=1s&wait_for_status=green"
port: 9200
path: "/ready"
port: 2609
scheme: "HTTP"
initialDelaySeconds: 30
periodSeconds: 8
successThreshold: 3
timeoutSeconds: 2
resources:
limits:
Expand All @@ -662,6 +666,15 @@ spec:
- "ALL"
runAsNonRoot: true
runAsUser: 1337
startupProbe:
failureThreshold: 20
httpGet:
path: "/healthz"
port: 2609
scheme: "HTTP"
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 2
terminationMessagePath: "/dev/termination-log"
terminationMessagePolicy: "File"
volumeMounts:
Expand Down
19 changes: 11 additions & 8 deletions kubernetes/example-simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,26 @@ metadata:
namespace: my-namespace
spec:
enabled: true
xpVersion: 7.10.3
xpVersion: 7.13.0-SNAPSHOT

# Preinstall snapshotter on all nodes
nodesPreinstalledApps:
- name: snapshotter
url: https://repo.enonic.com/public/com/enonic/app/snapshotter/3.0.2/snapshotter-3.0.2.jar

# List of disks shared by all nodes (see description of disks below)
nodesSharedDisks:
- name: blobstore
size: 1Gi
- name: snapshots
size: 1Gi
- name: export
size: 1Gi

# Create one node
nodeGroups:
- name: main
replicas: 1
replicas: 3

data: true
master: true
Expand All @@ -36,12 +45,6 @@ spec:

# Volumes private to the node
disks:
- name: blobstore
size: 1Gi
- name: snapshots
size: 1Gi
- name: export # Dumps and other data
size: 1Gi
- name: deploy # Apps installed in the deploy folder
size: 1Gi
- name: index # Node ES index
Expand Down
1 change: 1 addition & 0 deletions kubernetes/kind/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ KIND_MTU:=$(shell docker network inspect bridge -f '{{ index .Options "com.docke
KIND_CTX:=kind-kind
NFS_SERVER_NAME:=kind-nfs-server
NFS_SERVER_VOLUME:=kind-nfs-server
MY_IP:=192.168.0.30

.PHONY: kind-setup kind-bootstrap kind-ingress kind-up kind-down help
.DEFAULT_GOAL:=help
Expand Down

0 comments on commit feb1eaa

Please sign in to comment.