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

Fix chart testing action #65

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
62 changes: 39 additions & 23 deletions .github/workflows/helm-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ on:
branches:
- main
env:
HELM_VERSION: v3.12.1
HELM_VERSION: v3.15.4
HELMFILE_VERSION: v0.167.1
HELM_PLUGINS: >
allanger marked this conversation as resolved.
Show resolved Hide resolved
PYTHON_VERSION: 3.9
jobs:
lint:
Expand Down Expand Up @@ -79,8 +81,6 @@ jobs:
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Setup helmfile
uses: mamezou-tech/[email protected]
- name: Prepare a config for the kind cluster
run: |
cat > kind-config.yaml <<EOF
Expand All @@ -97,34 +97,50 @@ jobs:
with:
node_image: kindest/node:${{ matrix.k8s_version }}
config: ./kind-config.yaml
- name: Test db-operator charts install

- uses: helmfile/[email protected]
with:
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
helm-plugins: >
https://github.com/databus23/helm-diff, https://github.com/jkroepke/helm-secrets
helmfile-args: sync --wait

- name: Test the db-operator chart install
run: |
helmfile -l name=prometheus-stack sync
helmfile sync
ct install --target-branch main --charts ./charts/db-operator
helmfile destroy
# Test is broken because of the image in the previous version,
# so upgrate can't pass
#- name: Test db-operator charts upgrade
# run: |
# helmfile -l name=prometheus-stack sync
# helmfile sync
# ct install --target-branch main --charts ./charts/db-operator --upgrade
# helmfile destroy

- uses: helmfile/[email protected]
with:
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
helmfile-args: sync --wait

- name: Test the db-operator chart upgrade
run: |
ct install --target-branch main --charts ./charts/db-operator --upgrade
helmfile destroy

- uses: helmfile/[email protected]
with:
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
helmfile-args: sync -e instances --wait

- name: Test db-instances charts install
run: |
helmfile -l name=prometheus-stack sync
helmfile sync -e instances
kubectl rollout status deploy/db-operator -n db-operator
kubectl rollout status deploy/db-operator-webhook -n db-operator
ct install --target-branch main --charts ./charts/db-instances
helmfile destroy
- name: Test db-instances charts install

- uses: helmfile/[email protected]
with:
helmfile-version: ${{ env.HELMFILE_VERSION }}
helm-version: ${{ env.HELM_VERSION }}
helmfile-args: sync -e instances --wait

- name: Test db-instances charts upgrade
run: |
helmfile -l name=prometheus-stack sync
helmfile sync -e instances
kubectl rollout status deploy/db-operator -n db-operator
kubectl rollout status deploy/db-operator-webhook -n db-operator
ct install --target-branch main --charts ./charts/db-instances --upgrade
helmfile destroy
release:
Expand Down
14 changes: 11 additions & 3 deletions helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ releases:
- name: cert-manager
chart: jetstack/cert-manager
namespace: cert-manager
version: v1.16.1
createNamespace: true
values:
- installCRDs: true
- crds:
enabled: true

- name: postgres-instance
namespace: databases
chart: bitnami/postgresql
version: 16.0.6
values:
- global:
postgresql:
Expand All @@ -31,17 +34,21 @@ releases:
- name: mysql-instance
namespace: databases
chart: bitnami/mysql
version: 11.1.19
values:
- auth:
rootPassword: 123123!!
password: 123123!!

- name: prometheus-stack
namespace: monitoring
version: 65.3.2
createNamespace: true
disableValidation: true
disableOpenAPIValidation: true
chart: prometheus-community/kube-prometheus-stack
needs:
- cert-manager/cert-manager
values:
- prometheus:
prometheusSpec:
Expand All @@ -62,8 +69,9 @@ releases:
- name: db-operator
namespace: db-operator
createNamespace: true
needs:
- cert-manager/cert-manager
installed: {{ eq .Environment.Name "instances" | toYaml }}
chart: ./charts/db-operator
needs:
- monitoring/prometheus-stack
- cert-manager/cert-manager

Loading