Skip to content

Commit

Permalink
add network tools
Browse files Browse the repository at this point in the history
  • Loading branch information
EugenMayer committed Mar 16, 2024
1 parent 2610522 commit aaa7b80
Show file tree
Hide file tree
Showing 11 changed files with 240 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ package-all:
cr package charts/whatsmyip
cr package charts/coredns-private-dns-fix
cr package charts/longhorn-backup-config
cr package charts/iobroker
cr package charts/iobroker
cr package charts/network-tools
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@ So it is not a 'how to learn to run rundeck' kind of project. Thank you for resp

## Index

- [rundeck](charts/rundeck)
- [postgres-pgdump-backup](charts/postgres-pgdump-backup)
- [iperf3](charts/iperf3)
- [openldap-test](charts/openldap-test)
- [vulnz-nvd-mirror](charts/vulnz-nvd-mirror)
- [cert-manager-cloudflare-config](charts/cert-manager-cloudflare-config)
- [localpath](charts/localpath)
- [whatsmyip](charts/whatsmyip)
- [coredns-private-dns-fix](charts/coredns-private-dns-fix)
- [ioBroker](charts/iobroker)
- [longhorn-backup-config](charts/longhorn-backup-config)
- [rundeck](charts/rundeck): Rundeck
- [postgres-pgdump-backup](charts/postgres-pgdump-backup): Automated Postgres DB backups
- [iperf3](charts/iperf3): Iperf for network performance tests
- [openldap-test](charts/openldap-test): Pre-Provisioned ldap server for tests
- [vulnz-nvd-mirror](charts/vulnz-nvd-mirror): NVD vuln mirror
- [cert-manager-cloudflare-config](charts/cert-manager-cloudflare-config): Cert Manager Cloudflare ACME config CRD)
- [localpath](charts/localpath): Rancher localpath
- [whatsmyip](charts/whatsmyip): Simple pong service for ingress tests
- [coredns-private-dns-fix](charts/coredns-private-dns-fix): Fix coreDNS private DNS resolving
- [ioBroker](charts/iobroker): Home automation ioBroker
- [longhorn-backup-config](charts/longhorn-backup-config): Longhorn backup configuration (CRD)
- [network-tools](charts/network-tools): Multi-Pod network debugging tools
- [nist-data-mirror (deprecated)](charts/nist-data-mirror)

## Releasing
Expand Down
12 changes: 12 additions & 0 deletions charts/network-tools/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: network-tools
description: Debugging Tools / Pods
version: 0.1.0
apiVersion: v2
appVersion: 1.0.0
keywords:
- network
- tools
- development
sources:
- https://github.com/EugenMayer/helm-charts/tree/main/charts/network-tools
home: ttps://github.com/EugenMayer/helm-charts/tree/main/charts/network-tools
9 changes: 9 additions & 0 deletions charts/network-tools/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

apt update
apt install -y curl wget iperf3 inetutils-ping telnet dnsutils procps

echo "run iperf3 on port 5201"
exec iperf3 -s -p 5201
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: boostrap-wrapper-script
data:
{{ (.Files.Glob "scripts/bootstrap.sh").AsConfig | indent 2 }}
65 changes: 65 additions & 0 deletions charts/network-tools/templates/debian-morty-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{{- if .Values.pods.morty.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: debian-morty
namespace: {{ .Release.Namespace }}
labels:
kontextwork.de/app: debian
kontextwork.de/project: network-tools
spec:
replicas: 1
selector:
matchLabels:
pickle: morty
kontextwork.de/app: debian
kontextwork.de/project: network-tools
template:
metadata:
labels:
pickle: morty
kontextwork.de/app: debian
kontextwork.de/project: network-tools
spec:
containers:
- name: debian-morty
image: debian:bullseye
command: ["/bin/bash"]
args: ["/custom-scripts/bootstrap.sh"]
volumeMounts:
- name: boostrap-wrapper-script
mountPath: /custom-scripts
{{- if and .Values.persistence.enabled }}
- mountPath: /mnt
name: tmp
{{ end }}
ports:
- name: iperf3
containerPort: 5201
protocol: TCP
{{- if and .Values.strictPodPlacement.enabled }}
nodeName: {{ .Values.strictPodPlacement.mortyAgent }}
{{ else }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: pickle
operator: In
values:
- morty
topologyKey: beta.kubernetes.io/instance-type
{{ end }}
volumes:
{{- if and .Values.persistence.enabled }}
- name: tmp
persistentVolumeClaim:
claimName: network-tools-storage-tmp
{{ end }}
- name: boostrap-wrapper-script
configMap:
name: boostrap-wrapper-script
{{- end }}
65 changes: 65 additions & 0 deletions charts/network-tools/templates/debian-rick-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{{- if .Values.pods.ricl.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: debian-rick
namespace: {{ .Release.Namespace }}
labels:
kontextwork.de/app: debian
kontextwork.de/project: network-tools
spec:
replicas: 1
selector:
matchLabels:
pickle: rick
kontextwork.de/app: debian
kontextwork.de/project: network-tools
template:
metadata:
labels:
pickle: rick
kontextwork.de/app: debian
kontextwork.de/project: network-tools
spec:
containers:
- name: debian-rick
image: debian:bullseye
command: ["/bin/bash"]
args: ["/custom-scripts/bootstrap.sh"]
volumeMounts:
- name: boostrap-wrapper-script
mountPath: /custom-scripts
{{- if and .Values.persistence.enabled }}
- mountPath: /mnt
name: tmp
{{ end }}
ports:
- name: iperf3
containerPort: 5201
protocol: TCP
{{- if and .Values.strictPodPlacement.enabled }}
nodeName: {{ .Values.strictPodPlacement.rickAgent }}
{{ else }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: pickle
operator: In
values:
- morty
topologyKey: beta.kubernetes.io/instance-type
{{ end }}
volumes:
{{- if and .Values.persistence.enabled }}
- name: tmp
persistentVolumeClaim:
claimName: network-tools-storage-tmp
{{ end }}
- name: boostrap-wrapper-script
configMap:
name: boostrap-wrapper-script
{{- end }}
18 changes: 18 additions & 0 deletions charts/network-tools/templates/iperf-morty-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if and .Values.service.enabled .Values.pods.morty.enabled -}}
---
apiVersion: v1
kind: Service
metadata:
name: morty
spec:
type: ClusterIP
ports:
- port: 5201
targetPort: 5201
protocol: TCP
name: iperf3
selector:
pickle: morty
kontextwork.de/app: debian
kontextwork.de/project: network-tools
{{- end }}
18 changes: 18 additions & 0 deletions charts/network-tools/templates/iperf-rick-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if and .Values.service.enabled .Values.pods.rick.enabled -}}
---
apiVersion: v1
kind: Service
metadata:
name: rick
spec:
type: ClusterIP
ports:
- port: 5201
targetPort: 5201
protocol: TCP
name: iperf3
selector:
pickle: rick
kontextwork.de/app: debian
kontextwork.de/project: network-tools
{{- end }}
15 changes: 15 additions & 0 deletions charts/network-tools/templates/storage-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and .Values.persistence.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
kontextwork.de/project: {{.Release.Name}}
name: network-tools-storage-tmp
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 5Gi
{{ end }}
18 changes: 18 additions & 0 deletions charts/network-tools/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
persistence:
# If enabled, create a volume for /mnt
enabled: true

service:
# If enabled, exposes the iperf servers via services
enabled: true

pods:
rick:
enabled: true # enable or disable the rick pod
morty:
enabled: true # enable or disable the morty pod
strictPodPlacement:
# if enabled, schedule the pods on specific nodes
enabled: false
rickAgent: prod-rke-agent-1
mortyAgent: prod-rke-agent-2

0 comments on commit aaa7b80

Please sign in to comment.