183 lines
8.9 KiB
YAML
183 lines
8.9 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
{{- with .Values.manager.deploymentAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "opentelemetry-operator.labels" . | nindent 4 }}
|
|
app.kubernetes.io/component: controller-manager
|
|
name: {{ template "opentelemetry-operator.fullname" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "opentelemetry-operator.selectorLabels" . | nindent 6 }}
|
|
app.kubernetes.io/component: controller-manager
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
{{- if .Values.manager.rolling }}
|
|
rollme: {{ randAlphaNum 5 | quote }}
|
|
{{- end }}
|
|
kubectl.kubernetes.io/default-container: manager
|
|
{{- if .Values.manager.podAnnotations }}
|
|
{{- include "opentelemetry-operator.podAnnotations" . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "opentelemetry-operator.selectorLabels" . | nindent 8 }}
|
|
{{- if .Values.manager.podLabels }}
|
|
{{- include "opentelemetry-operator.podLabels" . | nindent 8 }}
|
|
{{- end }}
|
|
app.kubernetes.io/component: controller-manager
|
|
spec:
|
|
hostNetwork: {{ .Values.hostNetwork }}
|
|
{{- if .Values.priorityClassName }}
|
|
priorityClassName: {{ .Values.priorityClassName | quote }}
|
|
{{- end }}
|
|
containers:
|
|
- args:
|
|
- --metrics-addr=0.0.0.0:{{ .Values.manager.ports.metricsPort }}
|
|
{{- if .Values.manager.leaderElection.enabled }}
|
|
- --enable-leader-election
|
|
{{- end }}
|
|
- --health-probe-addr=:{{ .Values.manager.ports.healthzPort }}
|
|
{{- if or .Values.admissionWebhooks.create .Values.admissionWebhooks.secretName }}
|
|
- --webhook-port={{ .Values.manager.ports.webhookPort }}
|
|
{{- end }}
|
|
{{- if and .Values.manager.collectorImage.repository .Values.manager.collectorImage.tag }}
|
|
- --collector-image={{ .Values.manager.collectorImage.repository }}:{{ .Values.manager.collectorImage.tag }}
|
|
{{- end }}
|
|
{{- if and .Values.manager.opampBridgeImage.repository .Values.manager.opampBridgeImage.tag }}
|
|
- --operator-opamp-bridge-image={{ .Values.manager.opampBridgeImage.repository }}:{{ .Values.manager.opampBridgeImage.tag }}
|
|
{{- end }}
|
|
{{- if and .Values.manager.targetAllocatorImage.repository .Values.manager.targetAllocatorImage.tag }}
|
|
- --target-allocator-image={{ .Values.manager.targetAllocatorImage.repository }}:{{ .Values.manager.targetAllocatorImage.tag }}
|
|
{{- end }}
|
|
{{- if and .Values.manager.autoInstrumentationImage.java.repository .Values.manager.autoInstrumentationImage.java.tag }}
|
|
- --auto-instrumentation-java-image={{ .Values.manager.autoInstrumentationImage.java.repository }}:{{ .Values.manager.autoInstrumentationImage.java.tag }}
|
|
{{- end }}
|
|
{{- if and .Values.manager.autoInstrumentationImage.nodejs.repository .Values.manager.autoInstrumentationImage.nodejs.tag }}
|
|
- --auto-instrumentation-nodejs-image={{ .Values.manager.autoInstrumentationImage.nodejs.repository }}:{{ .Values.manager.autoInstrumentationImage.nodejs.tag }}
|
|
{{- end }}
|
|
{{- if and .Values.manager.autoInstrumentationImage.python.repository .Values.manager.autoInstrumentationImage.python.tag }}
|
|
- --auto-instrumentation-python-image={{ .Values.manager.autoInstrumentationImage.python.repository }}:{{ .Values.manager.autoInstrumentationImage.python.tag }}
|
|
{{- end }}
|
|
{{- if and .Values.manager.autoInstrumentationImage.dotnet.repository .Values.manager.autoInstrumentationImage.dotnet.tag }}
|
|
- --auto-instrumentation-dotnet-image={{ .Values.manager.autoInstrumentationImage.dotnet.repository }}:{{ .Values.manager.autoInstrumentationImage.dotnet.tag }}
|
|
{{- end }}
|
|
{{- if and .Values.manager.autoInstrumentationImage.go.repository .Values.manager.autoInstrumentationImage.go.tag }}
|
|
- --auto-instrumentation-go-image={{ .Values.manager.autoInstrumentationImage.go.repository }}:{{ .Values.manager.autoInstrumentationImage.go.tag }}
|
|
{{- end }}
|
|
{{- if and .Values.manager.autoInstrumentationImage.apacheHttpd.repository .Values.manager.autoInstrumentationImage.apacheHttpd.tag }}
|
|
- --auto-instrumentation-apache-httpd-image={{ .Values.manager.autoInstrumentationImage.apacheHttpd.repository }}:{{ .Values.manager.autoInstrumentationImage.apacheHttpd.tag }}
|
|
{{- end }}
|
|
{{- if .Values.manager.featureGatesMap }}
|
|
- --feature-gates={{ include "opentelemetry-operator.featureGatesMap" . }}
|
|
{{- else if ne .Values.manager.featureGates "" }}
|
|
- --feature-gates={{ .Values.manager.featureGates }}
|
|
{{- end }}
|
|
{{- if .Values.manager.extraArgs }}
|
|
{{- .Values.manager.extraArgs | toYaml | nindent 12 }}
|
|
{{- end }}
|
|
command:
|
|
- /manager
|
|
{{- if or .Values.manager.env .Values.manager.createRbacPermissions }}
|
|
env:
|
|
{{- if .Values.manager.env }}
|
|
{{- range $name, $value := .Values.manager.env }}
|
|
- name: {{ $name }}
|
|
value: {{ $value | quote -}}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.manager.createRbacPermissions }}
|
|
- name: SERVICE_ACCOUNT_NAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: spec.serviceAccountName
|
|
{{- end }}
|
|
{{- end }}
|
|
image: {{ include "opentelemetry-operator.image" . | quote }}
|
|
name: manager
|
|
ports:
|
|
- containerPort: {{ .Values.manager.ports.metricsPort }}
|
|
name: metrics
|
|
protocol: TCP
|
|
{{- if or .Values.admissionWebhooks.create .Values.admissionWebhooks.secretName }}
|
|
- containerPort: {{ .Values.manager.ports.webhookPort }}
|
|
name: webhook-server
|
|
protocol: TCP
|
|
{{- end }}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /healthz
|
|
port: {{ .Values.manager.ports.healthzPort }}
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 20
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /readyz
|
|
port: {{ .Values.manager.ports.healthzPort }}
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
resources: {{ toYaml .Values.manager.resources | nindent 12 }}
|
|
{{- if or .Values.admissionWebhooks.create .Values.admissionWebhooks.secretName }}
|
|
volumeMounts:
|
|
- mountPath: /tmp/k8s-webhook-server/serving-certs
|
|
name: cert
|
|
readOnly: true
|
|
{{- end }}
|
|
{{- with .Values.manager.securityContext }}
|
|
securityContext: {{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{ if .Values.kubeRBACProxy.enabled }}
|
|
- args:
|
|
- --secure-listen-address=0.0.0.0:{{ .Values.kubeRBACProxy.ports.proxyPort }}
|
|
- --upstream=http://127.0.0.1:{{ .Values.manager.ports.metricsPort }}/
|
|
- --v=0
|
|
{{- if .Values.kubeRBACProxy.extraArgs }}
|
|
{{- .Values.kubeRBACProxy.extraArgs | toYaml | nindent 12 }}
|
|
{{- end }}
|
|
image: "{{ .Values.kubeRBACProxy.image.repository }}:{{ .Values.kubeRBACProxy.image.tag }}"
|
|
name: kube-rbac-proxy
|
|
ports:
|
|
- containerPort: {{ .Values.kubeRBACProxy.ports.proxyPort }}
|
|
name: https
|
|
protocol: TCP
|
|
{{- with .Values.kubeRBACProxy.resources }}
|
|
resources: {{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- with .Values.kubeRBACProxy.securityContext }}
|
|
securityContext: {{ toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- with .Values.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity: {{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.tolerations }}
|
|
tolerations: {{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.nodeSelector }}
|
|
nodeSelector: {{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.topologySpreadConstraints }}
|
|
topologySpreadConstraints: {{ toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ template "opentelemetry-operator.serviceAccountName" . }}
|
|
terminationGracePeriodSeconds: 10
|
|
{{- if or .Values.admissionWebhooks.create .Values.admissionWebhooks.secretName }}
|
|
volumes:
|
|
- name: cert
|
|
secret:
|
|
defaultMode: 420
|
|
secretName: {{ default (printf "%s-controller-manager-service-cert" (include "opentelemetry-operator.fullname" .)) .Values.admissionWebhooks.secretName }}
|
|
{{- end }}
|
|
securityContext:
|
|
{{ toYaml .Values.securityContext | indent 8 }}
|