From 990f966a467fc6dd161e54813ecee342b3d6cec3 Mon Sep 17 00:00:00 2001 From: "Reza J. Bavaghoush" Date: Tue, 10 Sep 2024 16:41:38 +0200 Subject: [PATCH] feat: add possibility of overriting the namespace --- charts/jaeger-operator/templates/_helpers.tpl | 11 +++++++++++ charts/jaeger-operator/templates/certificate.yaml | 6 +++--- charts/jaeger-operator/templates/deployment.yaml | 2 +- charts/jaeger-operator/templates/issuer.yaml | 2 +- charts/jaeger-operator/templates/jaeger.yaml | 2 +- .../jaeger-operator/templates/mutating-webhook.yaml | 4 ++-- charts/jaeger-operator/templates/psp.yaml | 1 + charts/jaeger-operator/templates/role-binding.yaml | 4 ++-- charts/jaeger-operator/templates/role.yaml | 2 +- charts/jaeger-operator/templates/service-account.yaml | 2 +- charts/jaeger-operator/templates/service.yaml | 4 ++-- .../jaeger-operator/templates/validating-webhook.yaml | 3 ++- charts/jaeger-operator/values.yaml | 2 ++ charts/jaeger/templates/_helpers.tpl | 11 +++++++++++ charts/jaeger/templates/agent-ds.yaml | 1 + charts/jaeger/templates/agent-sa.yaml | 1 + charts/jaeger/templates/agent-svc.yaml | 1 + charts/jaeger/templates/allinone-agent-svc.yaml | 1 + charts/jaeger/templates/allinone-collector-svc.yaml | 1 + charts/jaeger/templates/allinone-configmap.yaml | 1 + charts/jaeger/templates/allinone-deploy.yaml | 1 + charts/jaeger/templates/allinone-ing.yaml | 1 + charts/jaeger/templates/allinone-sa.yaml | 1 + charts/jaeger/templates/cassandra-schema-job.yaml | 1 + charts/jaeger/templates/cassandra-schema-sa.yaml | 1 + charts/jaeger/templates/cassandra-secret.yaml | 1 + charts/jaeger/templates/collector-configmap.yaml | 2 +- charts/jaeger/templates/collector-deploy.yaml | 3 ++- charts/jaeger/templates/collector-hpa.yaml | 11 ++++++----- charts/jaeger/templates/collector-ing.yaml | 1 + charts/jaeger/templates/collector-sa.yaml | 1 + charts/jaeger/templates/collector-servicemonitor.yaml | 4 +++- charts/jaeger/templates/collector-svc.yaml | 1 + charts/jaeger/templates/elasticsearch-secret.yaml | 1 + charts/jaeger/templates/es-index-cleaner-cronjob.yaml | 1 + charts/jaeger/templates/es-index-cleaner-sa.yaml | 1 + charts/jaeger/templates/es-lookback-cronjob.yaml | 3 ++- charts/jaeger/templates/es-lookback-sa.yaml | 1 + charts/jaeger/templates/es-rollover-cronjob.yaml | 1 + charts/jaeger/templates/es-rollover-hook.yml | 1 + charts/jaeger/templates/es-rollover-sa.yaml | 1 + charts/jaeger/templates/hotrod-deploy.yaml | 3 ++- charts/jaeger/templates/hotrod-ing.yaml | 1 + charts/jaeger/templates/hotrod-sa.yaml | 1 + charts/jaeger/templates/hotrod-svc.yaml | 1 + charts/jaeger/templates/ingester-deploy.yaml | 1 + charts/jaeger/templates/ingester-hpa.yaml | 11 ++++++----- charts/jaeger/templates/ingester-sa.yaml | 1 + charts/jaeger/templates/ingester-servicemonitor.yaml | 2 ++ charts/jaeger/templates/ingester-svc.yaml | 1 + charts/jaeger/templates/oauth-sidecar-configmap.yaml | 1 + charts/jaeger/templates/query-configmap.yaml | 1 + charts/jaeger/templates/query-deploy.yaml | 3 ++- charts/jaeger/templates/query-ing.yaml | 1 + charts/jaeger/templates/query-sa.yaml | 1 + charts/jaeger/templates/query-servicemonitor.yaml | 2 ++ charts/jaeger/templates/query-svc.yaml | 1 + charts/jaeger/templates/spark-cronjob.yaml | 1 + charts/jaeger/templates/spark-sa.yaml | 1 + charts/jaeger/values.yaml | 1 + 60 files changed, 105 insertions(+), 31 deletions(-) diff --git a/charts/jaeger-operator/templates/_helpers.tpl b/charts/jaeger-operator/templates/_helpers.tpl index ec2de026..c528d597 100644 --- a/charts/jaeger-operator/templates/_helpers.tpl +++ b/charts/jaeger-operator/templates/_helpers.tpl @@ -47,3 +47,14 @@ Create chart name and version as used by the chart label. app.kubernetes.io/name: {{ include "jaeger-operator.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} + +{{/* +Determine Namespace based on the inputs +*/}} +{{- define "jaeger-operator.namespace" -}} +{{- if .Values.namespaceOverride }} +{{- .Values.namespaceOverride -}} +{{- else -}} +{{- .Release.Namespace -}} +{{- end -}} +{{- end -}} diff --git a/charts/jaeger-operator/templates/certificate.yaml b/charts/jaeger-operator/templates/certificate.yaml index 67871f2e..41e08475 100644 --- a/charts/jaeger-operator/templates/certificate.yaml +++ b/charts/jaeger-operator/templates/certificate.yaml @@ -3,11 +3,11 @@ apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: {{ default "jaeger-operator-service-cert" .Values.certs.certificate.secretName }} - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} spec: dnsNames: - - "{{ default "jaeger-operator-webhook-service" .Values.webhooks.service.name }}.{{ .Release.Namespace }}.svc" - - "{{ default "jaeger-operator-webhook-service" .Values.webhooks.service.name }}.{{ .Release.Namespace }}.svc.cluster.local" + - "{{ default "jaeger-operator-webhook-service" .Values.webhooks.service.name }}.{{ include "jaeger-operator.namespace" . }}.svc" + - "{{ default "jaeger-operator-webhook-service" .Values.webhooks.service.name }}.{{ include "jaeger-operator.namespace" . }}.svc.cluster.local" issuerRef: {{- if .Values.certs.issuer.create }} kind: Issuer diff --git a/charts/jaeger-operator/templates/deployment.yaml b/charts/jaeger-operator/templates/deployment.yaml index 5b72a3fd..8556e90b 100644 --- a/charts/jaeger-operator/templates/deployment.yaml +++ b/charts/jaeger-operator/templates/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "jaeger-operator.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} labels: {{ include "jaeger-operator.labels" . | indent 4 }} {{- with .Values.extraLabels }} diff --git a/charts/jaeger-operator/templates/issuer.yaml b/charts/jaeger-operator/templates/issuer.yaml index 19b2382f..684f05df 100644 --- a/charts/jaeger-operator/templates/issuer.yaml +++ b/charts/jaeger-operator/templates/issuer.yaml @@ -3,7 +3,7 @@ apiVersion: cert-manager.io/v1 kind: Issuer metadata: name: {{ default "selfsigned-issuer" .Values.certs.issuer.name }} - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} spec: selfSigned: {} {{- end }} diff --git a/charts/jaeger-operator/templates/jaeger.yaml b/charts/jaeger-operator/templates/jaeger.yaml index 0c4f9d2c..3bf38017 100644 --- a/charts/jaeger-operator/templates/jaeger.yaml +++ b/charts/jaeger-operator/templates/jaeger.yaml @@ -3,7 +3,7 @@ apiVersion: jaegertracing.io/v1 kind: Jaeger metadata: name: {{ include "jaeger-operator.fullname" . }}-jaeger - namespace: {{ default .Release.Namespace .Values.jaeger.namespace }} + namespace: {{ default .Values.jaeger.namespace (include "jaeger-operator.namespace" .) }} {{- with .Values.jaeger.spec }} spec: {{ toYaml . | indent 2}} diff --git a/charts/jaeger-operator/templates/mutating-webhook.yaml b/charts/jaeger-operator/templates/mutating-webhook.yaml index 9ae64623..6fc4a2a2 100644 --- a/charts/jaeger-operator/templates/mutating-webhook.yaml +++ b/charts/jaeger-operator/templates/mutating-webhook.yaml @@ -13,7 +13,7 @@ webhooks: clientConfig: service: name: {{ default "jaeger-operator-webhook-service" .Values.webhooks.service.name }} - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} path: /mutate-v1-deployment failurePolicy: Ignore name: deployment.sidecar-injector.jaegertracing.io @@ -39,7 +39,7 @@ webhooks: clientConfig: service: name: {{ default "jaeger-operator-webhook-service" .Values.webhooks.service.name }} - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} path: /mutate-jaegertracing-io-v1-jaeger failurePolicy: Fail name: mjaeger.kb.io diff --git a/charts/jaeger-operator/templates/psp.yaml b/charts/jaeger-operator/templates/psp.yaml index 7d7cca5d..24abb4f2 100644 --- a/charts/jaeger-operator/templates/psp.yaml +++ b/charts/jaeger-operator/templates/psp.yaml @@ -3,6 +3,7 @@ apiVersion: policy/v1beta1 kind: PodSecurityPolicy metadata: name: {{ include "jaeger-operator.fullname" . }}-operator-psp + namespace: {{ include "jaeger-operator.namespace" . }} labels: {{ include "jaeger-operator.labels" . | indent 4 }} spec: diff --git a/charts/jaeger-operator/templates/role-binding.yaml b/charts/jaeger-operator/templates/role-binding.yaml index 533f828b..e226acc1 100644 --- a/charts/jaeger-operator/templates/role-binding.yaml +++ b/charts/jaeger-operator/templates/role-binding.yaml @@ -3,12 +3,12 @@ kind: {{ if .Values.rbac.clusterRole }}Cluster{{ end }}RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: {{ include "jaeger-operator.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} labels: {{ include "jaeger-operator.labels" . | indent 4 }} subjects: - kind: ServiceAccount - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} name: {{ include "jaeger-operator.serviceAccountName" . }} roleRef: kind: {{ if .Values.rbac.clusterRole }}Cluster{{ end }}Role diff --git a/charts/jaeger-operator/templates/role.yaml b/charts/jaeger-operator/templates/role.yaml index 9125ffd5..7886fb08 100644 --- a/charts/jaeger-operator/templates/role.yaml +++ b/charts/jaeger-operator/templates/role.yaml @@ -3,7 +3,7 @@ kind: {{ if .Values.rbac.clusterRole }}Cluster{{ end }}Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: {{ include "jaeger-operator.fullname" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} labels: {{ include "jaeger-operator.labels" . | indent 4 }} rules: diff --git a/charts/jaeger-operator/templates/service-account.yaml b/charts/jaeger-operator/templates/service-account.yaml index dc8eea63..05956889 100644 --- a/charts/jaeger-operator/templates/service-account.yaml +++ b/charts/jaeger-operator/templates/service-account.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "jaeger-operator.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} labels: {{ include "jaeger-operator.labels" . | indent 4 }} {{- if .Values.serviceAccount.annotations }} diff --git a/charts/jaeger-operator/templates/service.yaml b/charts/jaeger-operator/templates/service.yaml index 46705f8a..b1c4a85b 100644 --- a/charts/jaeger-operator/templates/service.yaml +++ b/charts/jaeger-operator/templates/service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "jaeger-operator.fullname" . }}-metrics - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} labels: {{ include "jaeger-operator.labels" . | indent 4 }} {{- with .Values.serviceExtraLabels }} @@ -33,7 +33,7 @@ metadata: labels: {{ include "jaeger-operator.labels" . | indent 4 }} name: {{ default "jaeger-operator-webhook-service" .Values.webhooks.service.name }} - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} {{- if .Values.webhooks.service.annotations }} annotations: {{ toYaml .Values.webhooks.service.annotations | indent 4 }} diff --git a/charts/jaeger-operator/templates/validating-webhook.yaml b/charts/jaeger-operator/templates/validating-webhook.yaml index eb0c3189..109b2387 100644 --- a/charts/jaeger-operator/templates/validating-webhook.yaml +++ b/charts/jaeger-operator/templates/validating-webhook.yaml @@ -5,13 +5,14 @@ metadata: annotations: cert-manager.io/inject-ca-from: {{ default .Release.Namespace .Values.certs.certificate.namespace }}/{{ default "jaeger-operator-service-cert" .Values.certs.certificate.secretName }} name: jaeger-operator-validating-webhook-configuration + namespace: {{ include "jaeger-operator.namespace" . }} webhooks: - admissionReviewVersions: - v1 clientConfig: service: name: {{ default "jaeger-operator-webhook-service" .Values.webhooks.service.name }} - namespace: {{ .Release.Namespace }} + namespace: {{ include "jaeger-operator.namespace" . }} path: /validate-jaegertracing-io-v1-jaeger failurePolicy: Fail name: vjaeger.kb.io diff --git a/charts/jaeger-operator/values.yaml b/charts/jaeger-operator/values.yaml index 587c6f97..372f050c 100644 --- a/charts/jaeger-operator/values.yaml +++ b/charts/jaeger-operator/values.yaml @@ -2,6 +2,8 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. +namespaceOverride: "" + image: repository: jaegertracing/jaeger-operator tag: 1.57.0 diff --git a/charts/jaeger/templates/_helpers.tpl b/charts/jaeger/templates/_helpers.tpl index 3bb14071..b639939d 100644 --- a/charts/jaeger/templates/_helpers.tpl +++ b/charts/jaeger/templates/_helpers.tpl @@ -235,6 +235,17 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- end -}} {{- end -}} +{{/* +Determine Namespace based on the inputs +*/}} +{{- define "jaeger.namespace" -}} +{{- if .Values.namespaceOverride }} +{{- .Values.namespaceOverride -}} +{{- else -}} +{{- .Release.Namespace -}} +{{- end -}} +{{- end -}} + {{- define "cassandra.host" -}} {{- if .Values.provisionDataStore.cassandra -}} {{- if .Values.storage.cassandra.nameOverride }} diff --git a/charts/jaeger/templates/agent-ds.yaml b/charts/jaeger/templates/agent-ds.yaml index 7194d65e..9f4d0c6c 100644 --- a/charts/jaeger/templates/agent-ds.yaml +++ b/charts/jaeger/templates/agent-ds.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: DaemonSet metadata: name: {{ template "jaeger.agent.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: agent diff --git a/charts/jaeger/templates/agent-sa.yaml b/charts/jaeger/templates/agent-sa.yaml index 1a8d7f45..16c4313d 100644 --- a/charts/jaeger/templates/agent-sa.yaml +++ b/charts/jaeger/templates/agent-sa.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "jaeger.agent.serviceAccountName" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: agent diff --git a/charts/jaeger/templates/agent-svc.yaml b/charts/jaeger/templates/agent-svc.yaml index e4243f2c..30f4f2e9 100644 --- a/charts/jaeger/templates/agent-svc.yaml +++ b/charts/jaeger/templates/agent-svc.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ template "jaeger.agent.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: agent diff --git a/charts/jaeger/templates/allinone-agent-svc.yaml b/charts/jaeger/templates/allinone-agent-svc.yaml index bc3c8b6c..10abafea 100644 --- a/charts/jaeger/templates/allinone-agent-svc.yaml +++ b/charts/jaeger/templates/allinone-agent-svc.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ template "jaeger.agent.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: service-agent diff --git a/charts/jaeger/templates/allinone-collector-svc.yaml b/charts/jaeger/templates/allinone-collector-svc.yaml index 7f319cac..9d13876a 100644 --- a/charts/jaeger/templates/allinone-collector-svc.yaml +++ b/charts/jaeger/templates/allinone-collector-svc.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ template "jaeger.collector.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: service-collector diff --git a/charts/jaeger/templates/allinone-configmap.yaml b/charts/jaeger/templates/allinone-configmap.yaml index 99f93b61..2d2914da 100644 --- a/charts/jaeger/templates/allinone-configmap.yaml +++ b/charts/jaeger/templates/allinone-configmap.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "jaeger.fullname" . }}-sampling-strategies + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: all-in-one diff --git a/charts/jaeger/templates/allinone-deploy.yaml b/charts/jaeger/templates/allinone-deploy.yaml index 91e27943..fbccc6f3 100644 --- a/charts/jaeger/templates/allinone-deploy.yaml +++ b/charts/jaeger/templates/allinone-deploy.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "jaeger.fullname" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: all-in-one diff --git a/charts/jaeger/templates/allinone-ing.yaml b/charts/jaeger/templates/allinone-ing.yaml index 803748b1..30b80821 100644 --- a/charts/jaeger/templates/allinone-ing.yaml +++ b/charts/jaeger/templates/allinone-ing.yaml @@ -4,6 +4,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ template "jaeger.query.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: all-in-one diff --git a/charts/jaeger/templates/allinone-sa.yaml b/charts/jaeger/templates/allinone-sa.yaml index a0fbb5a0..72146724 100644 --- a/charts/jaeger/templates/allinone-sa.yaml +++ b/charts/jaeger/templates/allinone-sa.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "jaeger.fullname" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: all-in-one diff --git a/charts/jaeger/templates/cassandra-schema-job.yaml b/charts/jaeger/templates/cassandra-schema-job.yaml index b6aec4e9..ac82821b 100644 --- a/charts/jaeger/templates/cassandra-schema-job.yaml +++ b/charts/jaeger/templates/cassandra-schema-job.yaml @@ -5,6 +5,7 @@ apiVersion: batch/v1 kind: Job metadata: name: {{ include "jaeger.fullname" . }}-cassandra-schema + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: cassandra-schema diff --git a/charts/jaeger/templates/cassandra-schema-sa.yaml b/charts/jaeger/templates/cassandra-schema-sa.yaml index 51063213..32fc02ce 100644 --- a/charts/jaeger/templates/cassandra-schema-sa.yaml +++ b/charts/jaeger/templates/cassandra-schema-sa.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "jaeger.cassandraSchema.serviceAccountName" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: cassandra-schema diff --git a/charts/jaeger/templates/cassandra-secret.yaml b/charts/jaeger/templates/cassandra-secret.yaml index aa3437f5..3d5a6a73 100644 --- a/charts/jaeger/templates/cassandra-secret.yaml +++ b/charts/jaeger/templates/cassandra-secret.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ include "jaeger.fullname" . }}-cassandra + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} type: Opaque diff --git a/charts/jaeger/templates/collector-configmap.yaml b/charts/jaeger/templates/collector-configmap.yaml index 94c2b97f..72f4c72b 100644 --- a/charts/jaeger/templates/collector-configmap.yaml +++ b/charts/jaeger/templates/collector-configmap.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "jaeger.fullname" . }}-sampling-strategies + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: collector @@ -10,4 +11,3 @@ data: strategies.json: |- {{ tpl .Values.collector.samplingConfig . | indent 4 }} {{- end }} - diff --git a/charts/jaeger/templates/collector-deploy.yaml b/charts/jaeger/templates/collector-deploy.yaml index dfdd1dc7..68124436 100644 --- a/charts/jaeger/templates/collector-deploy.yaml +++ b/charts/jaeger/templates/collector-deploy.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "jaeger.collector.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: collector @@ -38,7 +39,7 @@ spec: securityContext: {{- toYaml .Values.collector.podSecurityContext | nindent 8 }} serviceAccountName: {{ template "jaeger.collector.serviceAccountName" . }} - {{- include "collector.imagePullSecrets" . | nindent 6 }} + {{- include "collector.imagePullSecrets" . | nindent 6 }} {{- if .Values.collector.initContainers }} initContainers: {{- toYaml .Values.collector.initContainers | nindent 8 }} diff --git a/charts/jaeger/templates/collector-hpa.yaml b/charts/jaeger/templates/collector-hpa.yaml index 18e6e1ed..fe6b4061 100644 --- a/charts/jaeger/templates/collector-hpa.yaml +++ b/charts/jaeger/templates/collector-hpa.yaml @@ -3,6 +3,7 @@ apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) kind: HorizontalPodAutoscaler metadata: name: {{ template "jaeger.collector.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: collector @@ -22,22 +23,22 @@ spec: target: averageUtilization: {{ .Values.collector.autoscaling.targetMemoryUtilizationPercentage }} type: Utilization - {{- else }} + {{- else }} targetAverageUtilization: {{ .Values.collector.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} + {{- end }} {{- end }} - type: Resource resource: name: cpu - {{- if eq "autoscaling/v2" (include "common.capabilities.hpa.apiVersion" ( dict "context" $ )) }} + {{- if eq "autoscaling/v2" (include "common.capabilities.hpa.apiVersion" ( dict "context" $ )) }} target: averageUtilization: {{ .Values.collector.autoscaling.targetCPUUtilizationPercentage | default 80 }} type: Utilization - {{- else }} + {{- else }} targetAverageUtilization: {{ .Values.collector.autoscaling.targetCPUUtilizationPercentage | default 80 }} {{- end }} {{- with .Values.collector.autoscaling.behavior }} behavior: {{- toYaml . | nindent 4 }} - {{- end }} + {{- end }} {{- end }} diff --git a/charts/jaeger/templates/collector-ing.yaml b/charts/jaeger/templates/collector-ing.yaml index 61d9ca11..55f6a5c4 100644 --- a/charts/jaeger/templates/collector-ing.yaml +++ b/charts/jaeger/templates/collector-ing.yaml @@ -6,6 +6,7 @@ apiVersion: {{ include "common.capabilities.ingress.apiVersion" $ }} kind: Ingress metadata: name: {{ template "jaeger.collector.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} {{- if .Values.collector.ingress.labels }} diff --git a/charts/jaeger/templates/collector-sa.yaml b/charts/jaeger/templates/collector-sa.yaml index c3444535..96fb6a6a 100644 --- a/charts/jaeger/templates/collector-sa.yaml +++ b/charts/jaeger/templates/collector-sa.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "jaeger.collector.serviceAccountName" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: collector diff --git a/charts/jaeger/templates/collector-servicemonitor.yaml b/charts/jaeger/templates/collector-servicemonitor.yaml index fbd94fe5..a67aa36d 100644 --- a/charts/jaeger/templates/collector-servicemonitor.yaml +++ b/charts/jaeger/templates/collector-servicemonitor.yaml @@ -5,6 +5,8 @@ metadata: name: {{ template "jaeger.collector.name" . }} {{- if .Values.collector.serviceMonitor.namespace }} namespace: {{ .Values.collector.serviceMonitor.namespace }} + {{- else }} + namespace: {{ include "jaeger.namespace" . }} {{- end }} labels: {{- include "jaeger.labels" . | nindent 4 }} @@ -36,7 +38,7 @@ spec: {{- end }} namespaceSelector: matchNames: - - {{ .Release.Namespace }} + - {{ include "jaeger.namespace" . }} selector: matchLabels: app.kubernetes.io/component: collector diff --git a/charts/jaeger/templates/collector-svc.yaml b/charts/jaeger/templates/collector-svc.yaml index 4bf54003..25846a52 100644 --- a/charts/jaeger/templates/collector-svc.yaml +++ b/charts/jaeger/templates/collector-svc.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ template "jaeger.collector.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: collector diff --git a/charts/jaeger/templates/elasticsearch-secret.yaml b/charts/jaeger/templates/elasticsearch-secret.yaml index 7b5b25cd..4adda957 100644 --- a/charts/jaeger/templates/elasticsearch-secret.yaml +++ b/charts/jaeger/templates/elasticsearch-secret.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ include "jaeger.fullname" . }}-elasticsearch + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} annotations: diff --git a/charts/jaeger/templates/es-index-cleaner-cronjob.yaml b/charts/jaeger/templates/es-index-cleaner-cronjob.yaml index e7155aca..b3c73cd4 100644 --- a/charts/jaeger/templates/es-index-cleaner-cronjob.yaml +++ b/charts/jaeger/templates/es-index-cleaner-cronjob.yaml @@ -3,6 +3,7 @@ apiVersion: {{ include "common.capabilities.cronjob.apiVersion" $ }} kind: CronJob metadata: name: {{ include "jaeger.fullname" . }}-es-index-cleaner + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: es-index-cleaner diff --git a/charts/jaeger/templates/es-index-cleaner-sa.yaml b/charts/jaeger/templates/es-index-cleaner-sa.yaml index 68b918f3..5437a93a 100644 --- a/charts/jaeger/templates/es-index-cleaner-sa.yaml +++ b/charts/jaeger/templates/es-index-cleaner-sa.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "jaeger.esIndexCleaner.serviceAccountName" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: es-index-cleaner diff --git a/charts/jaeger/templates/es-lookback-cronjob.yaml b/charts/jaeger/templates/es-lookback-cronjob.yaml index d5e4716c..fb687d63 100644 --- a/charts/jaeger/templates/es-lookback-cronjob.yaml +++ b/charts/jaeger/templates/es-lookback-cronjob.yaml @@ -3,6 +3,7 @@ apiVersion: {{ include "common.capabilities.cronjob.apiVersion" $ }} kind: CronJob metadata: name: {{ include "jaeger.fullname" . }}-es-lookback + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: es-lookback @@ -38,7 +39,7 @@ spec: {{- end }} spec: serviceAccountName: {{ template "jaeger.esLookback.serviceAccountName" . }} - {{- include "esLookback.imagePullSecrets" . | nindent 10 }} + {{- include "esLookback.imagePullSecrets" . | nindent 10 }} securityContext: {{- toYaml .Values.esLookback.podSecurityContext | nindent 12 }} restartPolicy: OnFailure diff --git a/charts/jaeger/templates/es-lookback-sa.yaml b/charts/jaeger/templates/es-lookback-sa.yaml index 89c4b745..6f49d7da 100644 --- a/charts/jaeger/templates/es-lookback-sa.yaml +++ b/charts/jaeger/templates/es-lookback-sa.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "jaeger.esLookback.serviceAccountName" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: es-lookback diff --git a/charts/jaeger/templates/es-rollover-cronjob.yaml b/charts/jaeger/templates/es-rollover-cronjob.yaml index 35f9e5bc..dc82b9c3 100644 --- a/charts/jaeger/templates/es-rollover-cronjob.yaml +++ b/charts/jaeger/templates/es-rollover-cronjob.yaml @@ -3,6 +3,7 @@ apiVersion: {{ include "common.capabilities.cronjob.apiVersion" $ }} kind: CronJob metadata: name: {{ include "jaeger.fullname" . }}-es-rollover + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: es-rollover diff --git a/charts/jaeger/templates/es-rollover-hook.yml b/charts/jaeger/templates/es-rollover-hook.yml index 8fa06c12..ca0a8495 100644 --- a/charts/jaeger/templates/es-rollover-hook.yml +++ b/charts/jaeger/templates/es-rollover-hook.yml @@ -3,6 +3,7 @@ apiVersion: batch/v1 kind: Job metadata: name: {{ include "jaeger.fullname" . }}-es-rollover-init + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: es-rollover-init diff --git a/charts/jaeger/templates/es-rollover-sa.yaml b/charts/jaeger/templates/es-rollover-sa.yaml index 351906c5..ba51add7 100644 --- a/charts/jaeger/templates/es-rollover-sa.yaml +++ b/charts/jaeger/templates/es-rollover-sa.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "jaeger.esRollover.serviceAccountName" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: es-index-rollover diff --git a/charts/jaeger/templates/hotrod-deploy.yaml b/charts/jaeger/templates/hotrod-deploy.yaml index ad74c1e9..9bb44d7a 100644 --- a/charts/jaeger/templates/hotrod-deploy.yaml +++ b/charts/jaeger/templates/hotrod-deploy.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "jaeger.fullname" . }}-hotrod + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: hotrod @@ -21,7 +22,7 @@ spec: securityContext: {{- toYaml .Values.hotrod.podSecurityContext | nindent 8 }} serviceAccountName: {{ template "jaeger.hotrod.serviceAccountName" . }} - {{- include "hotrod.imagePullSecrets" . | nindent 6 }} + {{- include "hotrod.imagePullSecrets" . | nindent 6 }} containers: - name: {{ include "jaeger.fullname" . }}-hotrod securityContext: diff --git a/charts/jaeger/templates/hotrod-ing.yaml b/charts/jaeger/templates/hotrod-ing.yaml index abfaffbe..c0f1e91c 100644 --- a/charts/jaeger/templates/hotrod-ing.yaml +++ b/charts/jaeger/templates/hotrod-ing.yaml @@ -7,6 +7,7 @@ apiVersion: {{ include "common.capabilities.ingress.apiVersion" $ }} kind: Ingress metadata: name: {{ include "jaeger.fullname" . }}-hotrod + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: hotrod diff --git a/charts/jaeger/templates/hotrod-sa.yaml b/charts/jaeger/templates/hotrod-sa.yaml index 6026edbe..b1bbd398 100644 --- a/charts/jaeger/templates/hotrod-sa.yaml +++ b/charts/jaeger/templates/hotrod-sa.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "jaeger.hotrod.serviceAccountName" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: hotrod diff --git a/charts/jaeger/templates/hotrod-svc.yaml b/charts/jaeger/templates/hotrod-svc.yaml index 01771a58..cb73194d 100644 --- a/charts/jaeger/templates/hotrod-svc.yaml +++ b/charts/jaeger/templates/hotrod-svc.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "jaeger.fullname" . }}-hotrod + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: hotrod diff --git a/charts/jaeger/templates/ingester-deploy.yaml b/charts/jaeger/templates/ingester-deploy.yaml index 844f8042..c59aa201 100644 --- a/charts/jaeger/templates/ingester-deploy.yaml +++ b/charts/jaeger/templates/ingester-deploy.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "jaeger.fullname" . }}-ingester + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: ingester diff --git a/charts/jaeger/templates/ingester-hpa.yaml b/charts/jaeger/templates/ingester-hpa.yaml index 66ecec95..933cc68f 100644 --- a/charts/jaeger/templates/ingester-hpa.yaml +++ b/charts/jaeger/templates/ingester-hpa.yaml @@ -3,6 +3,7 @@ apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) kind: HorizontalPodAutoscaler metadata: name: {{ template "jaeger.ingester.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: ingester @@ -22,22 +23,22 @@ spec: target: averageUtilization: {{ .Values.ingester.autoscaling.targetMemoryUtilizationPercentage }} type: Utilization - {{- else }} + {{- else }} targetAverageUtilization: {{ .Values.ingester.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} + {{- end }} {{- end }} - type: Resource resource: name: cpu - {{- if eq "autoscaling/v2" (include "common.capabilities.hpa.apiVersion" ( dict "context" $ )) }} + {{- if eq "autoscaling/v2" (include "common.capabilities.hpa.apiVersion" ( dict "context" $ )) }} target: averageUtilization: {{ .Values.ingester.autoscaling.targetCPUUtilizationPercentage | default 80 }} type: Utilization - {{- else }} + {{- else }} targetAverageUtilization: {{ .Values.ingester.autoscaling.targetCPUUtilizationPercentage | default 80 }} {{- end }} {{- with .Values.ingester.autoscaling.behavior }} behavior: {{- toYaml . | nindent 4 }} - {{- end }} + {{- end }} {{- end }} diff --git a/charts/jaeger/templates/ingester-sa.yaml b/charts/jaeger/templates/ingester-sa.yaml index 900e2dd5..93c507f4 100644 --- a/charts/jaeger/templates/ingester-sa.yaml +++ b/charts/jaeger/templates/ingester-sa.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "jaeger.ingester.serviceAccountName" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: ingester diff --git a/charts/jaeger/templates/ingester-servicemonitor.yaml b/charts/jaeger/templates/ingester-servicemonitor.yaml index 957c5b6f..87a0f203 100644 --- a/charts/jaeger/templates/ingester-servicemonitor.yaml +++ b/charts/jaeger/templates/ingester-servicemonitor.yaml @@ -5,6 +5,8 @@ metadata: name: {{ template "jaeger.ingester.name" . }} {{- if .Values.ingester.serviceMonitor.namespace }} namespace: {{ .Values.ingester.serviceMonitor.namespace }} + {{- else }} + namespace: {{ include "jaeger.namespace" . }} {{- end }} labels: {{- include "jaeger.labels" . | nindent 4 }} diff --git a/charts/jaeger/templates/ingester-svc.yaml b/charts/jaeger/templates/ingester-svc.yaml index 18a07e8e..efdc0d90 100644 --- a/charts/jaeger/templates/ingester-svc.yaml +++ b/charts/jaeger/templates/ingester-svc.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ template "jaeger.ingester.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: ingester diff --git a/charts/jaeger/templates/oauth-sidecar-configmap.yaml b/charts/jaeger/templates/oauth-sidecar-configmap.yaml index 88e2464b..20ef520d 100644 --- a/charts/jaeger/templates/oauth-sidecar-configmap.yaml +++ b/charts/jaeger/templates/oauth-sidecar-configmap.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "jaeger.fullname" . }}-oauth-configuration + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: query diff --git a/charts/jaeger/templates/query-configmap.yaml b/charts/jaeger/templates/query-configmap.yaml index fa71bcbb..aa2a7acb 100644 --- a/charts/jaeger/templates/query-configmap.yaml +++ b/charts/jaeger/templates/query-configmap.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "jaeger.fullname" . }}-ui-configuration + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: query diff --git a/charts/jaeger/templates/query-deploy.yaml b/charts/jaeger/templates/query-deploy.yaml index 7aef1c62..7faea32f 100644 --- a/charts/jaeger/templates/query-deploy.yaml +++ b/charts/jaeger/templates/query-deploy.yaml @@ -3,6 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "jaeger.query.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: query @@ -47,7 +48,7 @@ spec: {{- if .Values.query.initContainers }} initContainers: {{- toYaml .Values.query.initContainers | nindent 8 }} - {{- end}} + {{- end}} containers: - name: {{ template "jaeger.query.name" . }} securityContext: diff --git a/charts/jaeger/templates/query-ing.yaml b/charts/jaeger/templates/query-ing.yaml index c86fd5c8..f3e4b93c 100644 --- a/charts/jaeger/templates/query-ing.yaml +++ b/charts/jaeger/templates/query-ing.yaml @@ -6,6 +6,7 @@ apiVersion: {{ include "common.capabilities.ingress.apiVersion" $ }} kind: Ingress metadata: name: {{ template "jaeger.query.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} {{- if .Values.query.ingress.labels }} diff --git a/charts/jaeger/templates/query-sa.yaml b/charts/jaeger/templates/query-sa.yaml index da6ac97d..451b788c 100644 --- a/charts/jaeger/templates/query-sa.yaml +++ b/charts/jaeger/templates/query-sa.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "jaeger.query.serviceAccountName" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: query diff --git a/charts/jaeger/templates/query-servicemonitor.yaml b/charts/jaeger/templates/query-servicemonitor.yaml index e52086b7..2505197e 100644 --- a/charts/jaeger/templates/query-servicemonitor.yaml +++ b/charts/jaeger/templates/query-servicemonitor.yaml @@ -5,6 +5,8 @@ metadata: name: {{ template "jaeger.query.name" . }} {{- if .Values.query.serviceMonitor.namespace }} namespace: {{ .Values.query.serviceMonitor.namespace }} + {{- else }} + namespace: {{ include "jaeger.namespace" . }} {{- end }} labels: {{- include "jaeger.labels" . | nindent 4 }} diff --git a/charts/jaeger/templates/query-svc.yaml b/charts/jaeger/templates/query-svc.yaml index 37f7d160..22bf78bf 100644 --- a/charts/jaeger/templates/query-svc.yaml +++ b/charts/jaeger/templates/query-svc.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ template "jaeger.query.name" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: query diff --git a/charts/jaeger/templates/spark-cronjob.yaml b/charts/jaeger/templates/spark-cronjob.yaml index f58efa8f..c6de61cd 100644 --- a/charts/jaeger/templates/spark-cronjob.yaml +++ b/charts/jaeger/templates/spark-cronjob.yaml @@ -3,6 +3,7 @@ apiVersion: {{ include "common.capabilities.cronjob.apiVersion" $ }} kind: CronJob metadata: name: {{ include "jaeger.fullname" . }}-spark + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: spark diff --git a/charts/jaeger/templates/spark-sa.yaml b/charts/jaeger/templates/spark-sa.yaml index d35eaebc..8466d58d 100644 --- a/charts/jaeger/templates/spark-sa.yaml +++ b/charts/jaeger/templates/spark-sa.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "jaeger.spark.serviceAccountName" . }} + namespace: {{ include "jaeger.namespace" . }} labels: {{- include "jaeger.labels" . | nindent 4 }} app.kubernetes.io/component: spark diff --git a/charts/jaeger/values.yaml b/charts/jaeger/values.yaml index e7715b21..ef215229 100644 --- a/charts/jaeger/values.yaml +++ b/charts/jaeger/values.yaml @@ -17,6 +17,7 @@ networkPolicy: tag: "" nameOverride: "" +namespaceOverride: "" fullnameOverride: "" allInOne: