Commit Graph

12 Commits (3e21f978eecfaba172dd9164998880d5c459514e)

Author SHA1 Message Date
Malar Kannan 3e21f978ee
feat: Add support for arm64 architecture (#11)
* feat: Add support for arm64 architecture

This commit introduces support for the arm64 architecture by:

1.  **Updating the Dockerfile:**
    *   The `exporter/Dockerfile` now uses the `TARGETARCH` build argument to dynamically determine the correct path for `libiperf.so.0`. This allows the same Dockerfile to be used for building both `amd64` and `arm64` images.

2.  **Modifying GitHub Workflows:**
    *   The CI workflow (`.github/workflows/ci.yaml`) and the Release workflow (`.github/workflows/release.yml`) have been updated to build and push multi-architecture Docker images (`linux/amd64` and `linux/arm64`).
    *   This involves adding the `docker/setup-qemu-action` for cross-compilation and specifying the target platforms in the `docker/build-push-action`.

3.  **Helm Chart:**
    *   No changes were required for the Helm chart as the image tag will now point to a multi-arch manifest, and the default iperf3 server image (`networkstatic/iperf3:latest`) is assumed to be multi-arch. Node selectors in the chart are not architecture-specific.

These changes enable the deployment of the iperf3-monitor on Kubernetes clusters with arm64 nodes.

* fix: Ensure multi-platform builds with Docker Buildx

This commit updates the GitHub Actions workflows to correctly set up
Docker Buildx for multi-platform (amd64, arm64) image builds.

Previously, the workflows were missing the `docker/setup-buildx-action`
step, which led to errors when attempting multi-platform builds as the
default Docker driver does not support this.

The following changes were made:
1.  **Added `docker/setup-buildx-action@v3`:**
    - This step is now included in both the CI (`.github/workflows/ci.yaml`) and Release (`.github/workflows/release.yml`) workflows before the QEMU setup and build/push actions.

2.  **Dockerfile (`exporter/Dockerfile`):**
    - Remains as per the previous commit, using `TARGETARCH` to correctly copy architecture-specific libraries. This part was already correct for multi-arch builds.

3.  **Helm Chart:**
    - No changes were required for the Helm chart.

This ensures that the CI/CD pipeline can successfully build and push
Docker images for both `linux/amd64` and `linux/arm64` architectures.

* fix: Correct Dockerfile lib path and add Helm dependency toggle

This commit includes two main changes:

1.  **Fix Dockerfile library path for amd64:**
    - I updated the `exporter/Dockerfile` to correctly determine the source path for `libiperf.so.0` when building for different architectures.
    - Specifically, for `TARGETARCH=amd64`, the path `/usr/lib/x86_64-linux-gnu/libiperf.so.0` is now used.
    - For `TARGETARCH=arm64`, the path `/usr/lib/aarch64-linux-gnu/libiperf.so.0` is used.
    - I achieved this by copying the library to a canonical temporary location in the builder stage based on `TARGETARCH`, and then copying it from this location into the final image. This resolves an issue where builds for `amd64` would fail to find the library.

2.  **Add Helm chart option to disable dependencies:**
    - I added a new option `dependencies.install` (default: `true`) to `charts/iperf3-monitor/values.yaml`.
    - This allows you to disable the installation of managed dependencies (i.e., Prometheus Operator via `kube-prometheus-stack` or `prometheus-operator` from TrueCharts) even if `serviceMonitor.enabled` is true.
    - I updated the `condition` for these dependencies in `charts/iperf3-monitor/Chart.yaml` to `dependencies.install, serviceMonitor.enabled, ...`.
    - This is useful for you if you manage your Prometheus Operator installation separately.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-06-20 19:07:36 +05:30
Malar Kannan 458b786ff4
Fix: Ignore packaged chart files and remove markdown files (#10)
Removes the outdated markdown files and fixes the .gitignore to ignore packaged chart files in the correct directories. This prevents them from being committed to
2025-06-20 17:42:17 +05:30
Malar Kannan 96be13a23c
Fix: Use dependencies scope for truecharts prometheus-operator (#9)
Fixes an issue where truecharts prometheus operator version and
repository values where not accessible because they were not under the
`dependencies` scope.
2025-06-20 13:35:13 +05:30
Malar Kannan 8d51afc24e
Feat: Add optional TrueCharts Prometheus Operator dependency (#8)
This commit introduces a configurable dependency for the Prometheus Operator,
allowing you to choose between the standard kube-prometheus-stack and
the TrueCharts version of prometheus-operator.

Changes include:

1.  **values.yaml:**
    *   Added a `dependencies` section with the following new values:
        *   `useTrueChartsPrometheusOperator` (boolean, default: false):
            Controls which operator dependency is enabled.
        *   `trueChartsPrometheusOperatorRepository` (string, default:
            "oci://tccr.io/truecharts"): Repository for the TrueCharts operator.
        *   `trueChartsPrometheusOperatorVersion` (string, default: "8.11.1"):
            Chart version for the TrueCharts operator.

2.  **Chart.yaml:**
    *   The `kube-prometheus-stack` dependency condition is updated to
        `"serviceMonitor.enabled, !values.dependencies.useTrueChartsPrometheusOperator"`.
    *   A new dependency for `prometheus-operator` (TrueCharts) is added:
        *   `name: prometheus-operator`
        *   `version: "{{ .Values.dependencies.trueChartsPrometheusOperatorVersion }}"`
        *   `repository: "{{ .Values.dependencies.trueChartsPrometheusOperatorRepository }}"`
        *   `condition: "serviceMonitor.enabled, values.dependencies.useTrueChartsPrometheusOperator"`

This provides you with more flexibility in choosing your Prometheus
Operator stack while using the iperf3-monitor chart.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2025-06-20 13:25:30 +05:30
google-labs-jules[bot] a9f2a49549 Fix: Update README, license consistency, and Helm chart configurations
This commit addresses several issues to improve repository accuracy and CI reliability:

1.  **README.md Updates:**
    *   I corrected the Helm repository URL to `https://malarinv.github.io/iperf3-monitor/`.
    *   I updated the default exporter image name to `ghcr.io/malarinv/iperf3-monitor` in examples.
    *   I revised the License section to accurately reflect the AGPLv3 license present in the `LICENSE` file, removing contradictory statements.

2.  **License Consistency:**
    *   I confirmed `LICENSE` file contains AGPLv3. README now correctly refers to it.

3.  **Helm Chart Adjustments:**
    *   `charts/iperf3-monitor/Chart.yaml`: I removed placeholder comments for clarity. Versioning is handled by the release workflow.
    *   `charts/iperf3-monitor/values.yaml`: I updated `exporter.image.repository` to `ghcr.io/malarinv/iperf3-monitor` to match the CI build image name.

4.  **CI Workflow Verification:**
    *   I verified that `.github/workflows/release.yml` correctly uses `yq` to set chart versions from Git tags and publishes to the correct GitHub Pages URL. This should prevent the previously noted `chart.metadata.version is required` error, which was associated with an older version of the release workflow.

These changes ensure that the documentation is up-to-date, the Helm chart defaults are correct, and the CI pipeline for chart publishing is robust.
2025-06-19 21:13:13 +00:00
Malar Invention 050fbcbf3c feat: Add devbox configuration and lock files; clean up YAML files by removing trailing newlines 2025-06-20 02:28:10 +05:30
Malar Kannan e22d2ff71d
Merge pull request #4 from malarinv/fix-helm-lint-errors
I've fixed the Helm lint errors in the iperf3-monitor chart.
2025-06-20 02:18:11 +05:30
Malar Invention fec4cf64b9 fix: Remove unnecessary dependency section from Chart.yaml and correct formatting in exporter-deployment.yaml 2025-06-20 02:17:27 +05:30
google-labs-jules[bot] c08f4a5667 I've fixed the Helm lint errors in the iperf3-monitor chart.
This involved addressing several Helm linting issues I identified in the iperf3-monitor chart.

Here's what I changed:
- I corrected a syntax error (an unexpected backslash) in the label value within `charts/iperf3-monitor/templates/exporter-deployment.yaml`.
- I resolved a missing dependency by:
    - Adding the `prometheus-community` Helm repository.
    - Updating the dependency name in `Chart.yaml` to `kube-prometheus-stack` when a repository URL is specified.
    - Running `helm dependency update` to fetch the `kube-prometheus-stack` dependency.
- I fixed YAML parsing errors in `charts/iperf3-monitor/templates/exporter-deployment.yaml` caused by incorrect newline handling in the Helm helper templates (`charts/iperf3-monitor/templates/_helpers.tpl`). This involved:
    - Ensuring the `iperf3-monitor.selectorLabels` helper template output ends with a newline.
    - Adjusting whitespace control in the `iperf3-monitor.labels` helper template to preserve newlines between label entries.
- I restored the `app.kubernetes.io/component: exporter` label to the top-level metadata in `charts/iperf3-monitor/templates/exporter-deployment.yaml`.

After these modifications, `helm lint charts/iperf3-monitor` passes without any errors or warnings.
2025-06-19 20:45:00 +00:00
Malar Invention f6c26c02b1 feat: Add GitHub Actions CI workflow
Configure automated checks for pull requests including:

- Linting the Helm chart.
- Building the exporter Docker image.
- A placeholder for future tests.
2025-06-19 01:01:01 +05:30
Malar Invention 07ba196ba6 fix: Ensure proper formatting and handle KeyError in exporter.py 2025-06-18 20:41:37 +05:30
Malar Invention f3968a609e feat: Introduce iperf3 Kubernetes network monitor
Add core components for continuous cluster network validation:
- Python exporter (`exporter/`) to run iperf3 tests and expose Prometheus metrics.
- Helm chart (`charts/iperf3-monitor/`) for deploying the exporter as a
  Deployment and iperf3 server as a DaemonSet.
- CI/CD workflow (`.github/workflows/release.yml`) for building/publishing
  images and charts on tag creation.
- Initial documentation, license, and `.gitignore`.
2025-06-18 20:26:47 +05:30