Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created August 2, 2022 07:08
Show Gist options
  • Save percybolmer/2568c2e9fe3b4fce5a5dc7d34390635d to your computer and use it in GitHub Desktop.
Save percybolmer/2568c2e9fe3b4fce5a5dc7d34390635d to your computer and use it in GitHub Desktop.
Kubernetes added Spec
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment