From a92927f48150e045c1137fe6567a965c402ce913 Mon Sep 17 00:00:00 2001 From: baschno Date: Sat, 21 Dec 2024 16:22:57 +0100 Subject: [PATCH] wip thing --- Metallb_Setup/02_address_pool.yaml | 2 +- Metallb_Setup/03_advertisement.yaml | 2 +- README.md | 21 +++++++++++++++++++++ traefik_lempa/nginx-ingress.yaml | 7 +++---- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Metallb_Setup/02_address_pool.yaml b/Metallb_Setup/02_address_pool.yaml index 2561f19..3c65847 100644 --- a/Metallb_Setup/02_address_pool.yaml +++ b/Metallb_Setup/02_address_pool.yaml @@ -5,4 +5,4 @@ metadata: namespace: metallb-system spec: addresses: - - 192.168.178.230-192.168.178.250 + - 192.168.178.220-192.168.178.250 diff --git a/Metallb_Setup/03_advertisement.yaml b/Metallb_Setup/03_advertisement.yaml index c8a35e9..aa27af3 100644 --- a/Metallb_Setup/03_advertisement.yaml +++ b/Metallb_Setup/03_advertisement.yaml @@ -6,4 +6,4 @@ metadata: # can be left out, then all available addresspools will be bound spec: ipAddressPools: - - cluster-pool \ No newline at end of file + - default-address-pool \ No newline at end of file diff --git a/README.md b/README.md index 9ae6194..7b9d3c7 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,25 @@ https://k3s.rocks/metrics/ kubectl create namespace dishes kubectl create deploy schnipo --image=bschnorbus/dish-schnipo -n dishes kubectl expose deploy schnipo --port=80 --target-port=8080 --type=LoadBalancer -n dishes +``` + + +## Load Balancer Test w/ Nginx Deployment + +``` +#Create deploy +kubectl create deploy nginx --image=nginx + +kubectl scale --replicas=3 deployment/nginx -n test + +k create svc -n test clusterip nginx --tcp=80 + +#Expose the deploy as a LoadBalancer type +kubectl expose deploy nginx --port=80 --target-port=80 --type=LoadBalancer + +#Verify +kubectl get svc nginx +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +nginx LoadBalancer 10.43.60.115 192.168.52.30 80:32676/TCP 5h19m + ``` \ No newline at end of file diff --git a/traefik_lempa/nginx-ingress.yaml b/traefik_lempa/nginx-ingress.yaml index b3662ee..8ab08bf 100644 --- a/traefik_lempa/nginx-ingress.yaml +++ b/traefik_lempa/nginx-ingress.yaml @@ -1,13 +1,13 @@ apiVersion: networking.k8s.io/v1 -kind: ingress +kind: Ingress metadata: name: nginx-ingress - namespace: nginx + namespace: test annotations: traefik.ingress.kubernetes.io/router.entrypoints: websecure spec: rules: - - host: nginx.internal.schnrbs.work + - host: nginx.k8s.internal.schnrbs.work http: paths: - path: / @@ -17,4 +17,3 @@ spec: name: nginx port: number: 80 -