Skip to content

Commit 12380f3

Browse files
committed
chore(k8s): k8s deprecated api migration
1 parent e06d9c5 commit 12380f3

5 files changed

Lines changed: 14 additions & 29 deletions

File tree

charts/monitor/templates/_helpers.tmpl

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{{- if (.Values.global.use_rbac) -}}
2-
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
32
# Define global role with the default system:aggregate-to-view cluster role and the two rules we just created
43
kind: ClusterRole
5-
apiVersion: {{ template "rbacAPIVersion" . }}
4+
apiVersion: rbac.authorization.k8s.io/v1
65
metadata:
76
name: drycc:drycc-monitor
87
aggregationRule:
@@ -13,4 +12,3 @@ aggregationRule:
1312
rbac.authorization.k8s.io/aggregate-to-view: "true"
1413
rules: [] # Rules are automatically filled in by the controller manager.
1514
{{- end -}}
16-
{{- end -}}

charts/monitor/templates/monitor-grafana-ingress.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: networking.k8s.io/v1beta1
1+
apiVersion: networking.k8s.io/v1
22
kind: Ingress
33
metadata:
44
name: "drycc-monitor-grafana"
@@ -17,14 +17,17 @@ spec:
1717
- host: drycc-monitor-grafana.{{ .Values.global.platform_domain }}
1818
http:
1919
paths:
20-
{{- if eq .Values.global.ingress_class "gce" "alb" }}
21-
- path: /*
22-
{{- else }}{{/* Has annotations but ingress class is not "gce" nor "alb" */}}
23-
- path: /
24-
{{- end }}
20+
- pathType: Prefix
21+
{{- if eq .Values.global.ingress_class "gce" "alb" }}
22+
path: /*
23+
{{- else }}{{/* Has annotations but ingress class is not "gce" nor "alb" */}}
24+
path: /
25+
{{- end }}
2526
backend:
26-
serviceName: drycc-monitor-grafana
27-
servicePort: 80
27+
service:
28+
name: drycc-monitor-grafana
29+
port:
30+
number: 80
2831
{{ if .Values.global.cert_manager_enabled }}
2932
tls:
3033
- secretName: drycc-monitor-grafana-auto-tls

charts/monitor/templates/monitor-telegraf-clusterrole.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{{- if (.Values.global.use_rbac) -}}
2-
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
32
kind: ClusterRole
4-
apiVersion: {{ template "rbacAPIVersion" . }}
3+
apiVersion: rbac.authorization.k8s.io/v1
54
metadata:
65
name: drycc:drycc-monitor-telegraf
76
labels:
@@ -16,4 +15,3 @@ rules:
1615
resources: ["pods", "persistentvolumes", "nodes", "nodes/proxy", "nodes/stats"]
1716
verbs: ["get", "list", "watch"]
1817
{{- end -}}
19-
{{- end -}}

charts/monitor/templates/monitor-telegraf-clusterrolebinding.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{{- if (.Values.global.use_rbac) -}}
2-
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
32
kind: ClusterRoleBinding
4-
apiVersion: {{ template "rbacAPIVersion" . }}
3+
apiVersion: rbac.authorization.k8s.io/v1
54
metadata:
65
name: drycc:drycc-monitor-telegraf
76
labels:
@@ -16,5 +15,4 @@ subjects:
1615
name: drycc-monitor-telegraf
1716
namespace: {{ .Release.Namespace }}
1817
{{- end -}}
19-
{{- end -}}
2018

0 commit comments

Comments
 (0)