Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP 19442: CloudAccountId must be a string #53

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
# Agent Chart settings (prom repo is to work around issue with chart-testing tool)
PROM_CHART_REPO: https://prometheus-community.github.io/helm-charts
CLUSTER_NAME: cz-node-agent-ci
CLOUD_ACCOUNT_ID: 00000000
CLOUD_ACCOUNT_ID: '00000000'
CZ_API_TOKEN: 'fake-api-token'
REGION: 'us-east-1'
run: |
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
# Agent Chart settings (prom repo is to work around issue with chart-testing tool)
PROM_CHART_REPO: https://prometheus-community.github.io/helm-charts
CLUSTER_NAME: cz-node-agent-ci
CLOUD_ACCOUNT_ID: 00000000
CLOUD_ACCOUNT_ID: '00000000'
CZ_API_TOKEN: ${{ secrets.CZ_API_TOKEN || 'fake-api-token' }}
REGION: 'us-east-1'
run: |
Expand Down
13 changes: 13 additions & 0 deletions charts/cloudzero-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.13]

### Fixed
- `cloudAccountId` must be a string, it cannot be an integer, due to issues with helm converting large integers to scientific notation.

## [0.0.12]

### Added
- Capture cluster status and perform validation on chart deployment
- Added release automation workflow

## [0.0.11]

### Added
- Moved validator to [dedicated repository](https://github.com/Cloudzero/cloudzero-agent-validator)
- Added validator as pod lifecycle hook (PostStart, PreStop) to track pod up/down transitions used to monitor data loss

Expand Down
2 changes: 1 addition & 1 deletion charts/cloudzero-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ This is preferable to including all labels with `*` because the performance impa
**Manditory Values**
| Key | Type | Default | Description |
|-------------------|--------|-----------------------|-------------------------------------------------------------------------------------------------------------------------|
| cloudAccountId | string | `nil` | Account ID in AWS or Subscription ID in Azure of the account the cluster is running in. |
| cloudAccountId | string | `nil` | Account ID in AWS or Subscription ID in Azure of the account the cluster is running in. Note: this must be a string, despite it being an integer in platforms such as AWS, due to limitations with helm. |
| clusterName | string | `nil` | Name of the cluster. Required to be RFC 1123 compliant. |
| host | string | `"api.cloudzero.com"` | CloudZero host to send metrics to. |
| apiKey | string | `nil` | The CloudZero API key to use to export metrics. Only used if `existingSecretName` is not set. |
Expand Down
2 changes: 1 addition & 1 deletion charts/cloudzero-agent/templates/cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ data:
{{- end}}
{{- end}}
remote_write:
- url: 'https://{{ .Values.host }}/v1/container-metrics?cluster_name={{.Values.clusterName}}&cloud_account_id={{.Values.cloudAccountId | toString}}&region={{.Values.region}}'
- url: 'https://{{ .Values.host }}/v1/container-metrics?cluster_name={{.Values.clusterName | urlquery}}&cloud_account_id={{.Values.cloudAccountId | urlquery}}&region={{.Values.region | urlquery}}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nice, I didn't know about that function

authorization:
credentials_file: /etc/config/prometheus/secrets/value
write_relabel_configs:
Expand Down
5 changes: 1 addition & 4 deletions charts/cloudzero-agent/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
"pattern": "^[a-zA-Z0-9](?:[a-zA-Z0-9.-]{0,253}[a-zA-Z0-9])?$"
},
"cloudAccountId": {
"type": [
"string",
"integer"
]
"type": "string"
},
"region": {
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion charts/cloudzero-agent/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -- CloudZero host to send metrics to.
host: api.cloudzero.com
# -- Account ID of the account the cluster is running in.
# -- Account ID of the account the cluster is running in. This must be a string - even if it is a number in your system.
cloudAccountId: null
# -- Name of the clusters.
clusterName: null
Expand Down