Merge pull request #7 from kedify/chart-yaml-update #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Helm Publish | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'helmchart/otel-add-on/Chart.yaml' | |
permissions: | |
contents: read | |
jobs: | |
noop: | |
runs-on: ubuntu-latest | |
steps: | |
- name: noop | |
run: echo "noop, because of 'The workflow must contain at least one job with no dependencies'" | |
test: | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.head_commit.message, '[post-release]') || contains(github.event.head_commit.message, 'kedify/chart-yaml-update') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Create k3s cluster | |
uses: AbsaOSS/k3d-action@v2 | |
with: | |
cluster-name: "test-cluster" | |
k3d-version: v5.6.0 | |
args: >- | |
--no-lb | |
--k3s-arg "--disable=traefik,servicelb,local-storage@server:*" | |
- name: Smoke test helm rendering and deployability (otel addon chart) | |
run: | | |
set -o pipefail | |
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts | |
helm repo update | |
pushd ./helmchart/otel-add-on && helm dependency build && popd | |
helm template ./helmchart/otel-add-on | kubectl apply -f - | |
sleep 10 | |
kubectl rollout status --timeout=300s deploy/otel-add-on-scaler | |
kubectl rollout status --timeout=300s deploy/otelcol | |
echo -e "\n\n\n pods:\n\n" | |
kubectl get pods -A | |
sleep 5 | |
echo -e "\n\n\n logs:\n\n" | |
echo "::group::logs" | |
kubectl logs -lapp.kubernetes.io/name=otel-add-on --tail=-1 | |
echo "::endgroup::" | |
publish: | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.head_commit.message, '[post-release]') || contains(github.event.head_commit.message, 'kedify/chart-yaml-update') | |
needs: [test] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Publish Helm chart | |
uses: stefanprodan/helm-gh-pages@master | |
with: | |
token: ${{ secrets.PAT_TOKEN }} | |
charts_dir: "helmchart" | |
- name: Create k3s cluster | |
uses: AbsaOSS/k3d-action@v2 | |
with: | |
cluster-name: "test-cluster" | |
k3d-version: v5.6.0 | |
args: >- | |
--no-lb | |
--k3s-arg "--disable=traefik,servicelb,local-storage@server:*" | |
- name: Smoke test helm installation | |
run: | | |
# exp-backoff - we wait for pages to become available here | |
for i in $(seq 16) | |
do | |
_sec=$(echo "1.5^$i" | bc) | |
echo "Waiting ${_sec} seconds.." | |
sleep ${_sec} | |
helm repo add kedify-otel https://kedify.github.io/otel-add-on/ || continue | |
helm repo update | |
set -x | |
helm upgrade -i keda-otel-add-on kedify-otel/otel-add-on \ | |
-n keda \ | |
--create-namespace \ | |
--version=$(make version) \ | |
--timeout 300s \ | |
--wait && break | |
set +x | |
[ "$i" = "16" ] && exit 1 | |
done | |
kubectl rollout status -nkeda --timeout=300s deploy/otel-add-on-scaler | |
kubectl rollout status -nkeda --timeout=300s deploy/otelcol | |
echo -e "\n\n\n pods:\n\n" | |
kubectl get pods -A | |
sleep 5 | |
echo -e "\n\n\n logs:\n\n" | |
echo "::group::logs" | |
kubectl logs -nkeda -lapp.kubernetes.io/name=otel-add-on --tail=-1 | |
echo "::endgroup::" | |
echo "::group::values.yaml" | |
helm get values -n keda keda-otel-add-on | |
echo "::endgroup::" | |
echo "::group::resulting YAML manifests" | |
helm get manifest -n keda keda-otel-add-on | |
echo "::endgroup::" |