generated from steadybit/extension-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from steadybit/refa/helm-no-hardcoded-uid
refa: improve helm chart for openshift
- Loading branch information
Showing
10 changed files
with
325 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- /* | ||
will omit attribute from the passed in object depending on the KubeVersion | ||
*/}} | ||
{{- define "omitForKuberVersion" -}} | ||
{{- $top := index . 0 -}} | ||
{{- $versionConstraint := index . 1 -}} | ||
{{- $dict := index . 2 -}} | ||
{{- $toOmit := index . 3 -}} | ||
{{- if semverCompare $versionConstraint $top.Capabilities.KubeVersion.Version -}} | ||
{{- $dict := omit $dict $toOmit -}} | ||
{{- end -}} | ||
{{- $dict | toYaml -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
charts/steadybit-extension-host/templates/scc-clusterrole.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if or .Values.securityContextConstraint.create (and (.Capabilities.APIVersions.Has "security.openshift.io/v1/SecurityContextConstraints") (eq .Values.securityContextConstraint.create nil)) -}} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: "system:openshift:scc:{{ .Values.securityContextConstraint.name }}" | ||
rules: | ||
- apiGroups: | ||
- security.openshift.io | ||
resourceNames: | ||
- {{ .Values.securityContextConstraint.name }} | ||
resources: | ||
- securitycontextconstraints | ||
verbs: | ||
- use | ||
{{- end -}} |
15 changes: 15 additions & 0 deletions
15
charts/steadybit-extension-host/templates/scc-rolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if or .Values.securityContextConstraint.create (and (.Capabilities.APIVersions.Has "security.openshift.io/v1/SecurityContextConstraints") (eq .Values.securityContextConstraint.create nil)) -}} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: "system:openshift:scc:{{ .Values.securityContextConstraint.name }}" | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: "system:openshift:scc:{{ .Values.securityContextConstraint.name }}" | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ .Values.serviceAccount.name }} | ||
namespace: {{ .Release.Namespace }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if or .Values.securityContextConstraint.create (and (.Capabilities.APIVersions.Has "security.openshift.io/v1/SecurityContextConstraints") (eq .Values.securityContextConstraint.create nil)) -}} | ||
apiVersion: security.openshift.io/v1 | ||
kind: SecurityContextConstraints | ||
metadata: | ||
name: {{ .Values.securityContextConstraint.name }} | ||
priority: null | ||
allowedCapabilities: | ||
{{- .Values.containerSecurityContext.capabilities.add | toYaml | nindent 2 }} | ||
allowHostNetwork: true | ||
allowHostPID: true | ||
allowHostPorts: true | ||
allowHostDirVolumePlugin: true | ||
allowPrivilegeEscalation: true | ||
runAsUser: | ||
type: MustRunAsNonRoot | ||
seccompProfiles: | ||
- unconfined | ||
seLinuxContext: | ||
type: MustRunAs | ||
{{- end -}} |
Oops, something went wrong.