Merge branch 'wip'
This commit is contained in:
@@ -3,18 +3,8 @@ apiVersion: metallb.io/v1beta1
|
|||||||
kind: IPAddressPool
|
kind: IPAddressPool
|
||||||
metadata:
|
metadata:
|
||||||
name: cluster-pool
|
name: cluster-pool
|
||||||
namespace: metallb
|
namespace: metallb-system
|
||||||
spec:
|
spec:
|
||||||
addresses:
|
addresses:
|
||||||
- 192.168.178.230-192.168.178.250
|
- 192.168.178.220-192.168.178.250
|
||||||
|
|
||||||
---
|
|
||||||
# L2 configuration
|
|
||||||
apiVersion: metallb.io/v1beta1
|
|
||||||
kind: L2Advertisement
|
|
||||||
metadata:
|
|
||||||
name: metallb-homelab
|
|
||||||
namespace: metallb
|
|
||||||
spec:
|
|
||||||
ipAddressPools:
|
|
||||||
- cluster-pool
|
|
||||||
@@ -47,6 +47,6 @@ service:
|
|||||||
annotations: {}
|
annotations: {}
|
||||||
labels: {}
|
labels: {}
|
||||||
spec:
|
spec:
|
||||||
loadBalancerIP: 192.168.178.231 # IP in the MetalLB range from metallb config.yaml
|
loadBalancerIP: 192.168.178.220 # IP in the MetalLB range from metallb config.yaml
|
||||||
loadBalancerSourceRanges: []
|
loadBalancerSourceRanges: []
|
||||||
externalIPs: []
|
externalIPs: []
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
apiVersion: traefik.containo.us/v1alpha1
|
apiVersion: traefik.traefik.io/v1alpha1
|
||||||
kind: Middleware
|
kind: Middleware
|
||||||
metadata:
|
metadata:
|
||||||
name: default-headers
|
name: default-headers
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ metadata:
|
|||||||
namespace: traefik
|
namespace: traefik
|
||||||
type: Opaque
|
type: Opaque
|
||||||
data:
|
data:
|
||||||
users: cG9wZTokYXByMSRCNTVxbUFoWSRLS3BDVmJvUUd5VTFnOVg4WVpiUXAvCgo=
|
users: YmFzdGk6JGFwcjEkR0xuMHNBeW4kUlVPYWpTSHo4UHg4eGhvZDM0M3dHMAoK
|
||||||
@@ -5,4 +5,4 @@ metadata:
|
|||||||
namespace: metallb-system
|
namespace: metallb-system
|
||||||
spec:
|
spec:
|
||||||
addresses:
|
addresses:
|
||||||
- 192.168.178.230-192.168.178.250
|
- 192.168.178.220-192.168.178.250
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ metadata:
|
|||||||
# can be left out, then all available addresspools will be bound
|
# can be left out, then all available addresspools will be bound
|
||||||
spec:
|
spec:
|
||||||
ipAddressPools:
|
ipAddressPools:
|
||||||
- fdefault-address-pool
|
- default-address-pool
|
||||||
35
README.md
35
README.md
@@ -1,5 +1,12 @@
|
|||||||
Current Setup
|
Current Setup
|
||||||
|
|
||||||
|
01 Metallb
|
||||||
|
Define IP Pool & L2 config
|
||||||
|
|
||||||
|
https://metallb.universe.tf/configuration/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
https://ryan-pope.com/posts/Homelab-to-k3s/
|
https://ryan-pope.com/posts/Homelab-to-k3s/
|
||||||
|
|
||||||
https://blog.chicho.com.ar/how-to-deploy-a-kubernetes-cluster-with-k3s/
|
https://blog.chicho.com.ar/how-to-deploy-a-kubernetes-cluster-with-k3s/
|
||||||
@@ -7,3 +14,31 @@ https://blog.chicho.com.ar/how-to-deploy-a-kubernetes-cluster-with-k3s/
|
|||||||
https://picluster.ricsanfre.com/docs/traefik/
|
https://picluster.ricsanfre.com/docs/traefik/
|
||||||
|
|
||||||
https://k3s.rocks/metrics/
|
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
|
||||||
|
|
||||||
|
```
|
||||||
19
traefik_lempa/nginx-ingress.yaml
Normal file
19
traefik_lempa/nginx-ingress.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: nginx-ingress
|
||||||
|
namespace: test
|
||||||
|
annotations:
|
||||||
|
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: nginx.k8s.internal.schnrbs.work
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: nginx
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
5
traefik_lempa/traefik-values.yaml
Normal file
5
traefik_lempa/traefik-values.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
ports:
|
||||||
|
web:
|
||||||
|
redirectTo:
|
||||||
|
port: websecure
|
||||||
|
|
||||||
Reference in New Issue
Block a user