From ea8b658705a0718ba39e5e33c610826ad0301186 Mon Sep 17 00:00:00 2001 From: Suraiya Hameed <22776421+Suraiya-Hameed@users.noreply.github.com> Date: Mon, 24 Apr 2023 11:34:26 -0700 Subject: [PATCH] feat: expose metrics port (#1119) --- .../charts/csi-secrets-store-provider-azure/README.md | 1 + .../charts/csi-secrets-store-provider-azure/arc-values.yaml | 3 +++ .../templates/provider-azure-installer-windows.yaml | 6 +++++- .../templates/provider-azure-installer.yaml | 6 +++++- .../charts/csi-secrets-store-provider-azure/values.yaml | 3 +++ .../deployment/provider-azure-installer-windows.yaml | 4 ++++ manifest_staging/deployment/provider-azure-installer.yaml | 4 ++++ 7 files changed, 25 insertions(+), 2 deletions(-) diff --git a/manifest_staging/charts/csi-secrets-store-provider-azure/README.md b/manifest_staging/charts/csi-secrets-store-provider-azure/README.md index 018fb31af..ee5aa728e 100644 --- a/manifest_staging/charts/csi-secrets-store-provider-azure/README.md +++ b/manifest_staging/charts/csi-secrets-store-provider-azure/README.md @@ -148,3 +148,4 @@ The following table lists the configurable parameters of the csi-secrets-store-p | `rbac.pspEnabled` | If `true`, create and use a restricted pod security policy for Secrets Store CSI Driver AKV provider pod(s) | false | | `constructPEMChain` | Explicitly reconstruct the pem chain in the order: SERVER, INTERMEDIATE, ROOT | `true` | | `writeCertAndKeyInSeparateFiles` | Write cert and key in separate files. The individual files will be named as .crt and .key. These files will be created in addition to the single file. | `false` | +| `metricsAddr` | Port that serves metrics | `8898` | diff --git a/manifest_staging/charts/csi-secrets-store-provider-azure/arc-values.yaml b/manifest_staging/charts/csi-secrets-store-provider-azure/arc-values.yaml index 0f8c85bb3..d7f7b9086 100644 --- a/manifest_staging/charts/csi-secrets-store-provider-azure/arc-values.yaml +++ b/manifest_staging/charts/csi-secrets-store-provider-azure/arc-values.yaml @@ -193,3 +193,6 @@ Azure: # Arc monitoring arc: enableMonitoring: true + +# Port that serves metrics +metricsAddr: "8898" diff --git a/manifest_staging/charts/csi-secrets-store-provider-azure/templates/provider-azure-installer-windows.yaml b/manifest_staging/charts/csi-secrets-store-provider-azure/templates/provider-azure-installer-windows.yaml index 83a1aabc0..12031c18c 100644 --- a/manifest_staging/charts/csi-secrets-store-provider-azure/templates/provider-azure-installer-windows.yaml +++ b/manifest_staging/charts/csi-secrets-store-provider-azure/templates/provider-azure-installer-windows.yaml @@ -25,7 +25,7 @@ spec: {{- if .Values.enableArcExtension }} {{- if .Values.arc.enableMonitoring }} prometheus.io/scrape: "true" - prometheus.io/port: "8898" + prometheus.io/port: "{{ .Values.metricsAddr }}" {{- end }} {{- end }} {{- end }} @@ -76,6 +76,10 @@ spec: name: arc-proxy-config {{- end }} {{- end }} + ports: + - containerPort: {{ .Values.metricsAddr }} + name: metrics + protocol: TCP volumeMounts: - name: provider-vol mountPath: "C:\\provider" diff --git a/manifest_staging/charts/csi-secrets-store-provider-azure/templates/provider-azure-installer.yaml b/manifest_staging/charts/csi-secrets-store-provider-azure/templates/provider-azure-installer.yaml index cb222c5d3..ff531ff47 100644 --- a/manifest_staging/charts/csi-secrets-store-provider-azure/templates/provider-azure-installer.yaml +++ b/manifest_staging/charts/csi-secrets-store-provider-azure/templates/provider-azure-installer.yaml @@ -25,7 +25,7 @@ spec: {{- if .Values.enableArcExtension }} {{- if .Values.arc.enableMonitoring }} prometheus.io/scrape: "true" - prometheus.io/port: "8898" + prometheus.io/port: "{{ .Values.metricsAddr }}" {{- end }} {{- end }} # this will ensure pods are rolled in next helm upgrade if cert files are updated. @@ -76,6 +76,10 @@ spec: periodSeconds: 30 resources: {{ toYaml .Values.linux.resources | indent 12 }} + ports: + - containerPort: {{ .Values.metricsAddr }} + name: metrics + protocol: TCP securityContext: {{- if not .Values.linux.privileged }} allowPrivilegeEscalation: false diff --git a/manifest_staging/charts/csi-secrets-store-provider-azure/values.yaml b/manifest_staging/charts/csi-secrets-store-provider-azure/values.yaml index 321050195..a9b590785 100644 --- a/manifest_staging/charts/csi-secrets-store-provider-azure/values.yaml +++ b/manifest_staging/charts/csi-secrets-store-provider-azure/values.yaml @@ -176,3 +176,6 @@ constructPEMChain: true # Write cert and key in separate files. The individual files will be named as .crt and .key. These files will be created in addition to the single file. writeCertAndKeyInSeparateFiles: false + +# Port that serves metrics +metricsAddr: "8898" diff --git a/manifest_staging/deployment/provider-azure-installer-windows.yaml b/manifest_staging/deployment/provider-azure-installer-windows.yaml index 0e3812be8..3a172ff7d 100644 --- a/manifest_staging/deployment/provider-azure-installer-windows.yaml +++ b/manifest_staging/deployment/provider-azure-installer-windows.yaml @@ -46,6 +46,10 @@ spec: limits: cpu: 100m memory: 200Mi + ports: + - containerPort: 8898 + name: metrics + protocol: TCP volumeMounts: - mountPath: "C:\\provider" name: providervol diff --git a/manifest_staging/deployment/provider-azure-installer.yaml b/manifest_staging/deployment/provider-azure-installer.yaml index 5b0ddcceb..1a95222b0 100644 --- a/manifest_staging/deployment/provider-azure-installer.yaml +++ b/manifest_staging/deployment/provider-azure-installer.yaml @@ -47,6 +47,10 @@ spec: limits: cpu: 50m memory: 100Mi + ports: + - containerPort: 8898 + name: metrics + protocol: TCP securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true