Merge pull request #170 from stakater/fix-issue-169

Fix#169 - Update Rbac api versions
This commit is contained in:
Ahmed Waleed Malik
2020-10-20 09:33:08 +05:00
committed by GitHub
9 changed files with 29 additions and 4 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:
@@ -1,7 +1,7 @@
---
# Source: reloader/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
@@ -1,7 +1,7 @@
---
# Source: reloader/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
+2 -2
View File
@@ -1,7 +1,7 @@
---
# Source: reloader/templates/clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
@@ -46,7 +46,7 @@ rules:
---
# Source: reloader/templates/clusterrolebinding.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels: