From c0246a712b37eec2376171128c4d0d83fb3f029e Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Wed, 11 May 2022 01:24:25 +0200 Subject: [PATCH] Add traefik load-balancer draft --- traefik-lb/deployment.yaml | 37 +++++++++++++++++++++++++++++++++ traefik-lb/service-account.yaml | 4 ++++ traefik-lb/service.yaml | 32 ++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 traefik-lb/deployment.yaml create mode 100644 traefik-lb/service-account.yaml create mode 100644 traefik-lb/service.yaml diff --git a/traefik-lb/deployment.yaml b/traefik-lb/deployment.yaml new file mode 100644 index 0000000..c13d52b --- /dev/null +++ b/traefik-lb/deployment.yaml @@ -0,0 +1,37 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: traefik + labels: + app: traefik + +spec: + replicas: 1 + selector: + matchLabels: + app: traefik + template: + metadata: + labels: + app: traefik + spec: + serviceAccountName: traefik-ingress-controller + containers: + - name: traefik + image: traefik:v2.7 + args: + - --log.level=DEBUG + - --api + - --api.insecure + - --entrypoints.web.address=:80 + - --entrypoints.udpep.address=:25565/udp + - --providers.kubernetescrd + ports: + - name: web + containerPort: 80 + - name: admin + containerPort: 8080 + - name: udpep + containerPort: 25565 + + diff --git a/traefik-lb/service-account.yaml b/traefik-lb/service-account.yaml new file mode 100644 index 0000000..8a31290 --- /dev/null +++ b/traefik-lb/service-account.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: traefik-ingress-controller diff --git a/traefik-lb/service.yaml b/traefik-lb/service.yaml new file mode 100644 index 0000000..f801c4a --- /dev/null +++ b/traefik-lb/service.yaml @@ -0,0 +1,32 @@ +apiVersion: v1 +kind: Service +metadata: + name: traefi +spec: + type: LoadBalancer + selector: + app: traefik + ports: + - protocol: TCP + port: 80 + name: web + targetPort: 80 + - protocol: TCP + port: 8080 + name: admin + targetPort: 8080 + +--- +apiVersion: v1 +kind: Service +metadata: + name: traefikudp +spec: + type: LoadBalancer + selector: + app: traefik + ports: + - protocol: UDP + port: 25565 + name: udpep + targetPort: 25565