From 413925b4a91dd88e93952b051fefe854302d164f Mon Sep 17 00:00:00 2001 From: Ganga Mahesh Siddem Date: Sun, 3 Oct 2021 19:08:00 -0700 Subject: [PATCH 1/2] chart updates for rbac api version change --- .../templates/omsagent-crd.yaml | 2 +- .../templates/omsagent-daemonset-windows.yaml | 2 +- .../templates/omsagent-rbac.yaml | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/charts/azuremonitor-containers/templates/omsagent-crd.yaml b/charts/azuremonitor-containers/templates/omsagent-crd.yaml index bbaf89a52..46c5341cc 100644 --- a/charts/azuremonitor-containers/templates/omsagent-crd.yaml +++ b/charts/azuremonitor-containers/templates/omsagent-crd.yaml @@ -1,4 +1,4 @@ -{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion }} +{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }} apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: diff --git a/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml b/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml index 580ef9d15..f0f4b6e4f 100644 --- a/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml +++ b/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml @@ -32,7 +32,7 @@ spec: options: - name: ndots value: "3" -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.Version }} nodeSelector: kubernetes.io/os: windows {{- else }} diff --git a/charts/azuremonitor-containers/templates/omsagent-rbac.yaml b/charts/azuremonitor-containers/templates/omsagent-rbac.yaml index c0a6e3722..d9bca069d 100644 --- a/charts/azuremonitor-containers/templates/omsagent-rbac.yaml +++ b/charts/azuremonitor-containers/templates/omsagent-rbac.yaml @@ -10,7 +10,11 @@ metadata: heritage: {{ .Release.Service }} --- kind: ClusterRole +{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} +apiVersion: rbac.authorization.k8s.io/v1 +{{- else }} apiVersion: rbac.authorization.k8s.io/v1beta1 +{{- end }} metadata: name: omsagent-reader labels: @@ -33,7 +37,7 @@ rules: verbs: ["get", "create", "patch"] - nonResourceURLs: ["/metrics"] verbs: ["get"] -#arc k8s extension model grants access as part of the extension msi +#arc k8s extension model grants access as part of the extension msi #remove this explicit permission once the extension available in public preview {{- if (empty .Values.Azure.Extension.Name) }} - apiGroups: [""] @@ -43,7 +47,11 @@ rules: {{- end }} --- kind: ClusterRoleBinding +{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }} +apiVersion: rbac.authorization.k8s.io/v1 +{{- else }} apiVersion: rbac.authorization.k8s.io/v1beta1 +{{- end }} metadata: name: omsagentclusterrolebinding labels: From b2f3ef5f2fa7dcc19750da6c00dfa745ec756b56 Mon Sep 17 00:00:00 2001 From: Ganga Mahesh Siddem Date: Thu, 7 Oct 2021 11:52:13 -0700 Subject: [PATCH 2/2] include windows ds for arc --- .../templates/omsagent-daemonset-windows.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml b/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml index f0f4b6e4f..efed76f7d 100644 --- a/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml +++ b/charts/azuremonitor-containers/templates/omsagent-daemonset-windows.yaml @@ -1,4 +1,4 @@ -{{- if and (ne .Values.omsagent.secret.key "") (ne .Values.omsagent.secret.wsid "") (or (ne .Values.omsagent.env.clusterName "") (ne .Values.omsagent.env.clusterId ""))}} +{{- if and (ne .Values.omsagent.secret.key "") (ne .Values.omsagent.secret.wsid "") (or (ne .Values.omsagent.env.clusterName "") (ne .Values.omsagent.env.clusterId "") (ne .Values.Azure.Cluster.ResourceId "") )}} apiVersion: apps/v1 kind: DaemonSet metadata: