Update docs to reflect that Operator ClusterRoleBinding contains hardcoded namespace

- Added missing labels to Operator roles

Closes #42678

Signed-off-by: Ryan Emerson <remerson@ibm.com>
This commit is contained in:
Ryan Emerson 2025-09-19 16:27:26 +01:00 committed by GitHub
parent f9ec39bc5f
commit bda79de605
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 3 deletions

View File

@ -108,14 +108,24 @@ kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resourc
kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/{version}/kubernetes/keycloakrealmimports.k8s.keycloak.org-v1.yml
----
. Install the {project_name} Operator deployment by entering the following command:
. Install the {project_name} Operator deployment in the `keycloak` namespace by executing the following commands:
+
[source,bash,subs="attributes+"]
----
kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/{version}/kubernetes/kubernetes.yml
kubectl create namespace keycloak
kubectl -n keycloak apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/{version}/kubernetes/kubernetes.yml
----
The Operator will watch the namespace where it is installed. You may optionally select a namespace with the `-n` option.
The Operator will watch the namespace where it is installed. You may utilise a different namespace with the `-n` option,
however you must also update the `ClusterRoleBinding` subject. For example, to install in the namespace `custom-namespace`,
execute the following commands:
+
[source,bash,subs="attributes+"]
----
kubectl create namespace custom-namespace
kubectl -n custom-namespace apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/{version}/kubernetes/kubernetes.yml
kubectl patch clusterrolebinding keycloak-operator-clusterrole-binding --type='json' -p='[{"op": "replace", "path": "/subjects/0/namespace", "value":"custom-namespace"}]'
----
</@profile.ifCommunity>
=== Installing Multiple Operators

View File

@ -2,6 +2,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: keycloak-operator-role
labels:
app.kubernetes.io/name: keycloak-operator
rules:
- apiGroups:
- apps
@ -88,6 +90,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: keycloak-operator-clusterrole
labels:
app.kubernetes.io/name: keycloak-operator
rules:
- apiGroups:
- apiextensions.k8s.io