Skip to content

Conversation

@shaoqin2
Copy link

addresses #27

Add the support for kuberay-apiserver to also install role/rolebinding in a list of namespaces like kuberay-operator. Did it slightly differently from kuberay-operator so the rules section of the RBAC is shared instead of repeated to reduce the possible drift between the two files

I verified that this change does not change helm output for existing usecase

helm template test .  > prechange.yaml
helm template --set singleNamespaceInstall=true test .  > prechange_single.yaml

Applied this patch

helm template test .  > postchange.yaml
helm template --set singleNamespaceInstall=true test .  > postchange_single.yaml

$ diff prechange.yaml postchange.yaml
# expected, my helm .Release.Namespace is default so it's just being explicitly specified now
16a17
>   namespace: default
67a69
>   namespace: default
151a154,159


$ diff prechange_single.yaml postchange_single.yaml
16a17
>   namespace: default
67a69
>   namespace: default
151a154,159

And finally test the multi namespace feature work

helm template --set singleNamespaceInstall=true --set "watchNamespace={n1,n2}" test .

# Source: kuberay-apiserver/templates/role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
...
  name: kuberay-apiserver
  namespace: n1

# Source: kuberay-apiserver/templates/role.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
...
  name: kuberay-apiserver
  namespace: n2

# Source: kuberay-apiserver/templates/rolebinding.yaml
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
...
  name: test-kuberay-apiserver
  namespace: n1

# Source: kuberay-apiserver/templates/rolebinding.yaml
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
...
  name: test-kuberay-apiserver
  namespace: n2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant