feat: Update Helm chart and CI for exporter enhancements

This commit introduces updates to the Helm chart to support log level
configuration for the iperf3 exporter, and modifies the CI workflow
to improve image tagging for pull requests.

Helm Chart Changes (`charts/iperf3-monitor`):
- Added `exporter.logLevel` to `values.yaml` (default: "INFO") to allow
  you to set the exporter's log level.
- Updated `templates/exporter-deployment.yaml` to use the
  `exporter.logLevel` value to set the `LOG_LEVEL` environment
  variable in the exporter container.

CI Workflow Changes (`.github/workflows/ci.yaml`):
- Modified the Docker image build process to tag images built from
  pull requests with `pr-<PR_NUMBER>`.
- Ensured that these PR-specific images are pushed to the container
  registry.
- Preserved existing tagging mechanisms (e.g., SHA-based tags).
pull/13/head
google-labs-jules[bot] 2025-06-20 19:01:15 +00:00
parent 8887ff6afc
commit bb9d61ae73
3 changed files with 15 additions and 1 deletions

View File

@ -42,12 +42,21 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# Tag with the PR number if it's a pull request event
type=match,pattern=pull_request,value=pr-{{number}}
# Tag with the git SHA
type=sha,prefix=
# Tag with 'latest' if on the main branch (though this workflow only runs on PRs to main)
type=ref,event=branch,pattern=main,value=latest
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: ./exporter
push: false # Do not push on PRs
# Push the image if the event is a pull request.
# The workflow currently only triggers on pull_request events.
push: ${{ github.event_name == 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64

View File

@ -34,6 +34,8 @@ spec:
value: "{{ .Values.exporter.testInterval }}"
- name: IPERF_TEST_PROTOCOL
value: "{{ .Values.exporter.testProtocol }}"
- name: LOG_LEVEL
value: "{{ .Values.exporter.logLevel }}"
- name: IPERF_SERVER_PORT
value: "5201" # Hardcoded as per server DaemonSet
- name: IPERF_SERVER_NAMESPACE

View File

@ -24,6 +24,9 @@ exporter:
# -- Interval in seconds between complete test cycles (i.e., testing all server nodes).
testInterval: 300
# -- Log level for the iperf3 exporter (e.g., DEBUG, INFO, WARNING, ERROR, CRITICAL).
logLevel: INFO
# -- Timeout in seconds for a single iperf3 test run.
testTimeout: 10