Skip to content

Commit

Permalink
add connectivity check via svc in readiness probe
Browse files Browse the repository at this point in the history
  • Loading branch information
mohit-sheth committed Nov 18, 2024
1 parent f9b61da commit cda5695
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/config/udn-density-l3-pods/deployment-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ spec:
memory: "10Mi"
cpu: "10m"
env:
- name: SERVICE_ENDPOINT
value: "http://udn-density-l3-{{randInt 1 6}}/256.html"
imagePullPolicy: IfNotPresent
readinessProbe:
exec:
command:
- "/bin/sh"
- "-c"
- "curl --fail -sS ${SERVICE_ENDPOINT} -o /dev/null"
securityContext:
privileged: false
volumeMounts:
Expand Down
14 changes: 14 additions & 0 deletions cmd/config/udn-density-l3-pods/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
kind: Service
apiVersion: v1
metadata:
name: udn-density-l3-{{.Replica}}
spec:
selector:
app: nginx
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8080
type: ClusterIP
3 changes: 3 additions & 0 deletions cmd/config/udn-density-l3-pods/udn-density-l3-pods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ jobs:
- objectTemplate: udn.yml
replicas: 1

- objectTemplate: service.yml
replicas: 5

- objectTemplate: deployment-server.yml
replicas: 3
inputVars:
Expand Down

0 comments on commit cda5695

Please sign in to comment.