Skip to content

update gomod-k8s-dependencies to v0.32.9 (release/v3.x) #865

update gomod-k8s-dependencies to v0.32.9 (release/v3.x)

update gomod-k8s-dependencies to v0.32.9 (release/v3.x) #865

name: "[prom-fed] E2E CI"
on:
workflow_call:
workflow_dispatch:
inputs:
debug:
description: "Enable debug logs"
required: false
default: "false"
k3s_version:
description: "Version of k3s to use for the underlying cluster, should exist in https://hub.docker.com/r/rancher/k3s/tags"
required: false
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- 'Makefile'
push:
branches:
- main
- release/v[0-9]+.x
- release/v[0-9]+.[0-9]+.[0-9]+
paths-ignore:
- 'docs/**'
- '*.md'
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
env:
GOARCH: amd64
CGO_ENABLED: 0
SETUP_GO_VERSION: '^1.20'
YQ_VERSION: v4.25.1
E2E_CI: true
REPO: rancher
APISERVER_PORT: 8001
DEFAULT_SLEEP_TIMEOUT_SECONDS: 10
KUBECTL_WAIT_TIMEOUT: 300s
DEBUG: ${{ github.event.inputs.debug || false }}
CLUSTER_NAME: 'e2e-ci-prometheus-federator'
permissions:
contents: write
jobs:
e2e-prometheus-federator:
strategy:
matrix:
arch:
- x64
- arm64
runs-on: ${{ github.repository == 'rancher/prometheus-federator' && format('runs-on,image=ubuntu22-full-{1},runner=4cpu-linux-{1},run-id={0}', github.run_id, matrix.arch) || 'ubuntu-latest' }}
steps:
-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
with:
go-version: '>=1.20.0'
- uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v4
- name : Install helm
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check if yq is installed
id: check_yq
run: |
if ! command -v yq &> /dev/null; then
echo "yq not found, installing..."
echo "::set-output name=install_yq::true"
else
echo "yq is already installed"
YQ_BIN=$(which yq)
echo "::set-output name=install_yq::false"
echo "::set-output name=yq_path::$YQ_BIN"
fi
- name : Install YQ
if: steps.check_yq.outputs.install_yq == 'true'
run: |
sudo wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${{ matrix.arch == 'x64' && 'amd64' || matrix.arch }} -O /usr/bin/yq && sudo chmod +x /usr/bin/yq;
- name : Export image version
run : |
source ./scripts/version
echo TAG=$TAG >> $GITHUB_ENV
echo IMAGE=$IMAGE >> $GITHUB_ENV
echo RANCHER_MONITORING=$RANCHER_MONITORING >> $GITHUB_ENV
- name: Set K3S Min/Max Versions
run: bash ./scripts/k3s-version >> $GITHUB_ENV
- name: Set K3S_VERSION
run: echo "K3S_VERSION=${{ inputs.k3s_version || env.K3S_MIN_VERSION_TAG }}" >> $GITHUB_ENV
-
name: Perform pre-e2e image build
run: |
make build;
make package;
-
name : Install k3d
run : ./.github/workflows/e2e/scripts/install-k3d.sh
-
name : Setup k3d cluster
run : ./.github/workflows/e2e/scripts/setup-cluster.sh
-
name: Import Images Into k3d
run: |
k3d image import ${IMAGE} -c $CLUSTER_NAME;
-
name: Setup kubectl context
run: |
kubectl config use-context "k3d-$CLUSTER_NAME";
-
name: Install Rancher Monitoring
run: ./.github/workflows/e2e/scripts/install-monitoring.sh;
-
name: Check if Rancher Monitoring is up
run: ./.github/workflows/e2e/scripts/validate-monitoring.sh;
-
name: Install Prometheus Federator
run: ./.github/workflows/e2e/scripts/install-federator.sh;
-
name: Check if Prometheus Federator is up
run: ./.github/workflows/e2e/scripts/validate-federator.sh;
-
name: Check if Project Registration Namespace is auto-created on namespace detection
run: ./.github/workflows/e2e/scripts/create-project-namespace.sh;
-
name: Create Project Monitoring Stack via ProjectHelmChart CR
run: DEFAULT_SLEEP_TIMEOUT_SECONDS=20 KUBECTL_WAIT_TIMEOUT=480s ./.github/workflows/e2e/scripts/create-projecthelmchart.sh;
-
name: Check if the Project Prometheus Stack is up
run: ./.github/workflows/e2e/scripts/validate-project-monitoring.sh;
-
name: Validate Project Prometheus Targets
run: KUBECTL_WAIT_TIMEOUT=480s ./.github/workflows/e2e/scripts/validate-project-prometheus-targets.sh;
-
name: Validate Project Grafana Datasources
run: ./.github/workflows/e2e/scripts/validate-project-grafana-datasource.sh;
-
name: Validate Project Grafana Dashboards
run: ./.github/workflows/e2e/scripts/validate-project-grafana-dashboards.sh;
# Re-disable this as it's been broken since Jun 28, 2023
# More context: https://github.com/rancher/prometheus-federator/pull/73
# -
# name: Validate Project Grafana Dashboard Data
# run: ./.github/workflows/e2e/scripts/validate-project-grafana-dashboard-data.sh;
-
name: Validate Project Prometheus Alerts
run: KUBECTL_WAIT_TIMEOUT=480s ./.github/workflows/e2e/scripts/validate-project-prometheus-alerts.sh;
-
name: Validate Project Alertmanager
run: KUBECTL_WAIT_TIMEOUT=480s ./.github/workflows/e2e/scripts/validate-project-alertmanager.sh;
-
name: Delete Project Prometheus Stack
run: ./.github/workflows/e2e/scripts/delete-projecthelmchart.sh;
-
name: Uninstall Prometheus Federator
run: ./.github/workflows/e2e/scripts/uninstall-federator.sh;
- name: Generate artifacts on failure
if: failure()
run: ./.github/workflows/e2e/scripts/generate-artifacts.sh;
- name: Upload logs and manifests on failure
if: failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: artifacts-${{ matrix.arch }}-${{ inputs.k3s_version || env.K3S_MIN_VERSION_TAG }}
path: artifacts/
retention-days: 1
-
name: Delete k3d cluster
if: always()
run: k3d cluster delete e2e-ci-prometheus-federator