Skip to content

Commit f10a28c

Browse files
suaas21tamalsaha
authored andcommitted
Remove --rbac flag (#761)
1 parent 1ab5470 commit f10a28c

File tree

9 files changed

+3
-50
lines changed

9 files changed

+3
-50
lines changed

chart/stash/README.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ The following table lists the configurable parameters of the Stash chart and the
5959
| `annotations` | Annotations applied to operator pod(s) | `{}` |
6060
| `nodeSelector` | Node labels for pod assignment | `{}` |
6161
| `tolerations` | Tolerations used pod assignment | `{}` |
62-
| `rbac.create` | If `true`, create and use RBAC resources | `true` |
6362
| `serviceAccount.create` | If `true`, create a new service account | `true` |
6463
| `serviceAccount.name` | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the fullname template | `` |
6564
| `apiserver.groupPriorityMinimum` | The minimum priority the group should have. | 10000 |
@@ -91,23 +90,4 @@ installing the chart. For example:
9190
$ helm install --name stash-operator --values values.yaml appscode/stash
9291
```
9392

94-
## RBAC
95-
By default the chart will not install the recommended RBAC roles and rolebindings.
9693

97-
You need to have the flag `--authorization-mode=RBAC` on the api server. See the following document for how to enable [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/).
98-
99-
To determine if your cluster supports RBAC, run the following command:
100-
101-
```console
102-
$ kubectl api-versions | grep rbac
103-
```
104-
105-
If the output contains "beta", you may install the chart with RBAC enabled (see below).
106-
107-
### Enable RBAC role/rolebinding creation
108-
109-
To enable the creation of RBAC resources (On clusters with RBAC). Do the following:
110-
111-
```console
112-
$ helm install --name stash-operator appscode/stash --set rbac.create=true
113-
```

chart/stash/templates/apiregistration.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ data:
6666
tls.key: {{ b64enc $cert.Key }}
6767
---
6868
{{- end }}
69-
{{ if .Values.rbac.create }}
7069
# to read the config for terminating authentication
7170
apiVersion: rbac.authorization.k8s.io/v1
7271
kind: RoleBinding
@@ -99,4 +98,3 @@ subjects:
9998
- kind: ServiceAccount
10099
name: {{ template "stash.serviceAccountName" . }}
101100
namespace: {{ .Release.Namespace }}
102-
{{ end }}

chart/stash/templates/cluster-role-binding.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{ if .Values.rbac.create }}
21
apiVersion: rbac.authorization.k8s.io/v1
32
kind: ClusterRoleBinding
43
metadata:
@@ -13,4 +12,3 @@ subjects:
1312
- kind: ServiceAccount
1413
name: {{ template "stash.serviceAccountName" . }}
1514
namespace: {{ .Release.Namespace }}
16-
{{ end }}

chart/stash/templates/cluster-role.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{ if .Values.rbac.create }}
21
apiVersion: rbac.authorization.k8s.io/v1
32
kind: ClusterRole
43
metadata:
@@ -86,4 +85,3 @@ rules:
8685
- roles
8786
- rolebindings
8887
verbs: ["get", "create", "delete", "patch"]
89-
{{ end }}

chart/stash/templates/deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ spec:
4444
args:
4545
- run
4646
- --v={{ .Values.logLevel }}
47-
- --rbac={{ .Values.rbac.create }}
4847
- --docker-registry={{ .Values.operator.registry }}
4948
- --secure-port=8443
5049
- --audit-log-path=-

chart/stash/templates/user-roles.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{ if .Values.rbac.create }}
21
apiVersion: rbac.authorization.k8s.io/v1
32
kind: ClusterRole
43
metadata:
@@ -45,4 +44,3 @@ rules:
4544
resources:
4645
- snapshots
4746
verbs: ["get", "list"]
48-
{{ end }}

chart/stash/values.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ tolerations: {}
5353
##
5454
affinity: {}
5555

56-
## Install Default RBAC roles and bindings
57-
rbac:
58-
# Specifies whether RBAC resources should be created
59-
create: true
60-
6156
serviceAccount:
6257
# Specifies whether a ServiceAccount should be created
6358
create: true

deploy/operator.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ spec:
2626
args:
2727
- run
2828
- --v=3
29-
- --rbac=${STASH_ENABLE_RBAC}
3029
- --docker-registry=${STASH_DOCKER_REGISTRY}
3130
- --secure-port=8443
3231
- --audit-log-path=-

deploy/stash.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ onessl_found || {
108108
export STASH_NAMESPACE=kube-system
109109
export STASH_SERVICE_ACCOUNT=stash-operator
110110
export STASH_SERVICE_NAME=stash-operator
111-
export STASH_ENABLE_RBAC=true
112111
export STASH_RUN_ON_MASTER=0
113112
export STASH_ENABLE_VALIDATING_WEBHOOK=false
114113
export STASH_ENABLE_MUTATING_WEBHOOK=false
@@ -160,7 +159,6 @@ show_help() {
160159
echo "options:"
161160
echo "-h, --help show brief help"
162161
echo "-n, --namespace=NAMESPACE specify namespace (default: kube-system)"
163-
echo " --rbac create RBAC roles and bindings (default: true)"
164162
echo " --docker-registry docker registry used to pull stash images (default: appscode)"
165163
echo " --image-pull-secret name of secret used to pull stash operator images"
166164
echo " --run-on-master run stash operator on master"
@@ -254,14 +252,6 @@ while test $# -gt 0; do
254252
fi
255253
shift
256254
;;
257-
--rbac*)
258-
val=$(echo $1 | sed -e 's/^[^=]*=//g')
259-
if [ "$val" = "false" ]; then
260-
export STASH_SERVICE_ACCOUNT=default
261-
export STASH_ENABLE_RBAC=false
262-
fi
263-
shift
264-
;;
265255
--run-on-master)
266256
export STASH_RUN_ON_MASTER=1
267257
shift
@@ -429,11 +419,9 @@ export TLS_SERVING_KEY=$(cat server.key | $ONESSL base64)
429419

430420
${SCRIPT_LOCATION}hack/deploy/operator.yaml | $ONESSL envsubst | kubectl apply -f -
431421

432-
if [ "$STASH_ENABLE_RBAC" = true ]; then
433-
${SCRIPT_LOCATION}hack/deploy/service-account.yaml | $ONESSL envsubst | kubectl apply -f -
434-
${SCRIPT_LOCATION}hack/deploy/rbac-list.yaml | $ONESSL envsubst | kubectl auth reconcile -f -
435-
${SCRIPT_LOCATION}hack/deploy/user-roles.yaml | $ONESSL envsubst | kubectl auth reconcile -f -
436-
fi
422+
${SCRIPT_LOCATION}hack/deploy/service-account.yaml | $ONESSL envsubst | kubectl apply -f -
423+
${SCRIPT_LOCATION}hack/deploy/rbac-list.yaml | $ONESSL envsubst | kubectl auth reconcile -f -
424+
${SCRIPT_LOCATION}hack/deploy/user-roles.yaml | $ONESSL envsubst | kubectl auth reconcile -f -
437425

438426
if [ "$STASH_RUN_ON_MASTER" -eq 1 ]; then
439427
kubectl patch deploy stash-operator -n $STASH_NAMESPACE \

0 commit comments

Comments
 (0)