Skip to content

Commit

Permalink
fix: stop using rbac v1beta1 (#1761)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Ryu authored Feb 8, 2022
1 parent ee46a9e commit 61fef6a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ metadata:
name: tke-audit-api
namespace: tke
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
Expand All @@ -35,7 +35,7 @@ rules:
resourceNames: ["tke-audit-api"]
verbs: ["get", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
annotations:
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/zh-CN/QuickStart/快速入门.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ TKEStack 还可以通过此处的蓝色按钮:**【新建独立集群】**和*

```yaml
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: admin
annotations:
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/zh-CN/best-practices/jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ metadata:
---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: jenkins2
rules:
Expand All @@ -189,7 +189,7 @@ rules:
verbs: ["get"]

---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: jenkins2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ spec:
path: /var/lib/filebeat-data
type: DirectoryOrCreate
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: filebeat
Expand All @@ -165,7 +165,7 @@ roleRef:
name: filebeat
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: filebeat
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/zh-CN/products/platform/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ TKEStack还可以另外**新建独立集群**以及**导入已有集群**实现*
```yaml
cat <<EOF | kubectl apply -f -
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: admin
annotations:
Expand Down
11 changes: 6 additions & 5 deletions pkg/monitor/controller/prometheus/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"strings"
"sync"
"time"

"tkestack.io/tke/pkg/platform/util/addon"

"github.com/coreos/prometheus-operator/pkg/apis/monitoring"
Expand Down Expand Up @@ -965,7 +966,7 @@ func serviceAccountPrometheusOperator() *corev1.ServiceAccount {
func clusterRolePrometheusOperator() *rbacv1.ClusterRole {
return &rbacv1.ClusterRole{
TypeMeta: metav1.TypeMeta{
APIVersion: "rbac.authorization.k8s.io/v1beta1",
APIVersion: "rbac.authorization.k8s.io/v1",
Kind: "ClusterRole",
},
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -1171,7 +1172,7 @@ func serviceAccountPrometheus() *corev1.ServiceAccount {
func clusterRolePrometheus() *rbacv1.ClusterRole {
return &rbacv1.ClusterRole{
TypeMeta: metav1.TypeMeta{
APIVersion: "rbac.authorization.k8s.io/v1beta1",
APIVersion: "rbac.authorization.k8s.io/v1",
Kind: "ClusterRole",
},
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -1763,7 +1764,7 @@ func createServiceAccountForMetrics() *corev1.ServiceAccount {
func createClusterRoleForMetrics() *rbacv1.ClusterRole {
return &rbacv1.ClusterRole{
TypeMeta: metav1.TypeMeta{
APIVersion: "rbac.authorization.k8s.io/v1beta1",
APIVersion: "rbac.authorization.k8s.io/v1",
Kind: "ClusterRole",
},
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -1864,7 +1865,7 @@ func createClusterRoleBindingForMetrics() *rbacv1.ClusterRoleBinding {
func createRoleForMetrics() *rbacv1.Role {
return &rbacv1.Role{
TypeMeta: metav1.TypeMeta{
APIVersion: "rbac.authorization.k8s.io/v1beta1",
APIVersion: "rbac.authorization.k8s.io/v1",
Kind: "Role",
},
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -2434,7 +2435,7 @@ func createServiceAccountForNPD() *corev1.ServiceAccount {
func createClusterRoleForNPD() *rbacv1.ClusterRole {
return &rbacv1.ClusterRole{
TypeMeta: metav1.TypeMeta{
APIVersion: "rbac.authorization.k8s.io/v1beta1",
APIVersion: "rbac.authorization.k8s.io/v1",
Kind: "ClusterRole",
},
ObjectMeta: metav1.ObjectMeta{
Expand Down

0 comments on commit 61fef6a

Please sign in to comment.