Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ravisantoshgudimetla/0260e73c761387de6421f46cf2f7f685 to your computer and use it in GitHub Desktop.
Save ravisantoshgudimetla/0260e73c761387de6421f46cf2f7f685 to your computer and use it in GitHub Desktop.
sample deployment yaml file
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: s2
annotations:
scheduler.alpha.kubernetes.io/affinity: >
{"podAntiAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": [
{
"labelSelector" :{
"matchExpressions": [
{
"key": "security",
"operator": "In",
"values": ["s1"]
}
]
},
"topologyKey": "kubernetes.io/hostname"
}]
}}
spec:
replicas: 2
template:
metadata:
labels:
security: s1
spec:
containers:
- name: pod-test
image: docker.io/ocpqe/hello-pod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment