From 15cb2ce90349266d89c2b97766e2f323c1cd769a Mon Sep 17 00:00:00 2001 From: baschno Date: Sun, 28 Dec 2025 11:18:46 +0100 Subject: [PATCH] adding test deployment --- Metallb_Setup/justfile | 21 ++++++++++++++- Metallb_Setup/test-deployment.yaml | 43 ++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 Metallb_Setup/test-deployment.yaml diff --git a/Metallb_Setup/justfile b/Metallb_Setup/justfile index 1824584..0fb2c36 100644 --- a/Metallb_Setup/justfile +++ b/Metallb_Setup/justfile @@ -44,4 +44,23 @@ uninstall: set -euo pipefail just env::check - kubectl get namespace metallb-system &>/dev/null && kubectl delete ns metallb-system \ No newline at end of file + kubectl get namespace metallb-system &>/dev/null && kubectl delete ns metallb-system + +test-deployment: + #!/bin/bash + set -euo pipefail + just env::check + + kubectl apply -f test-deployment.yaml + + echo "Test deployment created. You can check the service with 'kubectl get svc nginx -o wide -n test'." + + echo "To clean up, run 'just test-deployment-cleanup'." + +test-deployment-cleanup: + #!/bin/bash + set -euo pipefail + just env::check + + kubectl delete -f test-deployment.yaml + echo "Test deployment and service deleted." diff --git a/Metallb_Setup/test-deployment.yaml b/Metallb_Setup/test-deployment.yaml new file mode 100644 index 0000000..afb48fe --- /dev/null +++ b/Metallb_Setup/test-deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: test + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx + namespace: test + labels: + app: nginx +spec: + replicas: 3 + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80 + +--- +apiVersion: v1 +kind: Service +metadata: + name: nginx + namespace: test +spec: + type: LoadBalancer + selector: + app: nginx + ports: + - port: 80 + targetPort: 80 + protocol: TCP