Skip to content

Commit

Permalink
Update the tolerations on jiva deployments (#381)
Browse files Browse the repository at this point in the history
Signed-off-by: kmova <kiran.mova@openebs.io>
  • Loading branch information
kmova authored and Amit Kumar Das committed Jun 29, 2018
1 parent 18614ad commit 8acd08b
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions orchprovider/k8s/v1/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,8 @@ func (k *k8sOrchestrator) createControllerDeployment(volProProfile volProfile.Vo
},
Spec: k8sApiV1.PodSpec{
// Ensure the controller gets EVICTED as soon as possible
// If we don't specify the following explicitly, then k8s will
// add a toleration of 300 seconds.
Tolerations: []k8sApiV1.Toleration{
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Expand All @@ -906,6 +908,18 @@ func (k *k8sOrchestrator) createControllerDeployment(volProProfile volProfile.Vo
Operator: k8sApiV1.TolerationOpExists,
TolerationSeconds: &tolerationSeconds,
},
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Key: "node.kubernetes.io/not-ready",
Operator: k8sApiV1.TolerationOpExists,
TolerationSeconds: &tolerationSeconds,
},
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Key: "node.kubernetes.io/unreachable",
Operator: k8sApiV1.TolerationOpExists,
TolerationSeconds: &tolerationSeconds,
},
},
Containers: []k8sApiV1.Container{
k8sApiV1.Container{
Expand Down Expand Up @@ -1122,6 +1136,9 @@ func (k *k8sOrchestrator) createReplicaDeployment(volProProfile volProfile.Volum
Spec: k8sApiV1.PodSpec{
// Ensure the replicas stick to its placement node even if the node dies
// In other words DO NOT EVICT these replicas
// The list of taints have been updated with the list available from 1.11
// Note: this will be replaced by CAS templates, which provide the
// flexibility of using either Statefulset or DaemonSet in future.
Tolerations: []k8sApiV1.Toleration{
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Expand All @@ -1133,6 +1150,46 @@ func (k *k8sOrchestrator) createReplicaDeployment(volProProfile volProfile.Volum
Key: "node.alpha.kubernetes.io/unreachable",
Operator: k8sApiV1.TolerationOpExists,
},
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Key: "node.kubernetes.io/not-ready",
Operator: k8sApiV1.TolerationOpExists,
},
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Key: "node.kubernetes.io/unreachable",
Operator: k8sApiV1.TolerationOpExists,
},
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Key: "node.kubernetes.io/out-of-disk",
Operator: k8sApiV1.TolerationOpExists,
},
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Key: "node.kubernetes.io/memory-pressure",
Operator: k8sApiV1.TolerationOpExists,
},
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Key: "node.kubernetes.io/disk-pressure",
Operator: k8sApiV1.TolerationOpExists,
},
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Key: "node.kubernetes.io/network-unavailable",
Operator: k8sApiV1.TolerationOpExists,
},
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Key: "node.kubernetes.io/unschedulable",
Operator: k8sApiV1.TolerationOpExists,
},
k8sApiV1.Toleration{
Effect: k8sApiV1.TaintEffectNoExecute,
Key: "node.cloudprovider.kubernetes.io/uninitialized",
Operator: k8sApiV1.TolerationOpExists,
},
},
Affinity: &k8sApiV1.Affinity{
// Inter-pod anti-affinity rule to spread the replicas across K8s minions
Expand Down

0 comments on commit 8acd08b

Please sign in to comment.