Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
update Role,ClusterRole,..Bindings to v1
Browse files Browse the repository at this point in the history
In Kubernetes 1.22.0, along with beta CRD, the rbac.authorization.k8s.io
v1beta1 api group has been deprecated and finally removed. This update
allows Flux to be installed there. It is a breaking change, and leaves
versions of Kubernetes <1.8 behind.

(The CRD v1 change already leaves Kubernetes <1.16 behind, so...)

Signed-off-by: Kingdon Barrett <yebyen@gmail.com>
  • Loading branch information
yebyen committed Jun 22, 2021
1 parent 6e5813e commit 5817505
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions chart/flux/templates/rbac-role.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if and .Values.rbac.create (eq .Values.clusterRole.create false) -}}
{{- range $namespace := (append .Values.allowedNamespaces .Release.Namespace) }}
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "flux.fullname" $ }}
Expand All @@ -18,7 +18,7 @@ rules:
verbs:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "flux.fullname" $ }}
Expand All @@ -38,7 +38,7 @@ subjects:
kind: ServiceAccount
---
{{- end }}
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "flux.fullname" . }}-crd
Expand All @@ -62,7 +62,7 @@ rules:
verbs:
- list
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "flux.fullname" . }}
Expand Down
4 changes: 2 additions & 2 deletions chart/flux/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.rbac.create -}}
{{if .Values.clusterRole.create -}}
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "flux.clusterRoleName" . }}
Expand All @@ -23,7 +23,7 @@ rules:
{{- end -}}
{{- if or .Values.clusterRole.create .Values.clusterRole.name }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ template "flux.clusterRoleName" . }}
Expand Down
4 changes: 2 additions & 2 deletions deploy/flux-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
name: flux
namespace: flux
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
Expand All @@ -22,7 +22,7 @@ rules:
- nonResourceURLs: ['*']
verbs: ['*']
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
Expand Down

0 comments on commit 5817505

Please sign in to comment.