Skip to content

Commit 567705b

Browse files
Bregorvdice
authored andcommitted
RBAC support (#812)
Adds RBAC support for Workflow, see also: - deis/builder#513 - deis/controller#1292 - deis/fluentd#96 - deis/monitor#195 - deis/router#344
1 parent d71307f commit 567705b

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

charts/workflow/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ global:
6868
# In case of CNI you can not use `hostPort` notation due to https://github.com/kubernetes/kubernetes/issues/23920
6969
# registry_proxy_bind_addr: "80"
7070

71+
# Enable usage of RBAC authorization mode
72+
#
73+
# Valid values are:
74+
# - true: all RBAC-related manifests will be installed (in case your cluster supports RBAC)
75+
# - false: no RBAC-related manifests will be installed
76+
use_rbac: false
77+
7178

7279
s3:
7380
# Your AWS access key. Leave it empty if you want to use IAM credentials.

src/installing-workflow/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@ Client: &version.Version{SemVer:"v2.1.3", GitCommit:"5cbc48fb305ca4bf68c26eb8d2a
1919
Server: &version.Version{SemVer:"v2.1.3", GitCommit:"5cbc48fb305ca4bf68c26eb8d2a7eb363227e973", GitTreeState:"clean"}
2020
```
2121

22+
### Check Your Authorization
23+
24+
If your cluster uses [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/) for authorization, `helm` will need to be granted the necessary permissions to create Workflow resources.
25+
This can be done with the following commands:
26+
27+
```
28+
$ kubectl create sa tiller-deploy -n kube-system
29+
$ kubectl create clusterrolebinding helm --clusterrole=cluster-admin --serviceaccount=kube-system:tiller-deploy
30+
$ helm init --service-account=tiller-deploy
31+
```
32+
33+
If `helm` is already installed in cluster without sufficient rights, the only way for now is to reinstall it:
34+
35+
```
36+
$ kubectl delete deployment tiller-deploy -n kube-system
37+
$ kubectl create sa tiller-deploy -n kube-system
38+
$ kubectl create clusterrolebinding helm --clusterrole=cluster-admin --serviceaccount=kube-system:tiller-deploy
39+
$ helm init --service-account=tiller-deploy
40+
```
41+
42+
**Note**: Specific `helm` permissions haven't been sorted yet and details may change (watch `helm` [docs](https://github.com/kubernetes/helm/tree/master/docs))
43+
2244
## Choose Your Deployment Strategy
2345

2446
Deis Workflow includes everything it needs to run out of the box. However, these defaults are aimed at simplicity rather than

src/managing-workflow/production-deployments.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,22 @@ deis-router Deployment to run more than one router pod. This can be accomplished
6262
`kubectl --namespace=deis scale --replicas=2 deployment/deis-router`
6363

6464
## Using on-cluster registry with CNI
65+
6566
If you are using [CNI](https://github.com/containernetworking/cni) for managing container network, you cannot use `hostPort` notation due to [this issue](https://github.com/kubernetes/kubernetes/issues/23920).
6667
In this case you could enable CNI for `deis-registry-proxy` by setting `use_cni` variable to `true` inside `values.yaml` or by adding `--set global.use_cni=true` to `helm`'s args.
6768

69+
## Running Workflow with RBAC
70+
71+
If your cluster has [RBAC](https://kubernetes.io/docs/admin/authorization/rbac/) amongst your [authorization](https://kubernetes.io/docs/admin/authorization/) modes (`$ kubectl api-versions` should contains `rbac.authorization.k8s.io`) it may be necessary to enable RBAC in Workflow.
72+
This can be achieved by setting `use_rbac` in the `global` section of `values.yaml` to `true`, or by adding `--set=global.use_rbac=true` to the `$ helm install/upgrade` command.
73+
RBAC support was announced in Kubernetes-1.5 and is enabled by default if:
74+
- your Kubernetes cluster is in GKE
75+
- your Kubernetes cluster built with [kubeadm](https://kubernetes.io/docs/getting-started-guides/kubeadm/)
76+
77+
**Note**: helm may need to be given [specific permissions][helm specific permissions] under RBAC if not already done.
78+
79+
**Attention**: Azure ACS Kubernetes clusters are not RBAC-enabled for today due to lack in authentication strategy. Feel free to watch this [PR](https://github.com/kubernetes/kubernetes/pull/43987) for more details.
80+
6881
[configuring object storage]: ../installing-workflow/configuring-object-storage.md
6982
[customizing controller]: tuning-component-settings.md#customizing-the-controller
7083
[customizing monitor]: tuning-component-settings.md#customizing-the-monitor
@@ -74,3 +87,4 @@ In this case you could enable CNI for `deis-registry-proxy` by setting `use_cni`
7487
[platform ssl]: platform-ssl.md
7588
[registry]: ../understanding-workflow/components.md#registry
7689
[security considerations]: security-considerations.md
90+
[helm specific permissions]: ../installing-workflow/index.md#check-your-authorization

0 commit comments

Comments
 (0)