Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PDB on linkerd-viz Helm chart #11628

Merged
merged 2 commits into from
Nov 23, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions viz/charts/linkerd-viz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Kubernetes: `>=1.21.0-0`
| defaultUID | int | `2103` | UID for all the viz components |
| enablePSP | bool | `false` | Create Roles and RoleBindings to associate this extension's ServiceAccounts to the control plane PSP resource. This requires that `enabledPSP` is set to true on the control plane install. Note PSP has been deprecated since k8s v1.21 |
| enablePodAntiAffinity | bool | `false` | Enables Pod Anti Affinity logic to balance the placement of replicas across hosts and zones for High Availability. Enable this only when you have multiple replicas of components. |
| enablePodDisruptionBudget | bool | `false` | enables the creation of pod disruption budgets for tap, tap-injector, web and metrics-api components |
| grafana.externalUrl | string | `nil` | url of a Grafana instance hosted off-cluster. Cannot be set if grafana.url is set. The reverse proxy will not be used for this URL. |
| grafana.uidPrefix | string | `nil` | prefix for Grafana dashboard UID's, used when grafana.externalUrl is set. |
| grafana.url | string | `nil` | url of an in-cluster Grafana instance with reverse proxy configured, used by the Linkerd viz web dashboard to provide direct links to specific Grafana dashboards. Cannot be set if grafana.externalUrl is set. See the [Linkerd documentation](https://linkerd.io/2/tasks/grafana) for more information |
Expand Down
21 changes: 21 additions & 0 deletions viz/charts/linkerd-viz/templates/metrics-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,24 @@ spec:
seccompProfile:
type: RuntimeDefault
serviceAccountName: metrics-api
{{- if and .Values.enablePodDisruptionBudget (gt (int .Values.metricsAPI.replicas) 1) }}
---
kind: PodDisruptionBudget
apiVersion: policy/v1
metadata:
name: metrics-api
namespace: {{ .Release.Namespace }}
labels:
linkerd.io/extension: viz
component: metrics-api
namespace: {{.Release.Namespace}}
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
annotations:
{{ include "partials.annotations.created-by" . }}
spec:
maxUnavailable: 1
selector:
matchLabels:
linkerd.io/extension: viz
component: metrics-api
{{- end }}
21 changes: 21 additions & 0 deletions viz/charts/linkerd-viz/templates/tap-injector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,24 @@ spec:
- name: tls
secret:
secretName: tap-injector-k8s-tls
{{- if and .Values.enablePodDisruptionBudget (gt (int .Values.tapInjector.replicas) 1) }}
---
kind: PodDisruptionBudget
apiVersion: policy/v1
metadata:
name: tap-injector
namespace: {{ .Release.Namespace }}
labels:
linkerd.io/extension: viz
component: tap-injector
namespace: {{.Release.Namespace}}
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
annotations:
{{ include "partials.annotations.created-by" . }}
spec:
maxUnavailable: 1
selector:
matchLabels:
linkerd.io/extension: viz
component: tap-injector
{{- end }}
21 changes: 21 additions & 0 deletions viz/charts/linkerd-viz/templates/tap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,24 @@ spec:
- name: tls
secret:
secretName: tap-k8s-tls
{{- if and .Values.enablePodDisruptionBudget (gt (int .Values.tap.replicas) 1) }}
---
kind: PodDisruptionBudget
apiVersion: policy/v1
metadata:
name: tap
namespace: {{ .Release.Namespace }}
labels:
linkerd.io/extension: viz
component: tap
namespace: {{.Release.Namespace}}
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
annotations:
{{ include "partials.annotations.created-by" . }}
spec:
maxUnavailable: 1
selector:
matchLabels:
linkerd.io/extension: viz
component: tap
{{- end }}
21 changes: 21 additions & 0 deletions viz/charts/linkerd-viz/templates/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,24 @@ spec:
seccompProfile:
type: RuntimeDefault
serviceAccountName: web
{{- if and .Values.enablePodDisruptionBudget (gt (int .Values.dashboard.replicas) 1) }}
---
kind: PodDisruptionBudget
apiVersion: policy/v1
metadata:
name: web
namespace: {{ .Release.Namespace }}
labels:
linkerd.io/extension: viz
component: web
namespace: {{.Release.Namespace}}
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
annotations:
{{ include "partials.annotations.created-by" . }}
spec:
maxUnavailable: 1
selector:
matchLabels:
linkerd.io/extension: viz
component: web
{{- end }}
1 change: 1 addition & 0 deletions viz/charts/linkerd-viz/values-ha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# helm install -f values.yaml -f values-ha.yaml

enablePodAntiAffinity: true
enablePodDisruptionBudget: true

# nodeAffinity:

Expand Down
3 changes: 3 additions & 0 deletions viz/charts/linkerd-viz/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ tolerations: &default_tolerations
# Enable this only when you have multiple replicas of components.
enablePodAntiAffinity: false

# -- enables the creation of pod disruption budgets for tap, tap-injector, web and metrics-api components
enablePodDisruptionBudget: false

# -- NodeAffinity section, See the
# [K8S documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity)
# for more information
Expand Down
Loading