Last active
June 15, 2024 08:03
-
-
Save venkube/b53eda4bec99a7fd766513349183b999 to your computer and use it in GitHub Desktop.
File contains code snippet for readiness probe in kubernetes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
labels: | |
app: readiness | |
name: readiness-pod | |
spec: | |
containers: | |
- name: readiness | |
image: nginx | |
ports: | |
- containerPort: 8080 | |
readinessProbe: | |
exec: | |
command: | |
- "ls" | |
- "/bin" | |
initialDelaySeconds: 30 | |
periodSeconds: 10 | |
timeoutSeconds: 4 | |
successThreshold: 1 | |
failureThreshold: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: ectd-server-grpc | |
spec: | |
containers: | |
- name: ectd | |
image: registry.k8s.io/etcd:3.5.1-0 | |
command: [ "/usr/local/bin/etcd", "--data-dir", "/var/lib/etcd", "--listen-client-urls", "http://0.0.0.0:2379", "--advertise-client-urls", "http://127.0.0.1:2379", "--log-level", "debug"] | |
ports: | |
- containerPort: 2379 | |
readinessProbe: | |
grpc: | |
port: 2379 | |
initialDelaySeconds: 30 | |
periodSeconds: 20 | |
timeoutSeconds: 4 | |
successThreshold: 1 | |
failureThreshold: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
labels: | |
app: readiness | |
name: readiness-pod | |
spec: | |
containers: | |
- name: readiness | |
image: nginx | |
ports: | |
- containerPort: 8080 | |
readinessProbe: | |
httpGet: | |
path: / | |
port: 80 | |
initialDelaySeconds: 30 | |
periodSeconds: 10 | |
timeoutSeconds: 4 | |
successThreshold: 1 | |
failureThreshold: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: redis-server | |
spec: | |
containers: | |
- name: redis | |
image: redis:latest | |
ports: | |
- containerPort: 6379 | |
readinessProbe: | |
tcpSocket: | |
port: 6379 | |
initialDelaySeconds: 30 | |
periodSeconds: 20 | |
timeoutSeconds: 4 | |
successThreshold: 1 | |
failureThreshold: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
labels: | |
app: readiness | |
name: readiness-pod | |
spec: | |
containers: | |
- name: readiness | |
image: nginx | |
ports: | |
- containerPort: 8080 | |
readinessProbe: | |
exec: | |
command: | |
- cat | |
- /usr/share/nginx/html/index.html | |
initialDelaySeconds: 30 | |
periodSeconds: 10 | |
timeoutSeconds: 4 | |
successThreshold: 1 | |
failureThreshold: 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment