Skip to content
Draft
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
10 changes: 0 additions & 10 deletions helm/olmv1/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,3 @@ Return an empty string when disabled so the helper can be used in conditionals.
true
{{- end -}}
{{- end -}}

{{/*
When rendering with OpenShift, only one of the main components (catalogd, operatorController)
should be enabled
*/}}
{{- if .Values.options.openshift.enabled -}}
{{- if and .Values.options.catalogd.enabled .Values.options.operatorController.enabled -}}
{{- fail "When rendering Openshift, only one of {catalogd, operatorController} should also be enabled" -}}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- if .Values.options.catalogd.enabled }}
{{- $deployment := .Values.options.catalogd.deployment }}
{{- $externalTLS := $deployment.externalTLS | default dict }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -26,9 +28,8 @@ spec:
annotations:
kubectl.kubernetes.io/default-container: manager
{{- include "olmv1.annotations" . | nindent 8 }}
{{- if .Values.options.openshift.enabled }}
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
openshift.io/required-scc: privileged
{{- with omit (.Values.options.catalogd.deployment.podAnnotations | default dict) "kubectl.kubernetes.io/default-container" "olm.operatorframework.io/feature-set" }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: catalogd
Expand Down Expand Up @@ -61,11 +62,10 @@ spec:
- --tls-cert=/var/certs/tls.crt
- --tls-key=/var/certs/tls.key
- --pull-cas-dir=/var/ca-certs
{{- else if .Values.options.openshift.enabled }}
- --tls-cert=/var/certs/tls.crt
- --tls-key=/var/certs/tls.key
- --v=${LOG_VERBOSITY}
- --global-pull-secret=openshift-config/pull-secret
{{- else }}
{{- range $externalTLS.extraArguments }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{- if .Values.options.e2e.enabled }}
{{- /* This is effectively modern with the CHACHA cipher and secp384r1 curve removed */}}
Expand All @@ -76,15 +76,14 @@ spec:
{{- end }}
command:
- ./catalogd
{{- if or .Values.options.e2e.enabled .Values.options.openshift.enabled }}
{{- if or .Values.options.e2e.enabled $deployment.extraEnv }}
env:
{{- if .Values.options.e2e.enabled }}
- name: GOCOVERDIR
value: /e2e-coverage
{{- end }}
{{- if .Values.options.openshift.enabled }}
- name: SSL_CERT_DIR
value: /var/ca-certs
{{- with $deployment.extraEnv }}
{{- toYamlPretty . | nindent 12 }}
{{- end }}
{{- end }}
image: "{{ .Values.options.catalogd.deployment.image }}"
Expand Down Expand Up @@ -122,18 +121,10 @@ spec:
- mountPath: /var/ca-certs
name: ca-certs
readOnly: true
{{- else if .Values.options.openshift.enabled }}
- mountPath: /var/certs
name: catalogserver-certs
- mountPath: /var/ca-certs
name: ca-certs
readOnly: true
- mountPath: /etc/containers
name: etc-containers
readOnly: true
- mountPath: /etc/docker
name: etc-docker
readOnly: true
{{- else }}
{{- with $externalTLS.volumeMounts }}
{{- toYamlPretty . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.deployments.containerSpec }}
{{- toYamlPretty . | nindent 10 }}
Expand Down Expand Up @@ -166,39 +157,10 @@ spec:
path: olm-ca.crt
optional: false
secretName: catalogd-service-cert-git-version
{{- else if .Values.options.openshift.enabled }}
- name: catalogserver-certs
secret:
items:
- key: tls.crt
path: tls.crt
- key: tls.key
path: tls.key
optional: false
secretName: catalogserver-cert
- name: ca-certs
projected:
sources:
- configMap:
items:
- key: ca-bundle.crt
path: ca-bundle.crt
name: catalogd-trusted-ca-bundle
optional: false
- configMap:
items:
- key: service-ca.crt
path: service-ca.crt
name: openshift-service-ca.crt
optional: false
- hostPath:
path: /etc/containers
type: Directory
name: etc-containers
- hostPath:
path: /etc/docker
type: Directory
name: etc-docker
{{- else }}
{{- with $externalTLS.volumes }}
{{- toYamlPretty . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.deployments.templateSpec }}
{{- toYamlPretty . | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if include "objectController.enabled" . }}
{{- $metricsTLS := or .Values.options.certManager.enabled .Values.options.objectController.metricsTLS.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -25,9 +26,8 @@ spec:
annotations:
kubectl.kubernetes.io/default-container: manager
{{- include "olmv1.annotations" . | nindent 8 }}
{{- if .Values.options.openshift.enabled }}
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
openshift.io/required-scc: privileged
{{- with omit (.Values.options.objectController.deployment.podAnnotations | default dict) "kubectl.kubernetes.io/default-container" "olm.operatorframework.io/feature-set" }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: object-controller
Expand All @@ -49,13 +49,13 @@ spec:
{{- if .Values.options.profiling.enabled }}
- --pprof-bind-address=:6060
{{- end }}
{{- if or .Values.options.certManager.enabled .Values.options.openshift.enabled }}
{{- if $metricsTLS }}
- --metrics-bind-address=:8443
- --tls-cert=/var/certs/tls.crt
- --tls-key=/var/certs/tls.key
{{- end }}
{{- if .Values.options.openshift.enabled }}
- --v=${LOG_VERBOSITY}
{{- with .Values.options.objectController.deployment.logVerbosity }}
- {{ printf "--v=%v" . | quote }}
{{- end }}
{{- if .Values.options.e2e.enabled }}
- --tls-profile=modern
Expand Down Expand Up @@ -87,9 +87,9 @@ spec:
requests:
cpu: 10m
memory: 64Mi
{{- if or .Values.options.certManager.enabled .Values.options.openshift.enabled .Values.options.e2e.enabled }}
{{- if or $metricsTLS .Values.options.e2e.enabled }}
volumeMounts:
{{- if or .Values.options.certManager.enabled .Values.options.openshift.enabled }}
{{- if $metricsTLS }}
- name: object-controller-certs
mountPath: /var/certs
readOnly: true
Expand All @@ -103,9 +103,9 @@ spec:
{{- toYaml . | nindent 10 }}
{{- end }}
serviceAccountName: object-controller-controller-manager
{{- if or .Values.options.certManager.enabled .Values.options.openshift.enabled .Values.options.e2e.enabled }}
{{- if or $metricsTLS .Values.options.e2e.enabled }}
volumes:
{{- if or .Values.options.certManager.enabled .Values.options.openshift.enabled }}
{{- if $metricsTLS }}
- name: object-controller-certs
secret:
secretName: object-controller-cert
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- if .Values.options.operatorController.enabled }}
{{- $deployment := .Values.options.operatorController.deployment }}
{{- $externalTLS := $deployment.externalTLS | default dict }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -25,9 +27,8 @@ spec:
annotations:
kubectl.kubernetes.io/default-container: manager
{{- include "olmv1.annotations" . | nindent 8 }}
{{- if .Values.options.openshift.enabled }}
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
openshift.io/required-scc: privileged
{{- with omit (.Values.options.operatorController.deployment.podAnnotations | default dict) "kubectl.kubernetes.io/default-container" "olm.operatorframework.io/feature-set" }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: operator-controller
Expand Down Expand Up @@ -61,27 +62,24 @@ spec:
- --tls-key=/var/certs/tls.key
- --catalogd-cas-dir=/var/ca-certs
- --pull-cas-dir=/var/ca-certs
{{- else if .Values.options.openshift.enabled }}
- --tls-cert=/var/certs/tls.crt
- --tls-key=/var/certs/tls.key
- --catalogd-cas-dir=/var/ca-certs
- --v=${LOG_VERBOSITY}
- --global-pull-secret=openshift-config/pull-secret
{{- else }}
{{- range $externalTLS.extraArguments }}
- {{ . | quote }}
{{- end }}
{{- end }}
{{- if .Values.options.e2e.enabled }}
- --tls-profile=modern
{{- end }}
command:
- /operator-controller
{{- if or .Values.options.e2e.enabled .Values.options.openshift.enabled }}
{{- if or .Values.options.e2e.enabled $deployment.extraEnv }}
env:
{{- if .Values.options.e2e.enabled }}
- name: GOCOVERDIR
value: /e2e-coverage
{{- end }}
{{- if .Values.options.openshift.enabled }}
- name: SSL_CERT_DIR
value: /var/ca-certs
{{- with $deployment.extraEnv }}
{{- toYamlPretty . | nindent 12 }}
{{- end }}
{{- end }}
image: "{{ .Values.options.operatorController.deployment.image }}"
Expand Down Expand Up @@ -122,18 +120,10 @@ spec:
- mountPath: /var/ca-certs
name: ca-certs
readOnly: true
{{- else if .Values.options.openshift.enabled }}
- mountPath: /var/certs
name: operator-controller-certs
- mountPath: /var/ca-certs
name: ca-certs
readOnly: true
- mountPath: /etc/containers
name: etc-containers
readOnly: true
- mountPath: /etc/docker
name: etc-docker
readOnly: true
{{- else }}
{{- with $externalTLS.volumeMounts }}
{{- toYamlPretty . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.deployments.containerSpec }}
{{- toYaml . | nindent 10 }}
Expand Down Expand Up @@ -169,39 +159,10 @@ spec:
path: olm-ca.crt
optional: false
secretName: operator-controller-cert
{{- else if .Values.options.openshift.enabled }}
- name: operator-controller-certs
secret:
items:
- key: tls.crt
path: tls.crt
- key: tls.key
path: tls.key
optional: false
secretName: operator-controller-cert
- name: ca-certs
projected:
sources:
- configMap:
items:
- key: ca-bundle.crt
path: ca-bundle.crt
name: operator-controller-trusted-ca-bundle
optional: false
- configMap:
items:
- key: service-ca.crt
path: service-ca.crt
name: openshift-service-ca.crt
optional: false
- hostPath:
path: /etc/containers
type: Directory
name: etc-containers
- hostPath:
path: /etc/docker
type: Directory
name: etc-docker
{{- else }}
{{- with $externalTLS.volumes }}
{{- toYamlPretty . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.deployments.templateSpec }}
{{- toYamlPretty . | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ metadata:
app.kubernetes.io/name: catalogd
{{- include "olmv1.labels" . | nindent 4 }}
annotations:
{{- $annotations := omit (.Values.options.catalogd.webhook.annotations | default dict) "olm.operatorframework.io/feature-set" }}
{{- if .Values.options.certManager.enabled }}
cert-manager.io/inject-ca-from-secret: cert-manager/olmv1-ca
{{- $annotations = omit $annotations "cert-manager.io/inject-ca-from-secret" }}
{{- end }}
{{- if .Values.options.openshift.enabled }}
service.beta.openshift.io/inject-cabundle: "true"
{{- with $annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- include "olmv1.annotations" . | nindent 4 }}
webhooks:
Expand Down
15 changes: 9 additions & 6 deletions helm/olmv1/templates/namespace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ kind: Namespace
metadata:
annotations:
{{- include "olmv1.annotations" . | nindent 4 }}
{{- if .Values.options.openshift.enabled }}
openshift.io/node-selector: ""
workload.openshift.io/allowed: management
{{- with omit (.Values.namespaces.olmv1.annotations | default dict) "olm.operatorframework.io/feature-set" }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- $psProfile := ternary "privileged" "restricted" .Values.options.openshift.enabled }}
{{- $psProfile := .Values.namespaces.olmv1.podSecurityProfile | default "restricted" }}
app.kubernetes.io/name: {{ include "olmv1.label.name" . }}
pod-security.kubernetes.io/audit: {{ $psProfile }}
pod-security.kubernetes.io/audit-version: latest
Expand All @@ -19,8 +18,12 @@ metadata:
pod-security.kubernetes.io/warn: {{ $psProfile }}
pod-security.kubernetes.io/warn-version: latest
{{- include "olmv1.labels" . | nindent 4 }}
{{- if .Values.options.openshift.enabled }}
openshift.io/cluster-monitoring: "true"
{{- with omit (.Values.namespaces.olmv1.labels | default dict)
"app.kubernetes.io/name" "app.kubernetes.io/part-of"
"pod-security.kubernetes.io/audit" "pod-security.kubernetes.io/audit-version"
"pod-security.kubernetes.io/enforce" "pod-security.kubernetes.io/enforce-version"
"pod-security.kubernetes.io/warn" "pod-security.kubernetes.io/warn-version" }}
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ .Values.namespaces.olmv1.name }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
spec:
egress:
- {}
{{- if or .Values.options.certManager.enabled .Values.options.openshift.enabled }}
{{- if or .Values.options.certManager.enabled .Values.options.objectController.metricsTLS.enabled }}
ingress:
- ports:
- port: 8443
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading