Skip to content

Commit

Permalink
Added liveness and readiness probe for services
Browse files Browse the repository at this point in the history
  • Loading branch information
dt-dilip committed May 28, 2024
1 parent 215d1e0 commit 8ac03b9
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 0 deletions.
14 changes: 14 additions & 0 deletions charts/cdefense/templates/ai/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ spec:
- name: frontend
image: {{ .Values.ai.image }}:{{ .Values.version }}
imagePullPolicy: Always
livenessProbe:
tcpSocket:
port: 8084
initialDelaySeconds: 15
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
readinessProbe:
tcpSocket:
port: 8084
initialDelaySeconds: 20
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
resources:
requests:
memory: {{ .Values.ai.resources.requests.memory}}
Expand Down
14 changes: 14 additions & 0 deletions charts/cdefense/templates/alertservice/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ spec:
configMapKeyRef:
name: cdefense-config
key: CLOUDDEFENSE_BASE_URL
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 20
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 25
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
# resources:
# requests:
# memory: "0.5G"
Expand Down
15 changes: 15 additions & 0 deletions charts/cdefense/templates/alertservice/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{ if .Values.alertservice.enabled }}
---
apiVersion: v1
kind: Service
metadata:
name: alertservice
labels:
app: alertservice
spec:
type: {{ .Values.alertservice.service.type }}
selector:
app: alertservice
ports:
{{- .Values.alertservice.service.ports | toYaml | nindent 2 -}}
{{ end }}
14 changes: 14 additions & 0 deletions charts/cdefense/templates/api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,20 @@ spec:
key: ONLINE_SCAN_POOL_SIZE
ports:
- containerPort: 8080
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 30
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 35
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
# resources:
# requests:
# memory: "1G"
Expand Down
14 changes: 14 additions & 0 deletions charts/cdefense/templates/authservice/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,20 @@ spec:
key: HASURA_GRAPHQL_ADMIN_SECRET
ports:
- containerPort: 8080
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 60
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 70
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
# resources:
# requests:
# memory: "2G"
Expand Down
14 changes: 14 additions & 0 deletions charts/cdefense/templates/keycloak/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,20 @@ spec:
optional: true
ports:
- containerPort: 8080
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 35
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 40
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
# resources:
# requests:
# memory: "0.5G"
Expand Down
14 changes: 14 additions & 0 deletions charts/cdefense/templates/newapi/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ spec:
key: OUTSIDE
ports:
- containerPort: 8080
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 35
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 40
periodSeconds: 15
failureThreshold: 10
successThreshold: 1
# resources:
# requests:
# memory: "0.5G"
Expand Down
9 changes: 9 additions & 0 deletions charts/cdefense/templates/web/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ spec:
- "80"
periodSeconds: 30
timeoutSeconds: 3
readinessProbe:
exec:
command:
- nc
- -z
- 127.0.0.1
- "80"
periodSeconds: 30
timeoutSeconds: 3
ports:
- containerPort: 80
# resources:
Expand Down

0 comments on commit 8ac03b9

Please sign in to comment.