I am trying to create a Helm chart conditional template for a SecurityContextConstraint
/ SCC based whether I'm installing on an Openshift cluster or not. Because SCCs are Openshift-specific resources.
So that, on executing helm install <release-name> <chart> -n <namespace>
) on an Openshift cluster, SCC should automatically get created.
Fallback option would be to use something like this:
{{ if .Values.isOpenshift }}
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
...
{{ end }}