Skip to content

Instantly share code, notes, and snippets.

@jdato
Created May 12, 2021 12:06
Show Gist options
  • Save jdato/2ecd410c1e1ca4f0cc718db8a9d48822 to your computer and use it in GitHub Desktop.
Save jdato/2ecd410c1e1ca4f0cc718db8a9d48822 to your computer and use it in GitHub Desktop.
Example of a Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: my-application-deployment
name: my-application
spec:
replicas: 2
selector:
matchLabels:
app: my-application
template:
metadata:
labels:
app: my-application
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- my-application
topologyKey: kubernetes.io/hostname
containers:
- name: hello-world-app
image: hello-world
ports:
- containerPort: 9024
status: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment