Add support for legacy rbac

Signed-off-by: faizanahmad055 <faizan.ahmad55@outlook.com>
This commit is contained in:
faizanahmad055
2020-10-19 16:00:54 +02:00
parent 6a0dfd3ce0
commit faf27c2d5d
6 changed files with 25 additions and 0 deletions
+7
View File
@@ -22,6 +22,7 @@ Reloader can watch changes in `ConfigMap` and `Secret` and do rolling upgrades o
## Compatibility
Reloader is compatible with kubernetes >= 1.9
The `apiVersion: rbac.authorization.k8s.io/v1beta1` is depreciated since kubernetes = 1.17. To run it with older versions, please use the chart parameter `reloader.legacy.rbac=true`
## How to use Reloader
@@ -201,6 +202,12 @@ helm repo update
helm install stakater/reloader
```
**Note:** The latest verion of reloader is using `apiVersion: rbac.authorization.k8s.io/v1` for rbac. The `apiVersion: rbac.authorization.k8s.io/v1beta1` is depreciated since kubernetes = 1.17. To run it with older versions, please use below command.
```bash
helm install stakater/reloader --set reloader.legacy.rbac=true
```
**Note:** By default reloader watches in all namespaces. To watch in single namespace, please run following command. It will install reloader in `test` namespace which will only watch `Deployments`, `Daemonsets` and `Statefulsets` in `test` namespace.
```bash
@@ -1,5 +1,9 @@
{{- if and .Values.reloader.watchGlobally (.Values.reloader.rbac.enabled) }}
{{- if and .Values.reloader.legacy.rbac }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{ else }}
apiVersion: rbac.authorization.k8s.io/v1
{{- end }}
kind: ClusterRole
metadata:
labels:
@@ -1,5 +1,9 @@
{{- if and .Values.reloader.watchGlobally (.Values.reloader.rbac.enabled) }}
{{- if and .Values.reloader.legacy.rbac }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{ else }}
apiVersion: rbac.authorization.k8s.io/v1
{{- end }}
kind: ClusterRoleBinding
metadata:
labels:
@@ -1,5 +1,9 @@
{{- if and (not (.Values.reloader.watchGlobally)) (.Values.reloader.rbac.enabled) }}
{{- if and .Values.reloader.legacy.rbac }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{ else }}
apiVersion: rbac.authorization.k8s.io/v1
{{- end }}
kind: Role
metadata:
labels:
@@ -1,5 +1,9 @@
{{- if and (not (.Values.reloader.watchGlobally)) (.Values.reloader.rbac.enabled) }}
{{- if and .Values.reloader.legacy.rbac }}
apiVersion: rbac.authorization.k8s.io/v1beta1
{{ else }}
apiVersion: rbac.authorization.k8s.io/v1
{{- end }}
kind: RoleBinding
metadata:
labels:
@@ -17,6 +17,8 @@ reloader:
watchGlobally: true
# Set to true if you have a pod security policy that enforces readOnlyRootFilesystem
readOnlyRootFileSystem: false
legacy:
rbac: false
matchLabels: {}
deployment:
nodeSelector: