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 23, 2024
1 parent ab96f9a commit ed95269
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/test-helm-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: Helm Testdata Sample
on:
push:
paths:
- 'testdata/project-v4-with-plugins/**'
- '.github/workflows/test-helm-samples.yml'
- "testdata/project-v4-with-plugins/**"
- ".github/workflows/test-helm-samples.yml"
pull_request:
paths:
- 'testdata/project-v4-with-plugins/**'
- '.github/workflows/test-helm-samples.yml'
- "testdata/project-v4-with-plugins/**"
- ".github/workflows/test-helm-samples.yml"

jobs:
helm-test-project-v4-with-plugins:
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
go-version: "~1.22"

- name: Install the latest version of kind
run: |
Expand Down Expand Up @@ -55,6 +55,12 @@ jobs:
run: |
helm lint testdata/project-v4-with-plugins/dist/chart
- 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
- name: Install cert-manager via Helm
run: |
helm repo add jetstack https://charts.jetstack.io
Expand All @@ -69,8 +75,12 @@ jobs:
- name: Install Helm chart for project-v4-with-plugins
run: |
helm install my-release testdata/project-v4-with-plugins/dist/chart --create-namespace --namespace project-v4-with-plugins-system
helm install my-release testdata/project-v4-with-plugins/dist/chart --create-namespace --namespace project-v4-with-plugins-system --set prometheus.enable=true
- name: Check Helm release status
run: |
helm status my-release --namespace project-v4-with-plugins-system
- name: Check Presence of ServiceMonitor
run: |
kubectl wait --namespace project-v4-with-plugins-system --for=jsonpath='{.kind}'=ServiceMonitor servicemonitor/project-v4-with-plugins-controller-manager-metrics-monitor
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Install Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: Verify Helm installation
run: helm version
Expand All @@ -92,6 +92,12 @@ jobs:
run: |
helm lint ./dist/chart
- 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 All @@ -118,9 +124,13 @@ jobs:
- name: Install Helm chart for project
run: |
helm install my-release ./dist/chart --create-namespace --namespace {{ .ProjectName }}-system
helm install my-release ./dist/chart --create-namespace --namespace {{ .ProjectName }}-system --set prometheus.enable=true
- name: Check Helm release status
run: |
helm status my-release --namespace {{ .ProjectName }}-system
- name: Check Presence of ServiceMonitor
run: |
kubectl wait --namespace {{ .ProjectName }}-system --for=jsonpath='{.kind}'=ServiceMonitor servicemonitor/{{ .ProjectName }}-controller-manager-metrics-monitor
`
14 changes: 12 additions & 2 deletions testdata/project-v4-with-plugins/.github/workflows/test-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Install Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: Verify Helm installation
run: helm version
Expand All @@ -46,6 +46,12 @@ jobs:
run: |
helm lint ./dist/chart
- 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 All @@ -72,8 +78,12 @@ jobs:

- name: Install Helm chart for project
run: |
helm install my-release ./dist/chart --create-namespace --namespace project-v4-with-plugins-system
helm install my-release ./dist/chart --create-namespace --namespace project-v4-with-plugins-system --set prometheus.enable=true
- name: Check Helm release status
run: |
helm status my-release --namespace project-v4-with-plugins-system
- name: Check Presence of ServiceMonitor
run: |
kubectl wait --namespace project-v4-with-plugins-system --for=jsonpath='{.kind}'=ServiceMonitor servicemonitor/project-v4-with-plugins-controller-manager-metrics-monitor

0 comments on commit ed95269

Please sign in to comment.