From 3e6900a1a84d90e61476bcca2b271ab7363bb4e7 Mon Sep 17 00:00:00 2001 From: Tao He Date: Wed, 29 Jun 2022 17:00:21 +0800 Subject: [PATCH] add support for csm-metrics-powerscale Add powerscale configuration to support csm-metrics-powerscale: - Add karavi-metrics-powerscale.yaml, karavi-metrics-powerscale.yaml; - Add pscale configuration to karavi-observability-configmap.yaml, values.yaml, cert-manager.yaml and NOTES.txt; - Rollback otel-collecter and nginxProxy image version to 0.42.0 and 1.20; - Rollback tls settings for otel in otel-collector-config.yaml. --- .../otel-collector-config.yaml | 3 +- .../karavi-observability/templates/NOTES.txt | 12 +++ ...vi-metrics-powerscale-service-account.yaml | 42 ++++++++++ .../templates/karavi-metrics-powerscale.yaml | 81 +++++++++++++++++++ .../karavi-observability-configmap.yaml | 23 ++++++ charts/karavi-observability/values.yaml | 37 ++++++++- 6 files changed, 195 insertions(+), 3 deletions(-) create mode 100644 charts/karavi-observability/templates/karavi-metrics-powerscale-service-account.yaml create mode 100644 charts/karavi-observability/templates/karavi-metrics-powerscale.yaml diff --git a/charts/karavi-observability/otel-collector-config.yaml b/charts/karavi-observability/otel-collector-config.yaml index ef7fcef3..382b9993 100644 --- a/charts/karavi-observability/otel-collector-config.yaml +++ b/charts/karavi-observability/otel-collector-config.yaml @@ -2,7 +2,8 @@ receivers: otlp: protocols: grpc: - tls_settings: + endpoint: 0.0.0.0:55680 + tls: cert_file: /etc/ssl/certs/tls.crt key_file: /etc/ssl/certs/tls.key diff --git a/charts/karavi-observability/templates/NOTES.txt b/charts/karavi-observability/templates/NOTES.txt index f241b75c..4dd10391 100644 --- a/charts/karavi-observability/templates/NOTES.txt +++ b/charts/karavi-observability/templates/NOTES.txt @@ -37,3 +37,15 @@ CSM Metrics for PowerStore From inside the Kubernetes cluster: otel-collector:8443 {{- end}} + +{{ if .Values.karaviMetricsPowerscale.enabled -}} + +CSM Metrics for PowerScale + + The CSM Metrics for PowerScale deployment has been successfully installed. + + Provisioner Names: {{ .Values.karaviMetricsPowerscale.provisionerNames }} + Prometheus Scrape Target: + From inside the Kubernetes cluster: otel-collector:8443 + +{{- end}} diff --git a/charts/karavi-observability/templates/karavi-metrics-powerscale-service-account.yaml b/charts/karavi-observability/templates/karavi-metrics-powerscale-service-account.yaml new file mode 100644 index 00000000..7f8a5bad --- /dev/null +++ b/charts/karavi-observability/templates/karavi-metrics-powerscale-service-account.yaml @@ -0,0 +1,42 @@ +{{ if .Values.karaviMetricsPowerscale.enabled }} + +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Release.Name }}-metrics-powerscale-controller + namespace: {{ .Release.Namespace }} + +--- + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ .Release.Name }}-metrics-powerscale-controller +rules: + - apiGroups: ["storage.k8s.io"] + resources: ["csinodes", "storageclasses"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["persistentvolumes", "nodes"] + verbs: ["list"] + - apiGroups: [""] + resources: ["endpoints"] + verbs: ["*"] + +--- + +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ .Release.Name }}-metrics-powerscale-controller +subjects: + - kind: ServiceAccount + name: {{ .Release.Name }}-metrics-powerscale-controller + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: {{ .Release.Name }}-metrics-powerscale-controller + apiGroup: rbac.authorization.k8s.io + +{{ end }} + diff --git a/charts/karavi-observability/templates/karavi-metrics-powerscale.yaml b/charts/karavi-observability/templates/karavi-metrics-powerscale.yaml new file mode 100644 index 00000000..7ab5f113 --- /dev/null +++ b/charts/karavi-observability/templates/karavi-metrics-powerscale.yaml @@ -0,0 +1,81 @@ +{{ if .Values.karaviMetricsPowerscale.enabled }} + +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/name: karavi-metrics-powerscale + app.kubernetes.io/instance: {{ .Release.Name }} + name: karavi-metrics-powerscale +spec: + type: {{ .Values.karaviMetricsPowerscale.service.type }} + ports: + - name: karavi-metrics-powerscale + port: 8080 + targetPort: 8080 + selector: + app.kubernetes.io/name: karavi-metrics-powerscale + app.kubernetes.io/instance: {{ .Release.Name }} + +--- + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: karavi-metrics-powerscale + labels: + app.kubernetes.io/name: karavi-metrics-powerscale + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: karavi-metrics-powerscale + app.kubernetes.io/instance: {{ .Release.Name }} + replicas: 1 + strategy: {} + template: + metadata: + labels: + app.kubernetes.io/name: karavi-metrics-powerscale + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + serviceAccount: {{ .Release.Name }}-metrics-powerscale-controller + containers: + - name: karavi-metrics-powerscale + image: {{ .Values.karaviMetricsPowerscale.image }} + resources: {} + env: + - name: POWERSCALE_METRICS_ENDPOINT + value: "{{ .Values.karaviMetricsPowerscale.endpoint }}" + - name: POWERSCALE_METRICS_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: TLS_ENABLED + value: "true" + volumeMounts: + - name: isilon-creds + mountPath: /isilon-creds + - name: tls-secret + mountPath: /etc/ssl/certs + readOnly: true + - name: karavi-metrics-powerscale-configmap + mountPath: /etc/config + volumes: + - name: isilon-creds + secret: + secretName: isilon-creds + - name: tls-secret + secret: + secretName: otel-collector-tls + items: + - key: tls.crt + path: cert.crt + - name: karavi-metrics-powerscale-configmap + configMap: + name: karavi-metrics-powerscale-configmap + restartPolicy: Always +status: {} + +{{ end }} + diff --git a/charts/karavi-observability/templates/karavi-observability-configmap.yaml b/charts/karavi-observability/templates/karavi-observability-configmap.yaml index 699db7af..0d0a7ca2 100644 --- a/charts/karavi-observability/templates/karavi-observability-configmap.yaml +++ b/charts/karavi-observability/templates/karavi-observability-configmap.yaml @@ -65,3 +65,26 @@ data: {{ end }} +--- + +{{ if .Values.karaviMetricsPowerscale.enabled }} + +apiVersion: v1 +kind: ConfigMap +metadata: + name: karavi-metrics-powerscale-configmap +data: + karavi-metrics-powerscale.yaml : | + COLLECTOR_ADDR: {{ .Values.karaviMetricsPowerscale.collectorAddr }} + PROVISIONER_NAMES: {{ .Values.karaviMetricsPowerscale.provisionerNames }} + POWERSCALE_VOLUME_IO_POLL_FREQUENCY: "{{ .Values.karaviMetricsPowerscale.volumePollFrequencySeconds }}" + POWERSCALE_VOLUME_METRICS_ENABLED: "{{ .Values.karaviMetricsPowerscale.volumeMetricsEnabled }}" + POWERSCALE_MAX_CONCURRENT_QUERIES: "{{ .Values.karaviMetricsPowerscale.concurrentPowerscaleQueries }}" + POWERSCALE_CLUSTER_POLL_FREQUENCY: "{{ .Values.karaviMetricsPowerscale.clusterPollFrequencySeconds }}" + POWERSCALE_ISICLIENT_INSECURE: "{{ .Values.karaviMetricsPowerscale.isiClientOptions.isiSkipCertificateValidation }}" + POWERSCALE_ISICLIENT_AUTH_TYPE: "{{ .Values.karaviMetricsPowerscale.isiClientOptions.isiAuthType }}" + POWERSCALE_ISICLIENT_VERBOSE: "{{ .Values.karaviMetricsPowerscale.isiClientOptions.isiLogVerbose }}" + LOG_LEVEL: "{{ .Values.karaviMetricsPowerscale.logLevel }}" + LOG_FORMAT: "{{ .Values.karaviMetricsPowerscale.logFormat }}" + +{{ end }} diff --git a/charts/karavi-observability/values.yaml b/charts/karavi-observability/values.yaml index 3ddf93d3..c3193694 100644 --- a/charts/karavi-observability/values.yaml +++ b/charts/karavi-observability/values.yaml @@ -78,12 +78,45 @@ karaviMetricsPowerstore: serviceName: metrics-powerstore probability: 0.0 +karaviMetricsPowerscale: + image: dellemc/csm-metrics-powerscale:nightly + enabled: true + collectorAddr: otel-collector:55680 + # comma separated list of provisioner names (ex: csi-isilon.dellemc.com) + provisionerNames: csi-isilon.dellemc.com + # set polling frequency to the PowerScale cluster to get metrics data + volumePollFrequencySeconds: 20 + clusterPollFrequencySeconds: 30 + # set volumeMetricsEnabled to "false" to disable collection of Volume metrics + volumeMetricsEnabled: "true" + # set clusterMetricsEnabled to "false" to disable collection of Cluster metrics + clusterMetricsEnabled: "true" + # set the the default max concurrent queries to PowerScale + concurrentPowerscaleQueries: 10 + # set the default endpoint for PowerScale service + endpoint: karavi-metrics-powerscale + service: + type: ClusterIP + logLevel: INFO + logFormat: text + # isiClientOptions to access Powerscale OneFS API server + isiClientOptions: + # set isiSkipCertificateValidation to true/false to skip/verify OneFS API server's certificates + # default isiSkipCertificateValidation: true to skip OneFS API server's certificates + isiSkipCertificateValidation: true + # set isiAuthType to 0/1 to enables session-based/basic Authentication + # default isiAuthType: 0 to use session-based Authentication + isiAuthType: 1 + # set isiLogVerbose to 0/1/2 decide High/Medium/Low content of the OneFS REST API message should be logged in debug level logs + # default isiLogVerbose: 0 to log full content of the HTTP request and response + isiLogVerbose: 0 + otelCollector: - image: otel/opentelemetry-collector:0.9.0 + image: otel/opentelemetry-collector:0.42.0 service: type: ClusterIP nginxProxy: - image: nginxinc/nginx-unprivileged:1.18 + image: nginxinc/nginx-unprivileged:1.20 cert-manager: startupapicheck: