Created
April 14, 2020 12:28
-
-
Save Rahulsharma0810/0c8475e1ca2f7bdb0e6bddc5c1e53d7e to your computer and use it in GitHub Desktop.
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
# https://kubernetes.io/docs/tutorials/k8s201/ | |
# https://cheatsheet.dennyzhang.com/kubernetes-yaml-templates | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: pod-with-http-healthcheck | |
spec: | |
containers: | |
- name: nginx | |
image: nginx | |
# defines the health checking | |
livenessProbe: | |
# an http probe | |
httpGet: | |
path: /_status/healthz | |
port: 80 | |
# length of time to wait for a pod to initialize | |
# after pod startup, before applying health checking | |
initialDelaySeconds: 30 | |
timeoutSeconds: 1 | |
ports: | |
- containerPort: 80 | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: pod-with-tcp-socket-healthcheck | |
spec: | |
containers: | |
- name: redis | |
image: redis | |
# defines the health checking | |
livenessProbe: | |
# a TCP socket probe | |
tcpSocket: | |
port: 6379 | |
# length of time to wait for a pod to initialize | |
# after pod startup, before applying health checking | |
initialDelaySeconds: 30 | |
timeoutSeconds: 1 | |
ports: | |
- containerPort: 6379 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment