diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/_default_values.tpl b/charts/gitops-runtime/templates/_components/gitops-operator/_default_values.tpl index dd552eb8..6a2c9e2a 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_default_values.tpl +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_default_values.tpl @@ -87,6 +87,13 @@ extraVolumes: [] extraVolumeMounts: [] affinity: {} +debug: + enabled: false + image: + registry: registry.k8s.io + repository: pause + tag: 3.10 + resources: limits: {} requests: diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/_deployment.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/_deployment.yaml index 0e59fc06..7c5272d6 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_deployment.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_deployment.yaml @@ -33,24 +33,28 @@ spec: {{- end }} serviceAccountName: {{ include "gitops-operator.serviceAccountName" . }} securityContext: + {{- if .Values.debug.enabled }} + runAsNonRoot: false + {{- else }} {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- end }} containers: - - name: manager + - name: {{ ternary "debug" "manager" .Values.debug.enabled }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} {{- $imageContext := deepCopy .Values.image }} {{- if not (get $imageContext "tag") }} {{- $_ := set $imageContext "tag" .Chart.AppVersion }} {{- end }} + {{- if .Values.debug.enabled }} + {{- $imageContext = deepCopy .Values.debug.image }} + {{- end }} image: {{ include "codefresh-gitops-runtime.image.name" (dict "image" $imageContext "context" .) }} env: {{- include "codefresh-gitops-runtime.env-vars" (dict "Values" $mergedValues "context" .) | nindent 8 }} imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.command }} - command: - {{- .Values.command | toYaml | nindent 8 }} - {{- else }} + {{- with .Values.command }} command: - - /manager + {{- . | toYaml | nindent 8 }} {{- end }} {{- with .Values.extraArgs }} args: @@ -61,6 +65,7 @@ spec: containerPort: 8080 - name: http-health containerPort: 8081 + {{- if not .Values.debug.enabled }} readinessProbe: initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.readinessProbe.periodSeconds }} @@ -79,6 +84,7 @@ spec: httpGet: port: http-health path: /healthz + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: