Sample K8s Deployment YAML with Federation support

User can do federated K8s Deployment annotations. In the following sample user has two clusters named clustera and clusterb. deployment-preferences describe the preferred deployment configuration.


apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx
annotations:
federation.kubernetes.io/deployment-preferences: |
{
"rebalance": true,
"clusters": {
"clustera": {
"minReplicas": 1,
"maxReplicas": 3,
"weight": 1
},
"clusterb": {
"minReplicas": 2,
"maxReplicas": 4,
"weight": 1
}
}
}
spec:
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
Like what you read? Give Deependra Ariyadewa a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.