|
45 | 45 | run: | |
46 | 46 | kubectl version --client |
47 | 47 |
|
| 48 | + - name: Setup Helm |
| 49 | + uses: azure/setup-helm@v4 |
| 50 | + with: |
| 51 | + version: latest |
| 52 | + |
48 | 53 | - name: Checkout source |
49 | 54 | uses: actions/checkout@v4 |
50 | 55 | with: |
|
56 | 61 | go-version-file: go.mod |
57 | 62 | cache: false |
58 | 63 |
|
| 64 | + - name: Lint Helm chart |
| 65 | + shell: bash |
| 66 | + run: | |
| 67 | + helm lint manifests/helm/kepler |
| 68 | +
|
59 | 69 | - name: Build image |
60 | 70 | shell: bash |
61 | 71 | run: | |
@@ -128,6 +138,55 @@ runs: |
128 | 138 | fi |
129 | 139 | done |
130 | 140 |
|
| 141 | + - name: Remove existing Kepler deployment |
| 142 | + shell: bash |
| 143 | + run: | |
| 144 | + echo "::group::Remove existing Kepler deployment before Helm test" |
| 145 | + make undeploy |
| 146 | + echo "::endgroup::" |
| 147 | +
|
| 148 | + - name: Test Helm deployment |
| 149 | + shell: bash |
| 150 | + run: | |
| 151 | + echo "::group::Deploy Kepler using Helm" |
| 152 | + # Update Helm chart to use the locally built image |
| 153 | + sed -i 's|repository: quay.io/sustainable_computing_io/kepler|repository: localhost:5001/kepler|' manifests/helm/kepler/values.yaml |
| 154 | + sed -i 's|tag: latest|tag: dev|' manifests/helm/kepler/values.yaml |
| 155 | + sed -i '/fake-cpu-meter:/{n;s/enabled: false/enabled: true/}' manifests/helm/kepler/values.yaml |
| 156 | +
|
| 157 | + # Install using Helm |
| 158 | + helm install kepler-helm-test manifests/helm/kepler --namespace kepler-helm --create-namespace --wait --timeout=5m |
| 159 | + echo "::endgroup::" |
| 160 | +
|
| 161 | + - name: Verify Helm deployment |
| 162 | + shell: bash |
| 163 | + run: | |
| 164 | + echo "::group::Verify Helm deployment" |
| 165 | + kubectl rollout status daemonset/kepler-helm-test -n kepler-helm --timeout=5m |
| 166 | + kubectl get pods -n kepler-helm |
| 167 | + echo "::endgroup::" |
| 168 | +
|
| 169 | + - name: Validate Helm metrics endpoint |
| 170 | + shell: bash |
| 171 | + run: | |
| 172 | + echo "::group::Test Helm deployment metrics" |
| 173 | + kubectl port-forward service/kepler-helm-test 28283:28282 -n kepler-helm & |
| 174 | + sleep 20 |
| 175 | +
|
| 176 | + HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:28283/metrics) |
| 177 | + [[ $HTTP_STATUS -ne 200 ]] && echo "Helm deployment HTTP status code is not 200" && exit 1 |
| 178 | +
|
| 179 | + echo "Helm deployment metrics endpoint is working" |
| 180 | + echo "::endgroup::" |
| 181 | +
|
| 182 | + - name: Cleanup Helm deployment |
| 183 | + shell: bash |
| 184 | + run: | |
| 185 | + echo "::group::Cleanup Helm deployment" |
| 186 | + helm uninstall kepler-helm-test -n kepler-helm |
| 187 | + kubectl delete namespace kepler-helm |
| 188 | + echo "::endgroup::" |
| 189 | +
|
131 | 190 | - name: Run must gather |
132 | 191 | shell: bash |
133 | 192 | run: | |
|
0 commit comments