forked from nginx/nginx-gateway-fabric
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow NGF to run on OpenShift (nginx#1976)
Add SecurityContextConstraints for NGF and documentation on additional steps when installing NGF on an OpenShift environment. Problem: NGF fails to deploy on OpenShift. Solution: Add SecurityContextConstraints for NGF, giving NGF to correct permissions to deploy on OpenShift. Testing: Manual deployment of NGF with NGINX and NGINX+. Also set up the cafe example and ensured traffic flowed.
- Loading branch information
Showing
7 changed files
with
117 additions
and
1 deletion.
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
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,40 @@ | ||
{{- if .Capabilities.APIVersions.Has "security.openshift.io/v1/SecurityContextConstraints" }} | ||
kind: SecurityContextConstraints | ||
apiVersion: security.openshift.io/v1 | ||
metadata: | ||
name: {{ include "nginx-gateway.scc-name" . }} | ||
allowPrivilegeEscalation: {{ .Values.nginxGateway.securityContext.allowPrivilegeEscalation }} | ||
allowHostDirVolumePlugin: false | ||
allowHostIPC: false | ||
allowHostNetwork: false | ||
allowHostPID: false | ||
allowHostPorts: false | ||
allowPrivilegedContainer: false | ||
readOnlyRootFilesystem: true | ||
runAsUser: | ||
type: MustRunAsRange | ||
uidRangeMin: 101 | ||
uidRangeMax: 102 | ||
fsGroup: | ||
type: MustRunAs | ||
ranges: | ||
- min: 1001 | ||
max: 1001 | ||
supplementalGroups: | ||
type: MustRunAs | ||
ranges: | ||
- min: 1001 | ||
max: 1001 | ||
seLinuxContext: | ||
type: MustRunAs | ||
volumes: | ||
- emptyDir | ||
- secret | ||
users: | ||
- {{ printf "system:serviceaccount:%s:%s" .Release.Namespace (include "nginx-gateway.serviceAccountName" .) }} | ||
allowedCapabilities: | ||
- NET_BIND_SERVICE | ||
- KILL | ||
requiredDropCapabilities: | ||
- ALL | ||
{{- 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
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,40 @@ | ||
--- | ||
# Source: nginx-gateway-fabric/templates/scc.yaml | ||
kind: SecurityContextConstraints | ||
apiVersion: security.openshift.io/v1 | ||
metadata: | ||
name: nginx-gateway-scc | ||
allowPrivilegeEscalation: false | ||
allowHostDirVolumePlugin: false | ||
allowHostIPC: false | ||
allowHostNetwork: false | ||
allowHostPID: false | ||
allowHostPorts: false | ||
allowPrivilegedContainer: false | ||
readOnlyRootFilesystem: true | ||
runAsUser: | ||
type: MustRunAsRange | ||
uidRangeMin: 101 | ||
uidRangeMax: 102 | ||
fsGroup: | ||
type: MustRunAs | ||
ranges: | ||
- min: 1001 | ||
max: 1001 | ||
supplementalGroups: | ||
type: MustRunAs | ||
ranges: | ||
- min: 1001 | ||
max: 1001 | ||
seLinuxContext: | ||
type: MustRunAs | ||
volumes: | ||
- emptyDir | ||
- secret | ||
users: | ||
- system:serviceaccount:nginx-gateway:nginx-gateway | ||
allowedCapabilities: | ||
- NET_BIND_SERVICE | ||
- KILL | ||
requiredDropCapabilities: | ||
- ALL |
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