Skip to content

Instantly share code, notes, and snippets.

@lut777
Forked from pjh/linux-ubuntu-deployment.yaml
Last active August 3, 2023 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lut777/d379e0824cf8fdf533a4bee07112ec95 to your computer and use it in GitHub Desktop.
Save lut777/d379e0824cf8fdf533a4bee07112ec95 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: ubuntu-deployment
labels:
app: ubuntu
spec:
replicas: 1
selector:
matchLabels:
app: ubuntu
template:
metadata:
labels:
app: ubuntu
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- ubuntu
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- name: ubuntu
image: ubuntu
command: ["sleep", "123456"]
nodeSelector:
kubernetes.io/os: linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment