From 6288d0faa2c7e532846a85fcc941b6f020744b6f Mon Sep 17 00:00:00 2001 From: Christian Lempa Date: Fri, 8 Nov 2024 10:29:27 +0100 Subject: [PATCH] update traefik kubernetes templates --- kubernetes/examples/example-deployment.yaml | 22 +++++++++++++++++++ kubernetes/examples/example-service.yaml | 12 ++++++++++ kubernetes/portainer/values.yml | 14 ++++++------ .../examples/example-ingressroute.yaml | 20 +++++++++++++++++ .../examples/example-ingressroutetcp.yml | 2 +- 5 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 kubernetes/traefik/examples/example-ingressroute.yaml diff --git a/kubernetes/examples/example-deployment.yaml b/kubernetes/examples/example-deployment.yaml index e69de29..b7d6417 100644 --- a/kubernetes/examples/example-deployment.yaml +++ b/kubernetes/examples/example-deployment.yaml @@ -0,0 +1,22 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: example-deployment + namespace: your-namespace + labels: + app: example-app +spec: + replicas: 3 # how many pods? + selector: + matchLabels: + app: example-app + template: + metadata: + labels: + app: example-app + spec: + containers: + - name: nginx + image: nginx:latest + ports: + - containerPort: 80 diff --git a/kubernetes/examples/example-service.yaml b/kubernetes/examples/example-service.yaml index e69de29..dece911 100644 --- a/kubernetes/examples/example-service.yaml +++ b/kubernetes/examples/example-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: example-service + namespace: your-namespace +spec: + selector: + app.kubernetes.io/name: MyApp + ports: + - protocol: TCP + port: 80 + targetPort: 9376 diff --git a/kubernetes/portainer/values.yml b/kubernetes/portainer/values.yml index 96208b0..bf758e1 100644 --- a/kubernetes/portainer/values.yml +++ b/kubernetes/portainer/values.yml @@ -14,13 +14,13 @@ service: # type: ClusterIP # (Optional) Add Ingress, when using ClusterIP -# ingress: -# enabled: true -# hosts: -# - host: "portainer-test-1.kube-prod-2.home.clcreative.de" -# paths: -# - path: "/" -# port: "9000" +ingress: + enabled: true + hosts: + - host: "portainer-test-1.kube-prod-2.home.clcreative.de" + paths: + - path: "/" + port: "9000" # -- end persistence: diff --git a/kubernetes/traefik/examples/example-ingressroute.yaml b/kubernetes/traefik/examples/example-ingressroute.yaml new file mode 100644 index 0000000..4825788 --- /dev/null +++ b/kubernetes/traefik/examples/example-ingressroute.yaml @@ -0,0 +1,20 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: ingressroute + # (Optional) Namespace + # namespace: your-namespace + # --- +spec: + entryPoints: + - web + - websecure + routes: + - match: Host(`your-hostname`) + kind: Rule + services: + - name: your-service + port: 80 + # (Optional) TLS + # tls: + # secretName: your-tls-secret diff --git a/kubernetes/traefik/examples/example-ingressroutetcp.yml b/kubernetes/traefik/examples/example-ingressroutetcp.yml index cd9752b..5bb0ab4 100644 --- a/kubernetes/traefik/examples/example-ingressroutetcp.yml +++ b/kubernetes/traefik/examples/example-ingressroutetcp.yml @@ -1,4 +1,4 @@ -apiVersion: traefik.containo.us/v1alpha1 +apiVersion: traefik.io/v1alpha1 kind: IngressRouteTCP metadata: name: ingressroutetcp