-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardcoded runAsUser and runAsGroup Values in Helm Chart Cause Deployment Failures on OpenShift #2664
Labels
Comments
After adjusting the $ oc get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
gateway-api-admission-server 1/1 1 1 65m
wso2-apk-cert-manager 1/1 1 1 18h
wso2-apk-cert-manager-cainjector 1/1 1 1 18h
wso2-apk-cert-manager-webhook 1/1 1 1 18h
wso2-apk-wso2-apk-adapter-deployment 1/1 1 1 18h
wso2-apk-wso2-apk-common-controller-deployment 1/1 1 1 18h
wso2-apk-wso2-apk-config-ds-deployment 1/1 1 1 18h
wso2-apk-wso2-apk-gateway-runtime-deployment 2/2 2 2 18h
wso2-apk-wso2-apk-ratelimiter-deployment 2/2 2 2 18h $ oc describe deploy gateway-api-admission-server
Name: gateway-api-admission-server
Namespace: wso2-apk
CreationTimestamp: Fri, 06 Dec 2024 12:24:04 +0100
Labels: app.kubernetes.io/managed-by=Helm
name=gateway-api-admission-server
Annotations: deployment.kubernetes.io/revision: 2
meta.helm.sh/release-name: wso2-apk
meta.helm.sh/release-namespace: wso2-apk
Selector: name=gateway-api-admission-server
Replicas: 1 desired | 1 updated | 1 total | 1 available | 0 unavailable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 25% max unavailable, 25% max surge
Pod Template:
Labels: name=gateway-api-admission-server
Containers:
webhook:
Image: registry.k8s.io/gateway-api/admission-server:v1.0.0
Port: 8443/TCP
Host Port: 0/TCP
SeccompProfile: RuntimeDefault
Args:
-logtostderr
--tlsCertFile=/etc/certs/cert
--tlsKeyFile=/etc/certs/key
-v=10
2>&1
Limits:
cpu: 100m
memory: 50Mi
Requests:
cpu: 100m
memory: 50Mi
Environment: <none>
Mounts:
/etc/certs from webhook-certs (ro)
Volumes:
webhook-certs:
Type: Secret (a volume populated by a Secret)
SecretName: gateway-api-admission
Optional: false
Conditions:
Type Status Reason
---- ------ ------
Available True MinimumReplicasAvailable
Progressing True NewReplicaSetAvailable
OldReplicaSets: gateway-api-admission-server-7998dfb48 (0/0 replicas created)
NewReplicaSet: gateway-api-admission-server-fdbbcd5db (1/1 replicas created)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 66m deployment-controller Scaled up replica set gateway-api-admission-server-7998dfb48 to 1
Normal ScalingReplicaSet 51s deployment-controller Scaled up replica set gateway-api-admission-server-fdbbcd5db to 1
Normal ScalingReplicaSet 47s deployment-controller Scaled down replica set gateway-api-admission-server-7998dfb48 to 0 from 1 $ oc get pod
NAME READY STATUS RESTARTS AGE
gateway-api-admission-2j2c4 0/1 Completed 0 67m
gateway-api-admission-patch-r7hqf 0/1 Completed 1 67m
gateway-api-admission-server-fdbbcd5db-zhw66 1/1 Running 0 62s
redis-master-0 1/1 Running 0 18h
wso2-apk-cert-manager-5dc6b554f6-vvg2h 1/1 Running 0 18h
wso2-apk-cert-manager-cainjector-c9bd4c4f6-qnxcn 1/1 Running 0 18h
wso2-apk-cert-manager-webhook-7f5c7d4967-8jt5v 1/1 Running 0 18h
wso2-apk-wso2-apk-adapter-deployment-6c5bd8fbd9-rvrdp 1/1 Running 0 18h
wso2-apk-wso2-apk-common-controller-deployment-d6577c8c6-tlm5p 1/1 Running 0 15h
wso2-apk-wso2-apk-config-ds-deployment-7888979585-c5rzr 1/1 Running 0 18h
wso2-apk-wso2-apk-gateway-runtime-deployment-79b7f67f78-v2588 2/2 Running 0 16h
wso2-apk-wso2-apk-gateway-runtime-deployment-79b7f67f78-zpcv9 2/2 Running 0 16h
wso2-apk-wso2-apk-ratelimiter-deployment-6d45479664-9rd9c 1/1 Running 3 (18h ago) 18h
wso2-apk-wso2-apk-ratelimiter-deployment-6d45479664-hkrw7 1/1 Running 3 (18h ago) 18h These outputs confirm that the deployment is now functioning as expected and that my above arguments are valid. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I am encountering deployment issues with the WSO2 API Platform for Kubernetes (APK) on OpenShift due to hardcoded
runAsUser
andrunAsGroup
values in the Helm chart, specifically within thegateway-api-admission-server
deployment template. OpenShift assigns user IDs (UIDs) and group IDs (GIDs) dynamically for security reasons, and specifying these values explicitly in the container's security context leads to permission conflicts.Error Message:
Steps to Reproduce
Analysis:
The deployment template includes the following security context:
In OpenShift, the assigned UID range for the project is
1001280000/10000
, causing the hardcodedrunAsUser: 65532
andrunAsGroup: 65532
to fall outside the permissible range, resulting in deployment failures.Suggested Solution:
To ensure compatibility with OpenShift's dynamic UID and GID assignment, I recommend the following modifications to the Helm chart:
Remove Hardcoded Values: Eliminate the explicit
runAsUser
andrunAsGroup
settings from the security context in the deployment templates.Utilize Service Accounts: Define a service account for the deployment and allow OpenShift's Security Context Constraints (SCC) to assign appropriate UIDs and GIDs dynamically.
Make Security Context Configurable: Introduce Helm chart values that allow users to optionally specify
runAsUser
andrunAsGroup
if needed, defaulting to dynamic assignment when not set.Proposed Deployment Template Adjustment:
Proposed Helm Values Addition:
By implementing these changes, the deployment will be more adaptable to environments like OpenShift, which manage security contexts dynamically, thereby preventing permission issues and facilitating smoother deployments.
Thank you for your attention to this matter.
Affected Component
Adapter
Version
1.2.0
Environment Details (with versions)
OpenShift version: 4.16.18
Kubernetes version: v1.29.8+632b078
Channel: stable-4.16
Relevant Log Output
Related Issues
No response
Suggested Labels
APK SCC Openshift gateway-api-admission-server Helm
The text was updated successfully, but these errors were encountered: