From 72bbf7a7a02ba29a8bf169853d91741c8e17bdc8 Mon Sep 17 00:00:00 2001 From: gallacher <35462391+gallacher@users.noreply.github.com> Date: Fri, 26 Mar 2021 09:55:07 -0300 Subject: [PATCH] [karavi-observability] Helm chart changes to facilitate the Karavi Observability 0.3.0 release (#84) --- .github/workflows/charts-release-action.yml | 3 +- .github/workflows/helm-validations.yml | 3 +- charts/karavi-observability/Chart.yaml | 4 +- charts/karavi-observability/README.md | 2 +- charts/karavi-observability/VERSIONING.md | 40 ------------- .../karavi-observability/templates/NOTES.txt | 1 - .../templates/karavi-metrics-powerflex.yaml | 57 ++++--------------- .../karavi-observability-configmap.yaml | 25 ++++++++ .../templates/karavi-topology.yaml | 7 ++- charts/karavi-observability/values.yaml | 13 ++--- docs/CONTRIBUTING.md | 38 ++++++++++--- 11 files changed, 83 insertions(+), 110 deletions(-) delete mode 100644 charts/karavi-observability/VERSIONING.md create mode 100644 charts/karavi-observability/templates/karavi-observability-configmap.yaml diff --git a/.github/workflows/charts-release-action.yml b/.github/workflows/charts-release-action.yml index dc535a87..be7c9b3c 100644 --- a/.github/workflows/charts-release-action.yml +++ b/.github/workflows/charts-release-action.yml @@ -4,7 +4,8 @@ name: charts-release-action # Triggers the action on push/merge to the main branch on: push: - branches: [ main ] + branches: + - main jobs: # This job will perform a helm release of all the karavi charts that have been updated diff --git a/.github/workflows/helm-validations.yml b/.github/workflows/helm-validations.yml index 16197007..6ad17844 100644 --- a/.github/workflows/helm-validations.yml +++ b/.github/workflows/helm-validations.yml @@ -4,7 +4,8 @@ name: helm-validations # Check runs on PRs created to merge to main branch on: pull_request: - branches: [ main ] + branches: + - main jobs: # This job will check to see if any .yaml file is modified diff --git a/charts/karavi-observability/Chart.yaml b/charts/karavi-observability/Chart.yaml index 9b956b7a..29cd75ec 100644 --- a/charts/karavi-observability/Chart.yaml +++ b/charts/karavi-observability/Chart.yaml @@ -1,9 +1,9 @@ apiVersion: v2 -appVersion: "0.2.1" +appVersion: "0.3.0" name: karavi-observability description: Karavi Observability is part of the [Karavi](https://github.com/dell/karavi) open source suite of Kubernetes storage enablers for Dell EMC storage products. Karavi Observability provides Kubernetes administrators with visibility into metrics and topology data related to containerized storage. type: application -version: 0.2.1 +version: 0.3.0 dependencies: - name: cert-manager version: 1.1.0 diff --git a/charts/karavi-observability/README.md b/charts/karavi-observability/README.md index c3ea7831..6b2a638e 100644 --- a/charts/karavi-observability/README.md +++ b/charts/karavi-observability/README.md @@ -16,4 +16,4 @@ For complete deployment instructions, refer to the [Getting Started Guide](https ## Helm Chart Versioning -For an explanation and examples on versioning the Karavi Observability Helm chart, please see the [versioning document](./VERSIONING.md). +For an explanation and examples on versioning/releasing the Karavi Observability Helm chart, please see the [contributing guide](../../docs/CONTRIBUTING.md#helm-chart-release-strategy). diff --git a/charts/karavi-observability/VERSIONING.md b/charts/karavi-observability/VERSIONING.md deleted file mode 100644 index dd4808a7..00000000 --- a/charts/karavi-observability/VERSIONING.md +++ /dev/null @@ -1,40 +0,0 @@ - - -# Versioning - -To version the Karavi Observability Helm chart, follow the instructions below. - -1. [Create a branch](../../docs/CONTRIBUTING.md). -2. Update the [Chart.yaml](./Chart.yaml) file: - - - **Update the Helm Chart:** - If any changes are made in the Karavi Observability Helm chart, for instance when the [values.yaml](./values.yaml) file is modified, the chart version number must also be incremented. Consider the Chart.yaml below: - - ```yaml - apiVersion: v2 - name: karavi-observability - description: A Helm chart for Kubernetes - type: application - version: 0.1.0 - ``` - - Depending on the nature of the modifications as defined by [semantic versioning](http://semver.org), for example if they meet the requirements for a minor release, the new version of the Helm chart is incremented to `0.2.0`; the Chart.yaml becomes: - - ```yaml - apiVersion: v2 - name: karavi-observability - description: A Helm chart for Kubernetes - type: application - version: 0.2.0 # version updates to 0.2.0 - ``` - -3. Create and merge PR into main branch. -4. Github action will automatically make a new release given that there is a new chart version. The action packages and publishes an artifact, making it available for consumption. Given the example above, in either scenario, the GitHub action will produce a release called `karavi-observability-0.2.0`. diff --git a/charts/karavi-observability/templates/NOTES.txt b/charts/karavi-observability/templates/NOTES.txt index a9fd40c8..982c9fa8 100644 --- a/charts/karavi-observability/templates/NOTES.txt +++ b/charts/karavi-observability/templates/NOTES.txt @@ -14,7 +14,6 @@ Karavi Metrics for PowerFlex The Karavi Metrics for PowerFlex deployment has been successfully installed. - PowerFlex Endpoint: {{ .Values.karaviMetricsPowerflex.powerflexEndpoint }} Provisioner Names: {{ .Values.karaviMetricsPowerflex.provisionerNames }} Prometheus Scrape Target: From inside the Kubernetes cluster: otel-collector:8443 diff --git a/charts/karavi-observability/templates/karavi-metrics-powerflex.yaml b/charts/karavi-observability/templates/karavi-metrics-powerflex.yaml index 72b834b9..aa2f02fd 100644 --- a/charts/karavi-observability/templates/karavi-metrics-powerflex.yaml +++ b/charts/karavi-observability/templates/karavi-metrics-powerflex.yaml @@ -1,18 +1,3 @@ -{{- $powerflexUser := required "A valid PowerFlex user is required. Refer to the Helm Chart documentation." .Values.karaviMetricsPowerflex.powerflexUser }} -{{- $powerflexPassword := required "A valid PowerFlex password is required. Refer to the Helm Chart documentation." .Values.karaviMetricsPowerflex.powerflexPassword }} -{{- $powerflexEndpoint := required "A valid PowerFlex endpoint is required. Refer to the Helm Chart documentation." .Values.karaviMetricsPowerflex.powerflexEndpoint }} - -apiVersion: v1 -kind: Secret -metadata: - name: powerflex-gateway-credentials -type: Opaque -data: - username: {{ $powerflexUser }} - password: {{ $powerflexPassword }} - ---- - apiVersion: v1 kind: Service metadata: @@ -58,37 +43,7 @@ spec: image: {{ .Values.karaviMetricsPowerflex.image }} resources: {} env: - - name: COLLECTOR_ADDR - value: {{ .Values.karaviMetricsPowerflex.collectorAddr }} - - name: POWERFLEX_ENDPOINT - value: {{ $powerflexEndpoint }} - - name: POWERFLEX_USER - valueFrom: - secretKeyRef: - name: powerflex-gateway-credentials - key: username - - name: POWERFLEX_PASSWORD - valueFrom: - secretKeyRef: - name: powerflex-gateway-credentials - key: password - - name: PROVISIONER_NAMES - value: {{ .Values.karaviMetricsPowerflex.provisionerNames }} - - name: POWERFLEX_SDC_METRICS_ENABLED - value: "{{ .Values.karaviMetricsPowerflex.sdcMetricsEnabled }}" - - name: POWERFLEX_SDC_IO_POLL_FREQUENCY - value: "{{ .Values.karaviMetricsPowerflex.sdcPollFrequencySeconds }}" - - name: POWERFLEX_VOLUME_IO_POLL_FREQUENCY - value: "{{ .Values.karaviMetricsPowerflex.volumePollFrequencySeconds }}" - - name: POWERFLEX_VOLUME_METRICS_ENABLED - value: "{{ .Values.karaviMetricsPowerflex.volumeMetricsEnabled }}" - - name: POWERFLEX_STORAGE_POOL_METRICS_ENABLED - value: "{{ .Values.karaviMetricsPowerflex.storageClassPoolMetricsEnabled }}" - - name: POWERFLEX_STORAGE_POOL_POLL_FREQUENCY - value: "{{ .Values.karaviMetricsPowerflex.storageClassPoolPollFrequencySeconds }}" - - name: POWERFLEX_MAX_CONCURRENT_QUERIES - value: "{{ .Values.karaviMetricsPowerflex.concurrentPowerflexQueries }}" - - name: POWERFLEX_METRICS_ENDPOINT + - name: POWERFLEX_METRICS_ENDPOINT value: "{{ .Values.karaviMetricsPowerflex.endpoint }}" - name: POWERFLEX_METRICS_NAMESPACE valueFrom: @@ -97,15 +52,25 @@ spec: - name: TLS_ENABLED value: "true" volumeMounts: + - name: vxflexos-config + mountPath: /vxflexos-config - name: tls-secret mountPath: /etc/ssl/certs readOnly: true + - name: karavi-metrics-powerflex-configmap + mountPath: /etc/config volumes: + - name: vxflexos-config + secret: + secretName: vxflexos-config - name: tls-secret secret: secretName: otel-collector-tls items: - key: tls.crt path: cert.crt + - name: karavi-metrics-powerflex-configmap + configMap: + name: karavi-metrics-powerflex-configmap restartPolicy: Always status: {} diff --git a/charts/karavi-observability/templates/karavi-observability-configmap.yaml b/charts/karavi-observability/templates/karavi-observability-configmap.yaml new file mode 100644 index 00000000..eaf47c8b --- /dev/null +++ b/charts/karavi-observability/templates/karavi-observability-configmap.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: karavi-metrics-powerflex-configmap +data: + karavi-metrics-powerflex.yaml : | + COLLECTOR_ADDR: {{ .Values.karaviMetricsPowerflex.collectorAddr }} + PROVISIONER_NAMES: {{ .Values.karaviMetricsPowerflex.provisionerNames }} + POWERFLEX_SDC_METRICS_ENABLED: "{{ .Values.karaviMetricsPowerflex.sdcMetricsEnabled }}" + POWERFLEX_SDC_IO_POLL_FREQUENCY: "{{ .Values.karaviMetricsPowerflex.sdcPollFrequencySeconds }}" + POWERFLEX_VOLUME_IO_POLL_FREQUENCY: "{{ .Values.karaviMetricsPowerflex.volumePollFrequencySeconds }}" + POWERFLEX_VOLUME_METRICS_ENABLED: "{{ .Values.karaviMetricsPowerflex.volumeMetricsEnabled }}" + POWERFLEX_STORAGE_POOL_METRICS_ENABLED: "{{ .Values.karaviMetricsPowerflex.storageClassPoolMetricsEnabled }}" + POWERFLEX_STORAGE_POOL_POLL_FREQUENCY: "{{ .Values.karaviMetricsPowerflex.storageClassPoolPollFrequencySeconds }}" + POWERFLEX_MAX_CONCURRENT_QUERIES: "{{ .Values.karaviMetricsPowerflex.concurrentPowerflexQueries }}" + +--- + +apiVersion: v1 +kind: ConfigMap +metadata: + name: karavi-topology-configmap +data: + karavi-topology.yaml: | + PROVISIONER_NAMES: {{ .Values.karaviTopology.provisionerNames }} diff --git a/charts/karavi-observability/templates/karavi-topology.yaml b/charts/karavi-observability/templates/karavi-topology.yaml index f5851577..862da6d7 100644 --- a/charts/karavi-observability/templates/karavi-topology.yaml +++ b/charts/karavi-observability/templates/karavi-topology.yaml @@ -46,18 +46,21 @@ spec: path: localhost.crt - key: tls.key path: localhost.key + - name: karavi-topology-configmap + configMap: + name: karavi-topology-configmap serviceAccount: {{ .Release.Name }}-topology-controller containers: - name: karavi-topology image: {{ .Values.karaviTopology.image }} resources: {} env: - - name: PROVISIONER_NAMES - value: {{ .Values.karaviTopology.provisionerNames }} - name: PORT value: "8443" volumeMounts: - name: karavi-topology-secret-volume mountPath: "/certs" + - name: karavi-topology-configmap + mountPath: "/etc/config" restartPolicy: Always status: {} diff --git a/charts/karavi-observability/values.yaml b/charts/karavi-observability/values.yaml index 2a6adb1d..f4f1fe83 100644 --- a/charts/karavi-observability/values.yaml +++ b/charts/karavi-observability/values.yaml @@ -1,22 +1,17 @@ karaviTopology: - image: dellemc/karavi-topology:0.2.0-pre-release + image: dellemc/csm-topology:v0.3.0 # comma separated list of provisioner names (ex: csi-vxflexos.dellemc.com) provisionerNames: csi-vxflexos.dellemc.com service: type: ClusterIP karaviMetricsPowerflex: - powerflexEndpoint: - # base64 user and password - powerflexUser: - powerflexPassword: - - image: dellemc/karavi-metrics-powerflex:0.2.0-pre-release + image: dellemc/csm-metrics-powerflex:v0.3.0 collectorAddr: otel-collector:55680 # comma separated list of provisioner names (ex: csi-vxflexos.dellemc.com) provisionerNames: csi-vxflexos.dellemc.com # set sdcMetricsEnabled to "false" to disable collection of SDC metrics - sdc_metricsEnabled: "true" + sdcMetricsEnabled: "true" # set polling frequency to the PowerFlex array to get metrics data sdcPollFrequencySeconds: 10 volumePollFrequencySeconds: 10 @@ -38,4 +33,4 @@ otelCollector: service: type: ClusterIP nginxProxy: - image: nginx:1 + image: nginxinc/nginx-unprivileged:1.18 diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index cd2755e9..196ccb36 100755 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -32,6 +32,7 @@ Become one of the contributors to this project! We thrive to build a welcoming a - [Pull requests](#pull-requests) - [Code Reviews](#code-reviews) - [Code Quality](#code-quality) + - [Helm chart release strategy](#helm-chart-release-strategy) ## Become a contributor @@ -94,22 +95,21 @@ When you're ready to contribute, it's time to create a pull request. ## Branching Strategy -We are following a scaled trunk branching strategy where short-lived branches are created off of the main branch. When coding is complete, the branch is merged back into main after being approved in a pull request code review. +Updating a Helm chart will require a new branch. When updates are complete, the branch is merged back into the main branch after being approved in a pull request review. The frequency in which you merge branches into the main branch depends on how often you wish to release the Helm chart. Please see [Helm chart branching strategy](#helm-chart-release-strategy) for information on how merging a branch to the main branch will automatically release a Helm chart. ### Branch Naming Convention +Branch naming should be descriptive and align with a feature or bug fix. In order to align a branch with the feature or bug fix, use the GitHub issue ID whenever possible. + | Branch Type | Example | Comment | | ----------- | -------------------------------- | ---------------------------------------- | -| main | main | | -| Release | release-1.0 | hotfix: release-1.1 patch: release-1.0.1 | | Feature | feature-9-olp-support | "9" referring to GitHub issue ID | | Bug Fix | bugfix-110-remove-docker-compose | "110" referring to GitHub issue ID | ### Branch Types -- A Release branch is a branch created from the main branch used for releasing a Helm Chart version. Only critical bug fixes will be merged into this branch. - Bug Fix branch is a branch which is created for the purpose of fixing the given defect/issue. -- Feature branch is created for a feature development purpose. +- Feature branch is created for feature development ### Steps to create a branch for a bug fix or feature @@ -120,8 +120,6 @@ We are following a scaled trunk branching strategy where short-lived branches ar 5. Open a [pull request](#pull-requests) between your branch and the upstream main branch. 6. Once your pull request has merged, your branch can be deleted. -Release branches will be created from the main branch near the time of a planned release when all features are completed. Only critical bug fixes will be merged into the release branch at this time. All other bug fixes and features can continue to be merged into the main branch. When the release branch is stable, the branch will be tagged for release. - ## Signing your commits We require that developers sign off their commits to certify that they have permission to contribute the code in a pull request. This way of certifying is commonly known as the [Developer Certificate of Origin (DCO)](https://developercertificate.org/). We encourage all contributors to read the DCO text before signing a commit and making contributions. @@ -191,3 +189,29 @@ A pull request must satisfy following for it to be merged: - Maintainer must perform a code review and ensure there is no malicious code. - Maintainer must run a suite of tests that verify the quality of the code being submitted, and update the contributor if there are any failures. - If any commits are made after the PR has been approved, the PR approval will automatically be removed and the above process must happen again. + +## Helm chart release strategy + +It is important to understand that when a branch is merged into the main branch, a GitHub action will generate a new helm chart release if the helm chart version in the chart.yaml file has been incremented. Consider the following example where a change to the Helm chart has been made and the contributor wants a new version to be released: + +The original Chart.yaml file: + + ```yaml + apiVersion: v2 + name: karavi-observability + description: A Helm chart for Kubernetes + type: application + version: 0.1.0 + ``` + +If a modification to the Helm chart is made (an update to the values.yaml file for instance) the version in Chart.yaml is incremented to `0.2.0`: + + ```yaml + apiVersion: v2 + name: karavi-observability + description: A Helm chart for Kubernetes + type: application + version: 0.2.0 # version updates to 0.2.0 + ``` + +Once the associated branch is merged into the main branch, the GitHub action packages and publishes an artifact, making it available for consumption. The release name is based off the 'name' field and the 'version' field in the Chart.yaml file. Given the example above, GitHub action will produce a release called `karavi-observability-0.2.0`.