change traefik lb setup

This commit is contained in:
Mans Ziesel 2024-09-22 13:12:27 +02:00
parent e01631bc6f
commit 99610079e7
6 changed files with 25 additions and 47 deletions

View File

@ -0,0 +1,15 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ip-mzisel-nl-ingress
spec:
rules:
- http:
paths:
- path: /ip
pathType: Prefix
backend:
service:
name: ip-mziesel-nl
port:
name: web

View File

@ -3,10 +3,8 @@ kind: Service
metadata: metadata:
name: ip-mziesel-nl name: ip-mziesel-nl
spec: spec:
type: NodePort
ports: ports:
- port: 8080 - port: 80
targetPort: 8080 targetPort: 8080
nodePort: 31339
selector: selector:
app: ip-mziesel-nl app: ip-mziesel-nl

View File

@ -1,25 +1,16 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: traefik-dashboard-service name: traefik-service
spec: spec:
type: LoadBalancer type: LoadBalancer
ports: ports:
- port: 8080 - name: web
targetPort: web
port: 80
- name: dashbaord
port: 8080
targetPort: dashboard targetPort: dashboard
selector: selector:
app: traefik app: traefik
---
apiVersion: v1
kind: Service
metadata:
name: traefik-web-service
spec:
type: LoadBalancer
ports:
- targetPort: web
port: 80
selector:
app: traefik

View File

@ -22,7 +22,7 @@ spec:
args: args:
- --api.insecure - --api.insecure
- --providers.kubernetesingress - --providers.kubernetesingress
- --providers.kubernetesingress.ingressendpoint.publishedservice=traefik/traefik-web-service - --providers.kubernetesingress.ingressendpoint.publishedservice=traefik/traefik-service
ports: ports:
- name: web - name: web
containerPort: 80 containerPort: 80

View File

@ -10,6 +10,6 @@ spec:
pathType: Prefix pathType: Prefix
backend: backend:
service: service:
name: whoami-traefik name: whoami
port: port:
name: web name: web

View File

@ -1,7 +1,7 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: whoami-nodeport name: whoami
namespace: whoami namespace: whoami
spec: spec:
type: NodePort type: NodePort
@ -11,29 +11,3 @@ spec:
nodePort: 31338 nodePort: 31338
selector: selector:
app: whoami app: whoami
---
apiVersion: v1
kind: Service
metadata:
name: whoami-loadbalancer
namespace: whoami
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 80
selector:
app: whoami
---
apiVersion: v1
kind: Service
metadata:
name: whoami-traefik
namespace: whoami
spec:
ports:
- name: web
port: 80
targetPort: 80
selector:
app: whoami