Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#4383 from monteiro-renato/patch-4378
Browse files Browse the repository at this point in the history
🐛 fix: (helm/v1alpha1): install the prometheus-operator CRDs before installing a chart which configures a ServiceMonitor
  • Loading branch information
k8s-ci-robot authored Nov 24, 2024
2 parents c141fac + 256de94 commit 8911e2f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 8 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
- 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 @@ -106,6 +106,12 @@ jobs:
# kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager-webhook
# TODO: Uncomment if Prometheus is enabled
# - 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
#
# - name: Install Prometheus via Helm
# run: |
# helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
Expand All @@ -123,4 +129,9 @@ jobs:
- name: Check Helm release status
run: |
helm status my-release --namespace {{ .ProjectName }}-system
# TODO: Uncomment if prometheus.enabled is set to true to confirm that the ServiceMonitor gets created
# - name: Check Presence of ServiceMonitor
# run: |
# kubectl wait --namespace {{ .ProjectName }}-system --for=jsonpath='{.kind}'=ServiceMonitor servicemonitor/{{ .ProjectName }}-controller-manager-metrics-monitor
`
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 @@ -60,6 +60,12 @@ jobs:
# kubectl wait --namespace cert-manager --for=condition=available --timeout=300s deployment/cert-manager-webhook

# TODO: Uncomment if Prometheus is enabled
# - 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
#
# - name: Install Prometheus via Helm
# run: |
# helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
Expand All @@ -77,3 +83,8 @@ jobs:
- name: Check Helm release status
run: |
helm status my-release --namespace project-v4-with-plugins-system
# TODO: Uncomment if prometheus.enabled is set to true to confirm that the ServiceMonitor gets created
# - 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 8911e2f

Please sign in to comment.