diff --git a/.github/workflows/build-and-publish-beta-chart.yml b/.github/workflows/build-and-publish-beta-chart.yml index f7833384..e100445b 100644 --- a/.github/workflows/build-and-publish-beta-chart.yml +++ b/.github/workflows/build-and-publish-beta-chart.yml @@ -5,9 +5,8 @@ on: workflow_dispatch: inputs: version: - description: 'Version to use for the release (beta suffix will be automatically appended (e.g. "0.0.1" + "-beta"))' - required: false - default: '' + description: 'Version to use for the release. Must contain "beta" (e.g. "0.0.1-beta").' + required: true branch: description: 'Branch to use for the release' required: true @@ -54,18 +53,18 @@ jobs: - name: Package Cloudzero Agent Chart run: helm package charts/cloudzero-agent/ --destination .deploy - # Step 3: Determine Version - - name: Get Github Tag Version - id: version - uses: flatherskevin/semver-action@v1 - with: - incrementLevel: patch - source: tags - - - name: Determine Chart Version + # Step 3: Validate and Set Version + - name: Validate Input Version run: | - NEW_VERSION=${{ github.event.inputs.version || steps.version.outputs.nextVersion }} - echo "NEW_VERSION=$NEW_VERSION-beta" >> $GITHUB_ENV + if [[ -z "${{ github.event.inputs.version }}" ]]; then + echo "Version input is required." + exit 1 + fi + if [[ "${{ github.event.inputs.version }}" != *"beta"* ]]; then + echo "Version must contain 'beta'. Provided version: ${{ github.event.inputs.version }}" + exit 1 + fi + echo "NEW_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV - name: Update Chart Version run: | @@ -128,7 +127,6 @@ jobs: - name: Save Index in GH Pages run: | - # copy the new chart and index.yaml git add beta git commit -m "Updating ${{ env.NEW_VERSION }} Index" git push origin gh-pages diff --git a/charts/cloudzero-agent/README.md b/charts/cloudzero-agent/README.md index 63084c53..8881458d 100644 --- a/charts/cloudzero-agent/README.md +++ b/charts/cloudzero-agent/README.md @@ -17,14 +17,36 @@ For the latest release, see [Releases](https://github.com/Cloudzero/cloudzero-ch ## Installation -### Get Helm Repository Info +### Adding Helm Repository Information + +To use the chart or a beta version, you must add the repository to Helm. Refer to the [`helm repo`](https://helm.sh/docs/helm/helm_repo/) documentation for command details. + +#### 1. Add the Helm Chart Repository ```console helm repo add cloudzero https://cloudzero.github.io/cloudzero-charts -helm repo update +``` +> Note: If you intend to use a beta version, refer to the [beta installation document](./BETA-INSTALLATION.md) for the appropriate channel. + +#### 2. Add Repository Dependencies + +**Cert Manager** +```console +helm repo add cert-manager https://charts.jetstack.io ``` -_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._ +**Metrics Exporter** +```console +helm repo add prometheus-community https://prometheus-community.github.io/helm-charts +``` + +#### 3. Update the Helm Repositories + +Ensure that the most recent chart versions are available: + +```console +helm repo update +``` ### Install Helm Chart @@ -53,7 +75,6 @@ Alternatively, [install the cert-manager CRDs directly](https://cert-manager.io/ ```console kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.2/cert-manager.yaml ``` -Alternatively, [install the cert-manager CRDs directly](https://cert-manager.io/docs/installation/helm/). 3. Fill out all required fields in the `configuration.example.yaml` file in this directory. Rename the file as necessary. Below is an example of a completed configuration file: ```yaml diff --git a/charts/cloudzero-agent/docs/releases/1.0.0-beta-4.md b/charts/cloudzero-agent/docs/releases/1.0.0-beta-4.md new file mode 100644 index 00000000..ce5dd0d5 --- /dev/null +++ b/charts/cloudzero-agent/docs/releases/1.0.0-beta-4.md @@ -0,0 +1,13 @@ +## [1.0.0-beta-4](https://github.com/Cloudzero/cloudzero-agent/compare/v1.0.1-beta...v1.0.0-beta-4) (2024-12-12) + +The Insights controller now exposes a Prometheus Metrics endpoint, enabling CloudZero to monitor its operations. + +### Upgrade Steps +* Upgrade with: +```sh +helm upgrade --install cloudzero-beta/cloudzero-agent -n --create-namespace -f configuration.example.yaml --version 1.0.0-beta-1 +``` +For more details, see the [beta installation instructions](https://github.com/Cloudzero/cloudzero-charts/blob/develop/charts/cloudzero-agent/BETA-INSTALLATION.md). + +### Improvements +* Added insights controller scrape configuration for operational monitoring. More information is available in the [insights controller documentation](https://github.com/Cloudzero/cloudzero-insights-controller/blob/develop/docs/statistics.md). diff --git a/charts/cloudzero-agent/templates/cm.yaml b/charts/cloudzero-agent/templates/cm.yaml index 3b063962..35f93d00 100644 --- a/charts/cloudzero-agent/templates/cm.yaml +++ b/charts/cloudzero-agent/templates/cm.yaml @@ -118,11 +118,30 @@ data: kubeconfig_file: "" follow_redirects: true enable_http2: true - {{- end }} - {{- if .Values.prometheusConfig.scrapeJobs.additionalScrapeJobs -}} - {{ toYaml .Values.prometheusConfig.scrapeJobs.additionalScrapeJobs | toString | nindent 6 }} - {{- end}} - {{- end}} + {{- end }} + {{- if .Values.insightsController.enabled }} + - job_name: cloudzero-insights-controller-job + metrics_path: /metrics + scheme: https + enable_compression: true + tls_config: + insecure_skip_verify: true + follow_redirects: true + enable_http2: true + kubernetes_sd_configs: + - role: endpoints + kubeconfig_file: "" + follow_redirects: true + enable_http2: true + relabel_configs: + - source_labels: [__meta_kubernetes_endpoints_name] + action: keep + regex: {{ include "cloudzero-agent.insightsController.server.webhookFullname" . }}-svc + {{- end }} + {{- if .Values.prometheusConfig.scrapeJobs.additionalScrapeJobs -}} + {{ toYaml .Values.prometheusConfig.scrapeJobs.additionalScrapeJobs | toString | nindent 6 }} + {{- end}} + {{- end}} remote_write: - url: 'https://{{ include "cloudzero-agent.cleanString" .Values.host }}/v1/container-metrics?cluster_name={{ include "cloudzero-agent.cleanString" .Values.clusterName | urlquery }}&cloud_account_id={{ include "cloudzero-agent.cleanString" .Values.cloudAccountId | urlquery }}®ion={{ include "cloudzero-agent.cleanString" .Values.region | urlquery }}' authorization: diff --git a/charts/cloudzero-agent/values.yaml b/charts/cloudzero-agent/values.yaml index ed9b49ba..ba3719fd 100644 --- a/charts/cloudzero-agent/values.yaml +++ b/charts/cloudzero-agent/values.yaml @@ -159,7 +159,7 @@ insightsController: replicaCount: 3 image: repository: ghcr.io/cloudzero/cloudzero-insights-controller/cloudzero-insights-controller - tag: 0.0.2 + tag: 0.0.3 pullPolicy: Always tls: enabled: true