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 affinity settings in viz and jaeger chart #11464

Merged
merged 4 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions jaeger/charts/linkerd-jaeger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Kubernetes: `>=1.21.0-0`
| collector.image.pullPolicy | string | `""` | |
| collector.image.version | string | `"0.83.0"` | |
| collector.nodeSelector | object | `{"kubernetes.io/os":"linux"}` | NodeSelector section, See the [K8S documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) for more information |
| collector.replicas | int | `1` | Number of collector component replicas |
| collector.resources.cpu.limit | string | `nil` | Maximum amount of CPU units that the collector container can use |
| collector.resources.cpu.request | string | `nil` | Amount of CPU units that the collector container requests |
| collector.resources.ephemeral-storage.limit | string | `""` | Maximum amount of ephemeral storage that the collector container can use |
Expand All @@ -92,6 +93,7 @@ Kubernetes: `>=1.21.0-0`
| commonLabels | object | `{}` | Labels to apply to all resources |
| defaultUID | int | `2103` | Default UID for all the jaeger 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 creation on deployments for high availability |
| imagePullSecrets | list | `[]` | For Private docker registries, authentication is needed. Registry secrets are applied to the respective service accounts |
| jaeger.UID | string | `nil` | UID for the jaeger resource |
| jaeger.args | list | `["--query.base-path=/jaeger"]` | CLI arguments for Jaeger, See [Jaeger AIO Memory CLI reference](https://www.jaegertracing.io/docs/1.24/cli/#jaeger-all-in-one-memory) |
Expand All @@ -107,6 +109,7 @@ Kubernetes: `>=1.21.0-0`
| jaeger.resources.memory.limit | string | `nil` | Maximum amount of memory that jaeger container can use |
| jaeger.resources.memory.request | string | `nil` | Amount of memory that the jaeger container requests |
| jaeger.tolerations | string | `nil` | Tolerations section, See the [K8S documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) for more information |
| jaegerInjector.replicas | int | `1` | Number of jaeger-injector component replicas |
| linkerdNamespace | string | `"linkerd"` | Namespace of the Linkerd core control-plane install |
| linkerdVersion | string | `"linkerdVersionValue"` | |
| namespaceMetadata.image.name | string | `"extension-init"` | Docker image name for the namespace-metadata instance |
Expand Down
11 changes: 10 additions & 1 deletion jaeger/charts/linkerd-jaeger/templates/jaeger-injector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
###
### Jaeger Injector
###
{{- $tree := deepCopy . }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -15,11 +16,16 @@ metadata:
name: jaeger-injector
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
replicas: {{ .Values.jaegerInjector.replicas }}
selector:
matchLabels:
linkerd.io/extension: jaeger
component: jaeger-injector
{{- if .Values.enablePodAntiAffinity }}
strategy:
rollingUpdate:
maxUnavailable: 1
{{- end }}
template:
metadata:
annotations:
Expand All @@ -37,6 +43,9 @@ spec:
{{- include "linkerd.tolerations" (dict "Values" .Values.webhook) | nindent 6 }}
{{- end -}}
{{- include "linkerd.node-selector" (dict "Values" .Values.webhook) | nindent 6 }}
{{- $_ := set $tree "component" "jaeger-injector" -}}
{{- $_ := set $tree "label" "component" -}}
{{- include "linkerd.affinity" . | nindent 6 }}
containers:
- args:
- -collector-svc-addr={{.Values.webhook.collectorSvcAddr}}
Expand Down
20 changes: 19 additions & 1 deletion jaeger/charts/linkerd-jaeger/templates/tracing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ spec:
selector:
component: collector
---
{{- $tree := deepCopy . }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -67,10 +68,15 @@ metadata:
name: collector
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
replicas: {{ .Values.collector.replicas }}
selector:
matchLabels:
component: collector
{{- if .Values.enablePodAntiAffinity }}
strategy:
rollingUpdate:
maxUnavailable: 1
{{- end }}
minReadySeconds: 5
progressDeadlineSeconds: 120
template:
Expand All @@ -93,6 +99,9 @@ spec:
{{- include "linkerd.tolerations" (dict "Values" .Values.collector) | nindent 6 }}
{{- end -}}
{{- include "linkerd.node-selector" (dict "Values" .Values.collector) | nindent 6 }}
{{- $_ := set $tree "component" "collector" -}}
{{- $_ := set $tree "label" "component" -}}
{{- include "linkerd.affinity" . | nindent 6 }}
containers:
- command:
- {{ .Values.collector.command }}
Expand Down Expand Up @@ -188,6 +197,7 @@ spec:
- name: ui
port: 16686
---
{{- $tree := deepCopy . }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -204,6 +214,11 @@ spec:
selector:
matchLabels:
component: jaeger
{{- if .Values.enablePodAntiAffinity }}
strategy:
rollingUpdate:
maxUnavailable: 1
{{- end }}
template:
metadata:
annotations:
Expand All @@ -222,6 +237,9 @@ spec:
{{- include "linkerd.tolerations" (dict "Values" .Values.jaeger) | nindent 6 }}
{{- end -}}
{{- include "linkerd.node-selector" (dict "Values" .Values.jaeger) | nindent 6 }}
{{- $_ := set $tree "component" "jaeger" -}}
{{- $_ := set $tree "label" "component" -}}
{{- include "linkerd.affinity" . | nindent 6 }}
containers:
- args:
{{- range .Values.jaeger.args }}
Expand Down
16 changes: 16 additions & 0 deletions jaeger/charts/linkerd-jaeger/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ imagePullSecrets: []
# for more information
tolerations: &default_tolerations

# -- 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.
enablePodAntiAffinity: false

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

# -- 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
Expand All @@ -36,6 +46,8 @@ clusterDomain: cluster.local
collector:
# -- Set to false to exclude collector installation
enabled: true
# -- number of replicas of the collector component
naing2victor marked this conversation as resolved.
Show resolved Hide resolved
replicas: 1
image:
name: otel/opentelemetry-collector-contrib
version: 0.83.0
Expand Down Expand Up @@ -199,6 +211,10 @@ jaeger:
# -- UID for the jaeger resource
UID:

jaegerInjector:
# -- number of replicas of the jaeger-injector component
replicas: 1

naing2victor marked this conversation as resolved.
Show resolved Hide resolved
linkerdVersion: &linkerd_version linkerdVersionValue

namespaceMetadata:
Expand Down
4 changes: 4 additions & 0 deletions viz/charts/linkerd-viz/templates/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ spec:
port: 9994
targetPort: 9994
---
{{- $tree := deepCopy . }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -74,6 +75,9 @@ spec:
{{- include "linkerd.tolerations" . | nindent 6 }}
{{- end -}}
{{- include "linkerd.node-selector" . | nindent 6 }}
{{- $_ := set $tree "component" "web" -}}
{{- $_ := set $tree "label" "component" -}}
{{- include "linkerd.affinity" . | nindent 6 }}
containers:
- args:
- -linkerd-metrics-api-addr=metrics-api.{{.Release.Namespace}}.svc.{{.Values.clusterDomain}}:8085
Expand Down