From 27c2be9cdd5ae35c27be9aba33835297a56ec78b Mon Sep 17 00:00:00 2001 From: Mans Ziesel Date: Sun, 22 Sep 2024 11:59:10 +0200 Subject: [PATCH] change whoami app to kustomize --- ...luster-role.yaml => 000-cluster-role.yaml} | 0 traefik/base/000-namespace.yaml | 4 --- ...ole-binding.yaml => 000-role-binding.yaml} | 1 - ...-account.yaml => 001-service-account.yaml} | 0 traefik/base/002-traefik-services.yaml | 14 ++++++++++ .../{003-traefik.yaml => 002-traefik.yaml} | 0 traefik/base/003-traefik-services.yaml | 27 ------------------- whoami/{ => base}/whoami-deployment.yaml | 0 whoami/{ => base}/whoami-ingress.yaml | 1 - whoami/{ => base}/whoami-namespace.yaml | 0 whoami/{ => base}/whoami-svc.yaml | 0 whoami/kustomization.yaml | 10 +++++++ 12 files changed, 24 insertions(+), 33 deletions(-) rename traefik/base/{001-cluster-role.yaml => 000-cluster-role.yaml} (100%) delete mode 100644 traefik/base/000-namespace.yaml rename traefik/base/{001-role-binding.yaml => 000-role-binding.yaml} (91%) rename traefik/base/{002-service-account.yaml => 001-service-account.yaml} (100%) create mode 100644 traefik/base/002-traefik-services.yaml rename traefik/base/{003-traefik.yaml => 002-traefik.yaml} (100%) delete mode 100644 traefik/base/003-traefik-services.yaml rename whoami/{ => base}/whoami-deployment.yaml (100%) rename whoami/{ => base}/whoami-ingress.yaml (92%) rename whoami/{ => base}/whoami-namespace.yaml (100%) rename whoami/{ => base}/whoami-svc.yaml (100%) create mode 100644 whoami/kustomization.yaml diff --git a/traefik/base/001-cluster-role.yaml b/traefik/base/000-cluster-role.yaml similarity index 100% rename from traefik/base/001-cluster-role.yaml rename to traefik/base/000-cluster-role.yaml diff --git a/traefik/base/000-namespace.yaml b/traefik/base/000-namespace.yaml deleted file mode 100644 index c088a91..0000000 --- a/traefik/base/000-namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: traefik diff --git a/traefik/base/001-role-binding.yaml b/traefik/base/000-role-binding.yaml similarity index 91% rename from traefik/base/001-role-binding.yaml rename to traefik/base/000-role-binding.yaml index ea193bb..fa6c088 100644 --- a/traefik/base/001-role-binding.yaml +++ b/traefik/base/000-role-binding.yaml @@ -10,4 +10,3 @@ roleRef: subjects: - kind: ServiceAccount name: traefik-account - namespace: traefik diff --git a/traefik/base/002-service-account.yaml b/traefik/base/001-service-account.yaml similarity index 100% rename from traefik/base/002-service-account.yaml rename to traefik/base/001-service-account.yaml diff --git a/traefik/base/002-traefik-services.yaml b/traefik/base/002-traefik-services.yaml new file mode 100644 index 0000000..2327d04 --- /dev/null +++ b/traefik/base/002-traefik-services.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: traefik-service + +spec: + type: LoadBalancer + ports: + - targetPort: web + port: 80 + - targetPort: dashboard + port: 8080 + selector: + app: traefik diff --git a/traefik/base/003-traefik.yaml b/traefik/base/002-traefik.yaml similarity index 100% rename from traefik/base/003-traefik.yaml rename to traefik/base/002-traefik.yaml diff --git a/traefik/base/003-traefik-services.yaml b/traefik/base/003-traefik-services.yaml deleted file mode 100644 index f4b644f..0000000 --- a/traefik/base/003-traefik-services.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: traefik-dashboard-service - namespace: traefik - -spec: - type: LoadBalancer - ports: - - port: 8080 - targetPort: dashboard - selector: - app: traefik ---- -apiVersion: v1 -kind: Service -metadata: - name: traefik-web-service - namespace: traefik - -spec: - type: LoadBalancer - ports: - - targetPort: web - port: 80 - selector: - app: traefik diff --git a/whoami/whoami-deployment.yaml b/whoami/base/whoami-deployment.yaml similarity index 100% rename from whoami/whoami-deployment.yaml rename to whoami/base/whoami-deployment.yaml diff --git a/whoami/whoami-ingress.yaml b/whoami/base/whoami-ingress.yaml similarity index 92% rename from whoami/whoami-ingress.yaml rename to whoami/base/whoami-ingress.yaml index 2ddd2ea..a386e1c 100644 --- a/whoami/whoami-ingress.yaml +++ b/whoami/base/whoami-ingress.yaml @@ -2,7 +2,6 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: whoami-ingress - namespace: traefik spec: rules: - http: diff --git a/whoami/whoami-namespace.yaml b/whoami/base/whoami-namespace.yaml similarity index 100% rename from whoami/whoami-namespace.yaml rename to whoami/base/whoami-namespace.yaml diff --git a/whoami/whoami-svc.yaml b/whoami/base/whoami-svc.yaml similarity index 100% rename from whoami/whoami-svc.yaml rename to whoami/base/whoami-svc.yaml diff --git a/whoami/kustomization.yaml b/whoami/kustomization.yaml new file mode 100644 index 0000000..69038cd --- /dev/null +++ b/whoami/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: whoami + +resources: +- ./base/namespace.yaml +- ./base/whoami-deployment.yaml +- ./base/whoami-svc.yaml.yaml +- ./base/whoami-ingress.yaml