-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow for the customization of user roles in Che provisioned namespaces #22146
Comments
No trivial, but it is possible even now:
ECLIPSE_CHE_NAMESPACE=eclipse-che
OPERATOR_NAMESPACE=eclipse-che
CHE_CLUSTER_NAME=eclipse-che
CUSTOM_ROLES_NAME=che-custom-roles
kubectl apply -f - <<EOF
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ${CUSTOM_ROLES_NAME}
labels:
app.kubernetes.io/part-of: che.eclipse.org
rules:
- verbs:
- '*'
apiGroups:
- cert-manager.io
resources:
- certificates
EOF
kubectl apply -f - <<EOF
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ${CUSTOM_ROLES_NAME}
labels:
app.kubernetes.io/part-of: che.eclipse.org
subjects:
- kind: ServiceAccount
name: che-operator
namespace: ${OPERATOR_NAMESPACE}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ${CUSTOM_ROLES_NAME}
EOF
kubectl patch checluster/${CHE_CLUSTER_NAME} --patch '{"spec": {"components": {"cheServer": {"clusterRoles": ["che-custom-roles"]}}}}' --type=merge -n ${ECLIPSE_CHE_NAMESPACE}
# ${ECLIPSE_CHE_NAMESPACE}-cheworkspaces-clusterrole and ${ECLIPSE_CHE_NAMESPACE}-cheworkspaces-devworkspace-clusterrole are defaults user's clusterrole
USER_CLUSTER_ROLES="${CUSTOM_ROLES_NAME},${ECLIPSE_CHE_NAMESPACE}-cheworkspaces-clusterrole,${ECLIPSE_CHE_NAMESPACE}-cheworkspaces-devworkspace-clusterrole"
kubectl patch checluster/eclipse-che --patch '{"spec": {"components": {"cheServer": {"extraProperties": {"CHE_INFRA_KUBERNETES_USER__CLUSTER__ROLES": "'${USER_CLUSTER_ROLES}'"}}}}}' --type=merge -n eclipse-che |
This PR [1] will avoid using step 4 |
@tolusha does it make sense to add a specific field in the CheCluster CRD rather then using che-server |
@l0rd [1] https://github.com/eclipse-che/che-operator/blob/main/api/v1/checluster_types.go#L130 |
I was assuming that user |
che-doc PR eclipse-che/che-docs#2590
Wait until the rollout of Che server components finishes. |
You guys rock! Thanks for the quick turnaround. :-) |
Is your enhancement related to a problem? Please describe
The permissions granted to a user on their Che provisioned namespace are not permissive enough to allow the user to create some objects in their namespace that might be needed for their development work.
For example: create Kafka or KafkaTopic CRs, create port-forward to access ports on pods (Kubedock needs this), etc...
Describe the solution you'd like
Allow for a
ClusterRole
to be specified in the CheCluster CR that gets applied to the user in the provisioned namespace.For example:
admin
,edit
, or custom ClusterRole.If not specified, then default to the current behavior.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: