Skip to content

Commit

Permalink
Release 1.0.2-beta (#109)
Browse files Browse the repository at this point in the history
* CP-23051: Change default kube-state-metrics behavior to use Cloudzero subchart (#91)

* override KSM name

* enable ksm by default

* CP-23388: Define Static KubeStateMetrics Target Endpoint (#99)

* add 1.0.2 release doc file

---------

Co-authored-by: bdrennz <[email protected]>
  • Loading branch information
dmepham and bdrennz authored Nov 20, 2024
1 parent 3e074c2 commit 6d91d10
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 80 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/test-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,6 @@ jobs:
echo "SKIP_VALIDATIONS=true" >>${GITHUB_ENV}
fi
- name: TEST PREP - Update dependency path for local insights-controller testing
run: |
full_path=$(pwd)/charts/cloudzero-insights-controller
awk -v dir="$full_path" '
/name: cloudzero-insights-controller/ {flag=1}
flag && /repository:/ {sub(/repository: .*/, "repository: file://" dir); flag=0}
{print}
' charts/cloudzero-agent/Chart.yaml > temp.yaml && mv temp.yaml charts/cloudzero-agent/Chart.yaml
cd charts/cloudzero-insights-controller
helm dependency update
cd ../../
# Install the chart using our temporary image
- name: TEST - Install the chart
id: test_chart_installation
Expand Down
20 changes: 3 additions & 17 deletions charts/cloudzero-agent/BETA-INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,7 @@ There are two ways to install a beta version of the chart:
This method installs the latest beta version available.

```sh
helm install <RELEASE_NAME> cloudzero-beta/cloudzero-agent \
--devel \
--set existingSecretName=<NAME_OF_SECRET> \
--set clusterName=<CLUSTER_NAME> \
--set-string cloudAccountId=<CLOUD_ACCOUNT_ID> \
--set region=<REGION> \
--set kube-state-metrics.enabled=<true|false> \
--create-namespace
helm install <RELEASE_NAME> cloudzero-beta/cloudzero-agent -n <NAMESPACE> --create-namespace -f configuration.example.yaml --devel
```

- The `--devel` flag allows Helm to consider beta versions when resolving the chart version.
Expand All @@ -57,17 +50,10 @@ helm install <RELEASE_NAME> cloudzero-beta/cloudzero-agent \
If you want to install a specific beta version, specify it using the `--version` flag:

```sh
helm install <RELEASE_NAME> cloudzero-beta/cloudzero-agent \
--version <CHART_VERSION> \
--set existingSecretName=<NAME_OF_SECRET> \
--set clusterName=<CLUSTER_NAME> \
--set-string cloudAccountId=<CLOUD_ACCOUNT_ID> \
--set region=<REGION> \
--set kube-state-metrics.enabled=<true|false> \
--create-namespace
helm install <RELEASE_NAME> cloudzero-beta/cloudzero-agent -n <NAMESPACE> --create-namespace -f configuration.example.yaml --version <CHART_VERSION>
```

- Replace `<CHART_VERSION>` with the specific beta version (e.g., `0.0.29-beta`).
- Replace `<CHART_VERSION>` with the specific beta version (e.g., `1.0.0-beta`).
- This method does not require the `--devel` flag since you are explicitly specifying the version.

## Listing All Available Versions
Expand Down
6 changes: 3 additions & 3 deletions charts/cloudzero-agent/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ dependencies:
version: 5.15.3
- name: cloudzero-insights-controller
repository: https://cloudzero.github.io/cloudzero-charts/beta
version: 0.0.1
digest: sha256:87c19ba797e44296e4ac2433e17f24b73bcda8c9ee8b4286bc31c0d7fd0f0224
generated: "2024-11-13T12:34:06.381064+01:00"
version: 1.0.1-beta
digest: sha256:467fc1a751a584f61a9264a7f071209db408036baf45a62f061e34a444137e0f
generated: "2024-11-18T12:45:12.292096-05:00"
5 changes: 3 additions & 2 deletions charts/cloudzero-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ dependencies:
- name: kube-state-metrics
version: "5.15.*"
repository: https://prometheus-community.github.io/helm-charts
condition: kube-state-metrics.enabled
condition: kubeStateMetrics.enabled
alias: kubeStateMetrics
- name: cloudzero-insights-controller
version: "1.0.0-beta"
version: "1.0.1-beta"
repository: https://cloudzero.github.io/cloudzero-charts/beta
condition: cloudzero-insights-controller.enabled
alias: tags
3 changes: 1 addition & 2 deletions charts/cloudzero-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ For the latest release, see [Releases](https://github.com/Cloudzero/cloudzero-ch
- Helm 3+
- A CloudZero API key
- Each Kubernetes cluster must have a route to the internet and a rule that allows egress from the agent to the CloudZero collector endpoint at https://api.cloudzero.com on port 443
- A kube-state-metrics exporter running in the cluster, available via Kubernetes Service (see below for details)

## Installation

Expand Down Expand Up @@ -192,7 +191,7 @@ A common addition may be to pull the container images from custom image registri

`values-override.yaml`
```yaml
kube-state-metrics:
kubeStateMetrics:
enabled: true
image:
registry: my-custom-registry.io
Expand Down
51 changes: 9 additions & 42 deletions charts/cloudzero-agent/templates/cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ data:
scrape_interval: {{ .Values.prometheusConfig.globalScrapeInterval }}
scrape_configs:
{{- if .Values.prometheusConfig.scrapeJobs.kubeStateMetrics.enabled }}
- job_name: cloudzero-service-endpoints # kube_*, node_* metrics
honor_labels: true
- job_name: static-kube-state-metrics
honor_timestamps: true
track_timestamps_staleness: false
scrape_interval: {{ .Values.prometheusConfig.scrapeJobs.kubeStateMetrics.scrapeInterval }}
scrape_interval: 1m
scrape_timeout: 10s
scrape_protocols:
- OpenMetricsText1.0.0
Expand All @@ -34,38 +33,6 @@ data:
follow_redirects: true
enable_http2: true
relabel_configs:
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]
separator: ;
regex: "true"
replacement: $1
action: keep
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape_slow]
separator: ;
regex: "true"
replacement: $1
action: drop
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme]
separator: ;
regex: (https?)
target_label: __scheme__
replacement: $1
action: replace
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]
separator: ;
regex: (.+)
target_label: __metrics_path__
replacement: $1
action: replace
- source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]
separator: ;
regex: (.+?)(?::\d+)?;(\d+)
target_label: __address__
replacement: $1:$2
action: replace
- separator: ;
regex: __meta_kubernetes_service_annotation_prometheus_io_param_(.+)
replacement: __param_$1
action: labelmap
- separator: ;
regex: __meta_kubernetes_service_label_(.+)
replacement: $1
Expand All @@ -92,13 +59,13 @@ data:
- source_labels: [__name__]
regex: "^({{ join "|" .Values.kubeMetrics }})$"
action: keep
- action: labelkeep
regex: "^({{ include "cloudzero-agent.requiredMetricLabels" . }})$"
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
follow_redirects: true
enable_http2: true
- separator: ;
regex: ^(board_asset_tag|container|created_by_kind|created_by_name|image|instance|name|namespace|node|node_kubernetes_io_instance_type|pod|product_name|provider_id|resource|unit|uid|_.*|label_.*|app.kubernetes.io/*|k8s.*)$
replacement: $1
action: labelkeep
static_configs:
- targets:
- {{ printf "%s.%s.svc.cluster.local:%d" .Values.kubeStateMetrics.fullnameOverride .Release.Namespace (int .Values.kubeStateMetrics.service.port) }}
{{- end }}
{{- if .Values.prometheusConfig.scrapeJobs.cadvisor.enabled }}
- job_name: cloudzero-nodes-cadvisor # container_* metrics
Expand Down
3 changes: 2 additions & 1 deletion charts/cloudzero-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ tags:
patterns:
- '.*'

kube-state-metrics:
kubeStateMetrics:
enabled: true
fullnameOverride: "cloudzero-state-metrics"
nameOverride: "cloudzero-state-metrics"
# Disable CloudZero KSM as a Scrape Target since the service endpoint is explicity defined
# by the Validators config file.
prometheusScrape: false
Expand Down
2 changes: 1 addition & 1 deletion charts/cloudzero-insights-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: cloudzero-insights-controller
description: Provides telemetry to the CloudZero platform to enabling complex cost allocation and analysis.
type: application
version: 1.0.1-beta
appVersion: "0.0.1"
appVersion: "0.0.2"
dependencies:
- name: cert-manager
version: v1.15.3
Expand Down
13 changes: 13 additions & 0 deletions docs/releases/1.0.2-beta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## [1.0.2-beta](https://github.com/Cloudzero/cloudzero-agent/compare/v1.0.1-beta...v1.0.2-beta) (2024-11-20)

The internal `kube-state-metrics` is now renamed to `cloudzero-state-metrics`. It is enabled by default and set as a static target for the agent.

### Upgrade Steps
* Upgrade with:
```sh
helm upgrade --install <RELEASE_NAME> cloudzero-beta/cloudzero-agent -n <NAMESPACE> --create-namespace -f configuration.example.yaml --version 1.0.2-beta
```
See the [beta installation instructions](https://github.com/Cloudzero/cloudzero-charts/blob/develop/charts/cloudzero-agent/BETA-INSTALLATION.md) for further detail

### Improvements
* **CloudZero Metrics:** The `cloudzero-state-metrics` deployment is enabled/installed by default and set as a static target, improving reliability and performance.

0 comments on commit 6d91d10

Please sign in to comment.