Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created August 2, 2022 18:38
Show Gist options
  • Save percybolmer/3f0d53d648cb59b4b152e232dce989c7 to your computer and use it in GitHub Desktop.
Save percybolmer/3f0d53d648cb59b4b152e232dce989c7 to your computer and use it in GitHub Desktop.
readyness probe in kubectl
apiVersion: apps/v1 #Which version of the Kubernetes API you're using to create this object
kind: Deployment # What kind of object you want to create [deployment, service etc]
metadata: # Data that helps uniquely identify the object, including a name string, UID, and optional namespace
name: hellogopher
spec: # What state you desire for the object
selector: # Define what selectors the Deployment uses to find the PODS that are related to it
matchLabels: # matchLabels is a map of {key,value} pairs.
app: hellogopher
replicas: 1 # Tells the deployment to run 1 pod
template: # When creating new pods, this template will be used
metadata:
labels: # Labels used when searching / managing deployments
app: hellogopher
spec:
containers:
- name: hellogopher # Name of the Container
image: programmingpercy/hellogopher:1.0 # Important, to not use latest tag as it will try DOckerhub then
imagePullPolicy: IfNotPresent # Will only pull from DockerHub if not present already in Local docker
ports: # Ports to Expose
- containerPort: 8080
readinessProbe:
initialDelaySeconds: 5 # Time before starting to Probe status
timeoutSeconds: 1 # Time to wait before timeout
# HTTP probe
httpGet:
path: / # the path we use to probe
port: 9999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment