Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

feat: add pod disruption budgets #218

Merged
merged 1 commit into from Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions parts/k8s/addons/coredns.yaml
Expand Up @@ -159,6 +159,17 @@ spec:
- key: Corefile
path: Corefile
---
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: coredns
namespace: kube-system
spec:
minAvailable: 50%
selector:
matchLabels:
k8s-app: kube-dns
---
apiVersion: v1
kind: Service
metadata:
Expand Down
26 changes: 26 additions & 0 deletions parts/k8s/addons/kubernetesmasteraddons-calico-daemonset.yaml
Expand Up @@ -252,6 +252,19 @@ spec:

---

apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: calico-typha
namespace: kube-system
spec:
minAvailable: 0%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sort of seems like a no-op configuration, but I infer that cluster-autoscaler needs some value here in order to engage?

Copy link
Contributor Author

@sylr sylr Jan 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. The cluster-autoscaler will refuse to engage in a node scale down if there are non-mirrored pods which do not have a PDB that allows the pod to be killed.

selector:
matchLabels:
k8s-app: calico-typha

---

# Typha Horizontal Autoscaler Cluster Role
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down Expand Up @@ -356,6 +369,19 @@ spec:

---

apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: calico-typha-horizontal-autoscaler
namespace: kube-system
spec:
minAvailable: 0%
selector:
matchLabels:
k8s-app: calico-typha-autoscaler

---

# Typha Horizontal Autoscaler Role
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand Down
Expand Up @@ -127,3 +127,14 @@ spec:
serviceAccountName: kubernetes-dashboard
nodeSelector:
beta.kubernetes.io/os: linux
---
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: kubernetes-dashboard
namespace: kube-system
spec:
minAvailable: 0%
selector:
matchLabels:
k8s-app: kubernetes-dashboard
Expand Up @@ -94,3 +94,15 @@ spec:
memory: {{ContainerMemLimits "tiller"}}
nodeSelector:
beta.kubernetes.io/os: linux
---
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: tiller
namespace: kube-system
spec:
minAvailable: 0%
selector:
matchLabels:
app: helm
name: tiller