mirror of
https://github.com/malarinv/iperf3-monitor.git
synced 2026-03-08 05:22:35 +00:00
Compare commits
16 Commits
ci
...
feat/add-a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e019b16ff | ||
|
|
a00629af7a | ||
|
|
e1164a597e | ||
| 458b786ff4 | |||
| 96be13a23c | |||
| 8d51afc24e | |||
| a2d57908f6 | |||
|
|
4298031a2d | ||
| e6d1a8fb91 | |||
|
|
a9f2a49549 | ||
| 7f0784d382 | |||
| 050fbcbf3c | |||
| e22d2ff71d | |||
| 1487901337 | |||
|
|
c08f4a5667 | ||
| 774afbab70 |
7
.github/workflows/ci.yaml
vendored
7
.github/workflows/ci.yaml
vendored
@@ -31,6 +31,12 @@ jobs:
|
|||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
@@ -44,6 +50,7 @@ jobs:
|
|||||||
push: false # Do not push on PRs
|
push: false # Do not push on PRs
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: Run Tests
|
name: Run Tests
|
||||||
|
|||||||
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
@@ -36,6 +36,12 @@ jobs:
|
|||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -56,6 +62,7 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
package-and-publish-chart:
|
package-and-publish-chart:
|
||||||
name: Package and Publish Helm Chart
|
name: Package and Publish Helm Chart
|
||||||
@@ -82,8 +89,8 @@ jobs:
|
|||||||
- name: Set Chart Version from Tag
|
- name: Set Chart Version from Tag
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
|
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
|
||||||
yq e -i '.version = strenv(VERSION)' ./charts/iperf3-monitor/Chart.yaml
|
VERSION=$VERSION yq e -i '.version = strenv(VERSION)' ./charts/iperf3-monitor/Chart.yaml
|
||||||
yq e -i '.appVersion = strenv(VERSION)' ./charts/iperf3-monitor/Chart.yaml
|
VERSION=$VERSION yq e -i '.appVersion = strenv(VERSION)' ./charts/iperf3-monitor/Chart.yaml
|
||||||
cat ./charts/iperf3-monitor/Chart.yaml # Optional: print updated Chart.yaml
|
cat ./charts/iperf3-monitor/Chart.yaml # Optional: print updated Chart.yaml
|
||||||
|
|
||||||
- name: Publish Helm chart
|
- name: Publish Helm chart
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -36,4 +36,4 @@ Thumbs.db
|
|||||||
|
|
||||||
# Helm
|
# Helm
|
||||||
!charts/iperf3-monitor/.helmignore
|
!charts/iperf3-monitor/.helmignore
|
||||||
charts/*.tgz # Ignore packaged chart files
|
charts/iperf3-monitor/charts/
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
10
README.md
10
README.md
@@ -37,7 +37,7 @@ This separation of concerns ensures scalability, resilience, and aligns with Kub
|
|||||||
1. Add the Helm chart repository (replace with your actual repo URL once published):
|
1. Add the Helm chart repository (replace with your actual repo URL once published):
|
||||||
|
|
||||||
```/dev/null/helm-install.sh#L1-1
|
```/dev/null/helm-install.sh#L1-1
|
||||||
helm repo add iperf3-monitor https://your-github-org.github.io/iperf3-monitor/
|
helm repo add iperf3-monitor https://malarinv.github.io/iperf3-monitor/
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Update your Helm repositories:
|
2. Update your Helm repositories:
|
||||||
@@ -78,7 +78,7 @@ exporter:
|
|||||||
# -- Configuration for the exporter container image.
|
# -- Configuration for the exporter container image.
|
||||||
image:
|
image:
|
||||||
# -- The container image repository for the exporter.
|
# -- The container image repository for the exporter.
|
||||||
repository: ghcr.io/my-org/iperf3-prometheus-exporter # Replace with your repo URL
|
repository: ghcr.io/malarinv/iperf3-monitor
|
||||||
# -- The container image tag for the exporter. If not set, the chart's appVersion is used.
|
# -- The container image tag for the exporter. If not set, the chart's appVersion is used.
|
||||||
tag: ""
|
tag: ""
|
||||||
# -- The image pull policy for the exporter container.
|
# -- The image pull policy for the exporter container.
|
||||||
@@ -430,8 +430,4 @@ The project includes a GitHub Actions workflow (`.github/workflows/release.yml`)
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the terms defined in the `LICENSE` file.
|
This project is licensed under the GNU Affero General Public License v3. See the `LICENSE` file for details.
|
||||||
|
|
||||||
```iperf3-monitor/LICENSE
|
|
||||||
This project is currently unlicensed. Please see the project's documentation or repository for licensing information when it becomes available.
|
|
||||||
```
|
|
||||||
|
|||||||
1418
bootstrap.md
1418
bootstrap.md
File diff suppressed because it is too large
Load Diff
9
charts/iperf3-monitor/Chart.lock
Normal file
9
charts/iperf3-monitor/Chart.lock
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
dependencies:
|
||||||
|
- name: kube-prometheus-stack
|
||||||
|
repository: https://prometheus-community.github.io/helm-charts
|
||||||
|
version: 75.3.6
|
||||||
|
- name: prometheus-operator
|
||||||
|
repository: oci://tccr.io/truecharts
|
||||||
|
version: 11.5.1
|
||||||
|
digest: sha256:3000e63445f8ba8df601cb483f4f77d14c5c4662bff2d16ffcf5cf1f7def314b
|
||||||
|
generated: "2025-06-20T17:25:44.538372209+05:30"
|
||||||
@@ -12,19 +12,23 @@ keywords:
|
|||||||
- kubernetes
|
- kubernetes
|
||||||
- prometheus
|
- prometheus
|
||||||
- grafana
|
- grafana
|
||||||
home: https://github.com/malarinv/iperf3-monitor # Replace with your repo URL
|
home: https://github.com/malarinv/iperf3-monitor
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/malarinv/iperf3-monitor # Replace with your repo URL
|
- https://github.com/malarinv/iperf3-monitor
|
||||||
maintainers:
|
maintainers:
|
||||||
- name: Malar Invention # Replace with your name
|
- name: Malar Invention
|
||||||
email: malarkannan.invention@gmail.com # Replace with your email
|
email: malarkannan.invention@gmail.com
|
||||||
icon: https://raw.githubusercontent.com/malarinv/iperf3-monitor/main/icon.png # Optional icon URL
|
icon: https://raw.githubusercontent.com/malarinv/iperf3-monitor/main/icon.png # Optional icon URL
|
||||||
annotations:
|
annotations:
|
||||||
artifacthub.io/changes: |
|
artifacthub.io/changes: |
|
||||||
- Add initial Helm chart structure.
|
- Add initial Helm chart structure.
|
||||||
artifacthub.io/category: networking
|
artifacthub.io/category: networking
|
||||||
dependencies:
|
dependencies:
|
||||||
- name: prometheus-community/kube-prometheus-stack # Example dependency if you package the whole stack
|
- name: kube-prometheus-stack # Example dependency if you package the whole stack
|
||||||
version: ">=30.0.0" # Specify a compatible version range
|
version: ">=30.0.0" # Specify a compatible version range
|
||||||
repository: https://prometheus-community.github.io/helm-charts
|
repository: https://prometheus-community.github.io/helm-charts
|
||||||
condition: serviceMonitor.enabled # Only include if ServiceMonitor is enabled (assuming Prometheus Operator)
|
condition: "dependencies.install, serviceMonitor.enabled, !dependencies.useTrueChartsPrometheusOperator"
|
||||||
|
- name: prometheus-operator
|
||||||
|
version: ">=8.11.1"
|
||||||
|
repository: "oci://tccr.io/truecharts"
|
||||||
|
condition: "dependencies.install, serviceMonitor.enabled, dependencies.useTrueChartsPrometheusOperator"
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ Create chart's labels
|
|||||||
{{- define "iperf3-monitor.labels" -}}
|
{{- define "iperf3-monitor.labels" -}}
|
||||||
helm.sh/chart: {{ include "iperf3-monitor.name" . }}-{{ .Chart.Version | replace "+" "_" }}
|
helm.sh/chart: {{ include "iperf3-monitor.name" . }}-{{ .Chart.Version | replace "+" "_" }}
|
||||||
{{ include "iperf3-monitor.selectorLabels" . }}
|
{{ include "iperf3-monitor.selectorLabels" . }}
|
||||||
{{- if .Chart.AppVersion -}}
|
{{ if .Chart.AppVersion }}
|
||||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
{{- end -}}
|
{{ end }}
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ Selector labels
|
|||||||
{{- define "iperf3-monitor.selectorLabels" -}}
|
{{- define "iperf3-monitor.selectorLabels" -}}
|
||||||
app.kubernetes.io/name: {{ include "iperf3-monitor.name" . }}
|
app.kubernetes.io/name: {{ include "iperf3-monitor.name" . }}
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
{{- end -}}
|
{{ end }}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Create the name of the service account to use
|
Create the name of the service account to use
|
||||||
|
|||||||
@@ -41,9 +41,8 @@ spec:
|
|||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
- name: IPERF_SERVER_LABEL_SELECTOR
|
- name: IPERF_SERVER_LABEL_SELECTOR
|
||||||
value: "app.kubernetes.io/name={{ include \"iperf3-monitor.name\" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=server"
|
value: 'app.kubernetes.io/name={{ include "iperf3-monitor.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=server'
|
||||||
{{- with .Values.exporter.resources }}
|
{{- with .Values.exporter.resources }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml . | nindent 10 }}
|
{{- toYaml . | nindent 10 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
```
|
|
||||||
@@ -42,4 +42,3 @@ spec:
|
|||||||
resources:
|
resources:
|
||||||
{{- toYaml . | nindent 12 }}
|
{{- toYaml . | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
```
|
|
||||||
@@ -12,7 +12,7 @@ exporter:
|
|||||||
# -- Configuration for the exporter container image.
|
# -- Configuration for the exporter container image.
|
||||||
image:
|
image:
|
||||||
# -- The container image repository for the exporter.
|
# -- The container image repository for the exporter.
|
||||||
repository: ghcr.io/malarinv/iperf3-prometheus-exporter # Replace with your repo URL
|
repository: ghcr.io/malarinv/iperf3-monitor
|
||||||
# -- The container image tag for the exporter. If not set, the chart's appVersion is used.
|
# -- The container image tag for the exporter. If not set, the chart's appVersion is used.
|
||||||
tag: ""
|
tag: ""
|
||||||
# -- The image pull policy for the exporter container.
|
# -- The image pull policy for the exporter container.
|
||||||
@@ -118,3 +118,19 @@ networkPolicy:
|
|||||||
namespaceSelector: {}
|
namespaceSelector: {}
|
||||||
# -- Specify pod selectors if needed.
|
# -- Specify pod selectors if needed.
|
||||||
podSelector: {}
|
podSelector: {}
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# Dependency Configuration
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
dependencies:
|
||||||
|
# -- Set to true to install Prometheus operator dependency if serviceMonitor.enabled is also true.
|
||||||
|
# -- Set to false to disable the installation of Prometheus operator dependency,
|
||||||
|
# -- regardless of serviceMonitor.enabled. This is useful if you have Prometheus
|
||||||
|
# -- Operator installed and managed separately in your cluster.
|
||||||
|
install: true
|
||||||
|
|
||||||
|
# -- Set to true to use the TrueCharts Prometheus Operator instead of kube-prometheus-stack.
|
||||||
|
# This chart's ServiceMonitor resources require a Prometheus Operator to be functional.
|
||||||
|
# If serviceMonitor.enabled is true and dependencies.install is true,
|
||||||
|
# one of these two dependencies will be pulled based on this flag.
|
||||||
|
useTrueChartsPrometheusOperator: false
|
||||||
|
|||||||
14
devbox.json
Normal file
14
devbox.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.7/.schema/devbox.schema.json",
|
||||||
|
"packages": [],
|
||||||
|
"shell": {
|
||||||
|
"init_hook": [
|
||||||
|
"echo 'Welcome to devbox!' > /dev/null"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"test": [
|
||||||
|
"echo \"Error: no test specified\" && exit 1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
4
devbox.lock
Normal file
4
devbox.lock
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"lockfile_version": "1",
|
||||||
|
"packages": {}
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
# Stage 1: Build stage with dependencies
|
# Stage 1: Build stage with dependencies
|
||||||
FROM python:3.9-slim as builder
|
FROM python:3.9-slim as builder
|
||||||
|
|
||||||
|
# Declare TARGETARCH for use in this stage
|
||||||
|
ARG TARGETARCH
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install iperf3 and build dependencies
|
# Install iperf3 and build dependencies
|
||||||
@@ -8,6 +10,20 @@ RUN apt-get update && \
|
|||||||
apt-get install -y --no-install-recommends gcc iperf3 libiperf-dev && \
|
apt-get install -y --no-install-recommends gcc iperf3 libiperf-dev && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Determine the correct libiperf source directory based on TARGETARCH
|
||||||
|
# and copy libiperf.so.0 to a canonical temporary location /tmp/lib/ within the builder stage.
|
||||||
|
RUN echo "Builder stage TARGETARCH: ${TARGETARCH}" && \
|
||||||
|
LIBIPERF_SRC_DIR_SEGMENT="" && \
|
||||||
|
if [ "${TARGETARCH}" = "amd64" ]; then \
|
||||||
|
LIBIPERF_SRC_DIR_SEGMENT="x86_64-linux-gnu"; \
|
||||||
|
elif [ "${TARGETARCH}" = "arm64" ]; then \
|
||||||
|
LIBIPERF_SRC_DIR_SEGMENT="aarch64-linux-gnu"; \
|
||||||
|
else \
|
||||||
|
echo "Unsupported TARGETARCH in builder: ${TARGETARCH}" && exit 1; \
|
||||||
|
fi && \
|
||||||
|
mkdir -p /tmp/lib && \
|
||||||
|
cp "/usr/lib/${LIBIPERF_SRC_DIR_SEGMENT}/libiperf.so.0" /tmp/lib/libiperf.so.0
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
@@ -17,9 +33,11 @@ FROM python:3.9-slim
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy iperf3 binary and library from the builder stage
|
# Copy iperf3 binary from the builder stage
|
||||||
COPY --from=builder /usr/bin/iperf3 /usr/bin/iperf3
|
COPY --from=builder /usr/bin/iperf3 /usr/bin/iperf3
|
||||||
COPY --from=builder /usr/lib/x86_64-linux-gnu/libiperf.so.0 /usr/lib/x86_64-linux-gnu/libiperf.so.0
|
# Copy the prepared libiperf.so.0 from the builder's canonical temporary location
|
||||||
|
# into a standard library path in the final image.
|
||||||
|
COPY --from=builder /tmp/lib/libiperf.so.0 /usr/lib/libiperf.so.0
|
||||||
|
|
||||||
# Copy installed Python packages from the builder stage
|
# Copy installed Python packages from the builder stage
|
||||||
COPY --from=builder /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
|
COPY --from=builder /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
|
||||||
|
|||||||
Reference in New Issue
Block a user