diff --git a/charts/network-tools/Chart.yaml b/charts/network-tools/Chart.yaml index b276108..6bcb0ec 100644 --- a/charts/network-tools/Chart.yaml +++ b/charts/network-tools/Chart.yaml @@ -1,8 +1,8 @@ name: network-tools description: Debugging Tools / Pods -version: 0.1.1 +version: 0.2.0 apiVersion: v2 -appVersion: 1.0.0 +appVersion: 1.1.0 keywords: - network - tools @@ -10,3 +10,12 @@ keywords: sources: - https://github.com/EugenMayer/helm-charts/tree/main/charts/network-tools home: https://github.com/EugenMayer/helm-charts/tree/main/charts/network-tools +dependencies: + - name: common + # https://artifacthub.io/packages/helm/truecharts-library-charts/common + version: 20.2.0 + repository: oci://tccr.io/truecharts + condition: "" + alias: "" + tags: [] + import-values: [] diff --git a/charts/network-tools/scripts/bootstrap.sh b/charts/network-tools/scripts/bootstrap.sh deleted file mode 100644 index 595bf70..0000000 --- a/charts/network-tools/scripts/bootstrap.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/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 diff --git a/charts/network-tools/templates/boostrap-wrapper-script-configmap.yaml b/charts/network-tools/templates/boostrap-wrapper-script-configmap.yaml deleted file mode 100644 index e9c144c..0000000 --- a/charts/network-tools/templates/boostrap-wrapper-script-configmap.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: boostrap-wrapper-script -data: -{{ (.Files.Glob "scripts/bootstrap.sh").AsConfig | indent 2 }} diff --git a/charts/network-tools/templates/debian-morty-deployment.yaml b/charts/network-tools/templates/debian-morty-deployment.yaml deleted file mode 100644 index dfa71e2..0000000 --- a/charts/network-tools/templates/debian-morty-deployment.yaml +++ /dev/null @@ -1,65 +0,0 @@ -{{- 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 }} diff --git a/charts/network-tools/templates/debian-rick-deployment.yaml b/charts/network-tools/templates/debian-rick-deployment.yaml deleted file mode 100644 index d96d958..0000000 --- a/charts/network-tools/templates/debian-rick-deployment.yaml +++ /dev/null @@ -1,65 +0,0 @@ -{{- if .Values.pods.rick.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 }} diff --git a/charts/network-tools/templates/iperf-morty-svc.yaml b/charts/network-tools/templates/iperf-morty-svc.yaml deleted file mode 100644 index 9904c9b..0000000 --- a/charts/network-tools/templates/iperf-morty-svc.yaml +++ /dev/null @@ -1,18 +0,0 @@ -{{- 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 }} diff --git a/charts/network-tools/templates/iperf-rick-svc.yaml b/charts/network-tools/templates/iperf-rick-svc.yaml deleted file mode 100644 index 3e0f904..0000000 --- a/charts/network-tools/templates/iperf-rick-svc.yaml +++ /dev/null @@ -1,18 +0,0 @@ -{{- 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 }} diff --git a/charts/network-tools/templates/storage-pvc.yaml b/charts/network-tools/templates/storage-pvc.yaml deleted file mode 100644 index 3bc1f0c..0000000 --- a/charts/network-tools/templates/storage-pvc.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- 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 }} diff --git a/charts/network-tools/values.yaml b/charts/network-tools/values.yaml index 32a177f..47b423f 100644 --- a/charts/network-tools/values.yaml +++ b/charts/network-tools/values.yaml @@ -1,18 +1,61 @@ -persistence: - # If enabled, create a volume for /mnt - enabled: true +image: + repository: debian + tag: bookworm + pullPolicy: IfNotPresent + +securityContext: + container: + runAsNonRoot: false + runAsGroup: 0 + runAsUser: 0 + readOnlyRootFilesystem: false service: - # If enabled, exposes the iperf servers via services - enabled: true + main: + ports: + main: + protocol: tcp + port: 5201 + targetPort: 5201 + +workload: + main: + enabled: true + replicas: 1 + strategy: Recreate + type: Deployment + podSpec: + containers: + main: + command: + - "/bin/bash" + args: + - "-c" + - | + apt update + apt install -y curl wget iperf3 inetutils-ping telnet dnsutils procps + echo "run iperf3 on port 5201" + exec iperf3 -s -p 5201 + probes: + readiness: + port: 5201 + type: tcp + spec: + initialDelaySeconds: 10 + periodSeconds: 5 + failureThreshold: 2 + liveness: + enabled: true + type: tcp + port: 5201 + spec: + initialDelaySeconds: 15 + periodSeconds: 5 + failureThreshold: 2 +ingress: + main: + enabled: false -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 +portal: + open: + enabled: false