Set node affinity rules to skip deploying Node Exporter on Fargate nodes #984
Workflow file for this run
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: Test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
CT_CONFIGFILE: "${{ github.workspace }}/.github/configs/ct.yaml" | |
LINT_CONFIGFILE: "${{ github.workspace }}/.github/configs/lintconf.yaml" | |
GRAFANA_AGENT_VALUES: "${{ github.workspace }}/.github/configs/agent-config.yaml" | |
GRAFANA_AGENT_RECEIVER_SERVICE: "${{ github.workspace }}/.github/configs/receiver-service.yaml" | |
PROMETHEUS_VALUES: "${{ github.workspace }}/.github/configs/prometheus.yaml" | |
PROMETHEUS_WORKLOAD_VALUES: "${{ github.workspace }}/.github/configs/prometheus-workload.yaml" | |
CREDENTIALS: "${{ github.workspace }}/.github/configs/credentials.yaml" | |
LOKI_VALUES: "${{ github.workspace }}/.github/configs/loki.yaml" | |
TEMPO_VALUES: "" # No values for now | |
GRAFANA_VALUES: "${{ github.workspace }}/.github/configs/grafana.yaml" | |
MYSQL_VALUES: "${{ github.workspace }}/.github/configs/mysql.yaml" | |
MYSQL_CONFIG_MANIFEST: "${{ github.workspace }}/.github/configs/mysql-config.yaml" | |
CERT_MANAGER_VALUES: "${{ github.workspace }}/.github/configs/cert-manager.yaml" | |
SECRETGEN_CONTROLLER_MANIFEST: https://github.com/carvel-dev/secretgen-controller/releases/latest/download/release.yml | |
CERTIFICATES_MANIFEST: "${{ github.workspace }}/.github/configs/certificates.yaml" | |
jobs: | |
check-for-doc-changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Regenerate docs | |
run: | | |
docker run --rm \ | |
-v "$(pwd)/charts/k8s-monitoring:/helm-docs" \ | |
-u "$(id -u)" \ | |
jnorwood/helm-docs | |
if ! git diff --exit-code; then | |
echo "Helm chart documentation is not up to date. Please run 'helm-docs' and commit changes!" >&2 | |
exit 1 | |
fi | |
check-for-example-output-changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check for example output changes | |
run: | | |
make regenerate-example-outputs | |
if [ ! -z "$(git status --porcelain)" ]; then | |
echo "Helm chart examples are not up to date. Please run 'make regenerate-example-outputs', examine changes, and commit changes." >&2 | |
exit 1 | |
fi | |
static-test-chart: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Required for `ct lint` to work | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
check-latest: true | |
- name: Set up chart-testing | |
uses: helm/chart-testing-action@v2 | |
- name: Install yq | |
run: pip install yq | |
- name: Install ShellSpec | |
run: | | |
curl -fsSL https://git.io/shellspec | sh -s -- --yes | |
# Installing the Grafana Agent because we need it to lint the generated agent config files. | |
# https://grafana.com/docs/agent/latest/static/set-up/install-agent-linux/#install-on-debian-or-ubuntu | |
- name: Install Grafana Agent | |
run: | | |
sudo mkdir -p /etc/apt/keyrings/ | |
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null | |
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list | |
sudo apt-get update | |
sudo apt-get install -y grafana-agent | |
- name: Run tests | |
run: make test | |
test-chart: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
check-latest: true | |
- name: Set up chart-testing | |
uses: helm/chart-testing-action@v2 | |
- name: List changed charts | |
id: list-changed | |
run: | | |
latestRelease=$(git describe --abbrev=0 --tags) | |
changed=$(ct list-changed --config "${CT_CONFIGFILE}" --since "${latestRelease}") | |
if [[ -n "$changed" ]]; then | |
echo "changed=true" >> "${GITHUB_OUTPUT}" | |
fi | |
- name: Create kind cluster | |
uses: helm/kind-action@v1 | |
with: | |
config: "${{ github.workspace }}/.github/configs/cluster-config.yaml" | |
if: steps.list-changed.outputs.changed == 'true' | |
- name: Create Certs and Credentials | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
kubectl apply -f "${SECRETGEN_CONTROLLER_MANIFEST}" | |
kubectl apply -f "${CERTIFICATES_MANIFEST}" | |
kubectl apply -f "${CREDENTIALS}" | |
- name: Set up Helm repositories | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
helm repo add grafana https://grafana.github.io/helm-charts | |
helm repo add jetstack https://charts.jetstack.io | |
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | |
helm repo update | |
- name: Deploy Services for Test Data | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
# MySQL for integration testing | |
helm install mysql oci://registry-1.docker.io/bitnamicharts/mysql -f "${MYSQL_VALUES}" -n mysql --create-namespace --wait | |
kubectl apply -f "${MYSQL_CONFIG_MANIFEST}" | |
# Cert Manager for integration testing (service annotations) | |
helm install cert-manager jetstack/cert-manager -f "${CERT_MANAGER_VALUES}" -n cert-manager --create-namespace --wait | |
# This agent is only used for generating metrics, logs, and traces that'll get | |
# sent to the K8s Monitoring Grafana Agent to test ingesting MLT from receivers. | |
kubectl apply -f "${GRAFANA_AGENT_RECEIVER_SERVICE}" | |
helm install agent grafana/grafana-agent -f "${GRAFANA_AGENT_VALUES}" -n agent --create-namespace --wait | |
# This prometheus instance is used pod annotation testing with https | |
helm install prometheus-workload prometheus-community/prometheus -f "${PROMETHEUS_WORKLOAD_VALUES}" -n prometheus --create-namespace --wait | |
# Deploy the Prometheus Operator CRDs, since we want to deploy Loki with a ServiceMonitor later | |
helm install prom-crds prometheus-community/prometheus-operator-crds --wait | |
- name: Deploy Prometheus | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
helm install prometheus prometheus-community/prometheus -f "${PROMETHEUS_VALUES}" -n prometheus --create-namespace --wait | |
- name: Deploy Loki | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
helm install loki grafana/loki -f "${LOKI_VALUES}" -n loki --create-namespace --wait | |
- name: Deploy Tempo | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
helm install tempo grafana/tempo -n tempo --create-namespace --wait | |
- name: Deploy Grafana | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
helm install grafana grafana/grafana -f "${GRAFANA_VALUES}" -n grafana --create-namespace --wait | |
- name: Test chart | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
latestRelease=$(git describe --abbrev=0 --tags) | |
ct install --config "${CT_CONFIGFILE}" --since "${latestRelease}" |