You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
Deploying a GatewayClass and Gateway fails in Openshift cluster having strict security constraints in place.
Warning FailedCreate 4m5s (x79 over 6h33m) replicaset-controller Error creating: pods "envoy-test-apps-eg-5a4ee66b-7d96589c85-" is forbidden: unable to validate against any security context constraint
provider restricted-v2: .containers[0].runAsUser: Invalid value: 65532: must be in the ranges: [1000690000, 1000699999],
After adding customized configuration using EnvoyProxy as below, where the UID to be used for containers and pod are explictly set to be in acceptable range, the envoy container starts using the provided UID where as the shutdown-manager container still sticks to the default UID and the deployment still fails.
Repro steps:
Deploy a GatewayClass and Gateway in an environment with strict security policy in place. eg: Openshift cluster where UIDs to be used by containers are restricted to a certain range that does not include the default UID of 65532.
Logs:
Below errors seen while describing replica set for the failed deployment of GatewayClass and Gateway.
Warning FailedCreate 2m (x20 over 18m) replicaset-controller Error creating: pods "envoy-envoy-gateway-system-eg3-8902bb88-5f5fd5b4c4-" is forbidden: unable to validate against any security context constraint: [provider "anyuid": Forbidden: not usable by user or serviceaccount, provider restricted-v2: .containers[0].runAsUser: Invalid value: 65532: must be in the ranges: [1000690000, 1000699999],
Analysis:
After checking the source code, this seems to be a bug where the security context from container spec is taken into consideration only for the envoy container. Whereas for the shutdown manager, always default security context is set.
I guess we could reuse the logic in expectedEnvoySecurityContext method to use default ones only when there is nothing set in containerSpec.SecurityContext.
BTW, any possible workaround for temporary unblocking?
Description:
Deploying a GatewayClass and Gateway fails in Openshift cluster having strict security constraints in place.
After adding customized configuration using EnvoyProxy as below, where the UID to be used for containers and pod are explictly set to be in acceptable range, the envoy container starts using the provided UID where as the shutdown-manager container still sticks to the default UID and the deployment still fails.
Repro steps:
Deploy a GatewayClass and Gateway in an environment with strict security policy in place. eg: Openshift cluster where UIDs to be used by containers are restricted to a certain range that does not include the default UID of 65532.
Environment:
Envoy Gateway version: 1.2.3
Envoy version: 1.32.1
OCP version: 4.16.10
Kubernetes Version: v1.29.7+4510e9c
Logs:
Below errors seen while describing replica set for the failed deployment of GatewayClass and Gateway.
Analysis:
After checking the source code, this seems to be a bug where the security context from container spec is taken into consideration only for the envoy container. Whereas for the shutdown manager, always default security context is set.
gateway/internal/infrastructure/kubernetes/proxy/resource.go
Line 387 in 337e5ac
The text was updated successfully, but these errors were encountered: