From 4f72173df7801b5135b69d6976f0c81e6e11b091 Mon Sep 17 00:00:00 2001 From: Steffen Illium Date: Thu, 4 Apr 2024 08:00:25 +0200 Subject: [PATCH] moved node/pod-selector to components --- apps/adguard/kustomization.yaml | 8 +++----- apps/gitea/kustomization.yaml | 6 ++---- apps/kube-dashboard/kustomization.yaml | 6 +++--- apps/newcloud/kustomization.yaml | 3 +++ apps/nextcloud/kustomization.yaml | 6 ++---- apps/nextcloud/patches/nodeselector.yaml | 9 --------- apps/paperless/kustomization.yaml | 3 +++ apps/vaultwarden/kustomization.yaml | 6 ++---- apps/vaultwarden/patches/nodeselector.yaml | 9 --------- .../kustomization.yaml | 11 +++++++++++ .../nodeselector.yaml | 0 .../podselector.yaml | 0 .../local-region-selector.yaml/kustomization.yaml | 11 +++++++++++ .../local-region-selector.yaml}/nodeselector.yaml | 0 .../local-region-selector.yaml/podselector.yaml | 6 ++---- infrastructure/02-argocd/kustomization.yaml | 6 +++--- infrastructure/02-argocd/patches/nodeselector.yaml | 9 --------- .../03-traefik/overlay-external/kustomization.yaml | 6 +++--- .../overlay-external/patches/nodeselector.yaml | 9 --------- .../03-traefik/overlay-internal/kustomization.yaml | 6 +++--- .../overlay-internal/patches/nodeselector.yaml | 9 --------- infrastructure/04-longhorn/kustomization.yaml | 12 +++--------- infrastructure/04-longhorn/patches/nodeselector.yaml | 9 --------- 23 files changed, 54 insertions(+), 96 deletions(-) delete mode 100644 apps/nextcloud/patches/nodeselector.yaml delete mode 100644 apps/vaultwarden/patches/nodeselector.yaml create mode 100644 components/front-region-selector.yaml copy/kustomization.yaml rename {apps/adguard/patches => components/front-region-selector.yaml copy}/nodeselector.yaml (100%) rename {infrastructure/04-longhorn/patches => components/front-region-selector.yaml copy}/podselector.yaml (100%) create mode 100644 components/local-region-selector.yaml/kustomization.yaml rename {apps/gitea/patches => components/local-region-selector.yaml}/nodeselector.yaml (100%) rename apps/kube-dashboard/patches/nodeselector.yaml => components/local-region-selector.yaml/podselector.yaml (55%) delete mode 100644 infrastructure/02-argocd/patches/nodeselector.yaml delete mode 100644 infrastructure/03-traefik/overlay-external/patches/nodeselector.yaml delete mode 100644 infrastructure/03-traefik/overlay-internal/patches/nodeselector.yaml delete mode 100644 infrastructure/04-longhorn/patches/nodeselector.yaml diff --git a/apps/adguard/kustomization.yaml b/apps/adguard/kustomization.yaml index 4bb9488..5d73fb5 100644 --- a/apps/adguard/kustomization.yaml +++ b/apps/adguard/kustomization.yaml @@ -1,6 +1,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization +components: + - ../../components/local-region-selector.yaml + namespace: adguard resources: @@ -10,8 +13,3 @@ resources: - base/adguard-namespace.yaml # - base/adguard-pvc.yaml - base/adguard-service.yaml - -patches: -- path: patches/nodeselector.yaml - target: - kind: (StatefulSet|Deployment|Job) \ No newline at end of file diff --git a/apps/gitea/kustomization.yaml b/apps/gitea/kustomization.yaml index 817aaeb..9e0f8df 100644 --- a/apps/gitea/kustomization.yaml +++ b/apps/gitea/kustomization.yaml @@ -10,7 +10,5 @@ resources: # - base/gitea-data-pvc.yaml - base/gitea-namespace.yaml -patches: -- path: patches/nodeselector.yaml - target: - kind: (StatefulSet|Deployment|Job) \ No newline at end of file +components: + - ../../components/local-region-selector.yaml \ No newline at end of file diff --git a/apps/kube-dashboard/kustomization.yaml b/apps/kube-dashboard/kustomization.yaml index 13fecca..162fd56 100644 --- a/apps/kube-dashboard/kustomization.yaml +++ b/apps/kube-dashboard/kustomization.yaml @@ -13,6 +13,6 @@ resources: patches: - path: patches/dashboard-insecure-access.yaml - path: patches/dashboard-insecure-service.yaml -- path: patches/nodeselector.yaml - target: - kind: (StatefulSet|Deployment|Job) \ No newline at end of file + +components: + - ../../components/local-region-selector.yaml \ No newline at end of file diff --git a/apps/newcloud/kustomization.yaml b/apps/newcloud/kustomization.yaml index ca05037..3cc551f 100644 --- a/apps/newcloud/kustomization.yaml +++ b/apps/newcloud/kustomization.yaml @@ -5,3 +5,6 @@ namespace: nextcloud resources: - base + +components: + - ../../components/local-region-selector.yaml \ No newline at end of file diff --git a/apps/nextcloud/kustomization.yaml b/apps/nextcloud/kustomization.yaml index 0224da3..7b0555a 100644 --- a/apps/nextcloud/kustomization.yaml +++ b/apps/nextcloud/kustomization.yaml @@ -16,7 +16,5 @@ helmCharts: valuesFile: base/values.yaml releaseName: lcl -patches: -- path: patches/nodeselector.yaml - target: - kind: (StatefulSet|Deployment|Job) \ No newline at end of file +components: + - ../../components/local-region-selector.yaml diff --git a/apps/nextcloud/patches/nodeselector.yaml b/apps/nextcloud/patches/nodeselector.yaml deleted file mode 100644 index 9391e7e..0000000 --- a/apps/nextcloud/patches/nodeselector.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: apps/v1 -kind: not-important -metadata: - name: not-important -spec: - template: - spec: - nodeSelector: - region: local \ No newline at end of file diff --git a/apps/paperless/kustomization.yaml b/apps/paperless/kustomization.yaml index a307bea..4f6fa9b 100644 --- a/apps/paperless/kustomization.yaml +++ b/apps/paperless/kustomization.yaml @@ -14,3 +14,6 @@ resources: - base/webserver-service.yaml - base/webserver.yaml - base/paperless-namespace.yaml + +components: + - ../../components/local-region-selector.yaml diff --git a/apps/vaultwarden/kustomization.yaml b/apps/vaultwarden/kustomization.yaml index 9d51f60..ef69374 100644 --- a/apps/vaultwarden/kustomization.yaml +++ b/apps/vaultwarden/kustomization.yaml @@ -11,7 +11,5 @@ resources: - base/vaultwarden-secret-sealed.yaml - base/vaultwarden-service.yaml -patches: -- path: patches/nodeselector.yaml - target: - kind: (StatefulSet|Deployment|Job) \ No newline at end of file +components: + - ../../components/local-region-selector.yaml \ No newline at end of file diff --git a/apps/vaultwarden/patches/nodeselector.yaml b/apps/vaultwarden/patches/nodeselector.yaml deleted file mode 100644 index 9391e7e..0000000 --- a/apps/vaultwarden/patches/nodeselector.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: apps/v1 -kind: not-important -metadata: - name: not-important -spec: - template: - spec: - nodeSelector: - region: local \ No newline at end of file diff --git a/components/front-region-selector.yaml copy/kustomization.yaml b/components/front-region-selector.yaml copy/kustomization.yaml new file mode 100644 index 0000000..171eb05 --- /dev/null +++ b/components/front-region-selector.yaml copy/kustomization.yaml @@ -0,0 +1,11 @@ + +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +patches: +- path: nodeselector.yaml + target: + kind: (StatefulSet|Deployment|Job) +- path: podselector.yaml + target: + kind: Pod diff --git a/apps/adguard/patches/nodeselector.yaml b/components/front-region-selector.yaml copy/nodeselector.yaml similarity index 100% rename from apps/adguard/patches/nodeselector.yaml rename to components/front-region-selector.yaml copy/nodeselector.yaml diff --git a/infrastructure/04-longhorn/patches/podselector.yaml b/components/front-region-selector.yaml copy/podselector.yaml similarity index 100% rename from infrastructure/04-longhorn/patches/podselector.yaml rename to components/front-region-selector.yaml copy/podselector.yaml diff --git a/components/local-region-selector.yaml/kustomization.yaml b/components/local-region-selector.yaml/kustomization.yaml new file mode 100644 index 0000000..171eb05 --- /dev/null +++ b/components/local-region-selector.yaml/kustomization.yaml @@ -0,0 +1,11 @@ + +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +patches: +- path: nodeselector.yaml + target: + kind: (StatefulSet|Deployment|Job) +- path: podselector.yaml + target: + kind: Pod diff --git a/apps/gitea/patches/nodeselector.yaml b/components/local-region-selector.yaml/nodeselector.yaml similarity index 100% rename from apps/gitea/patches/nodeselector.yaml rename to components/local-region-selector.yaml/nodeselector.yaml diff --git a/apps/kube-dashboard/patches/nodeselector.yaml b/components/local-region-selector.yaml/podselector.yaml similarity index 55% rename from apps/kube-dashboard/patches/nodeselector.yaml rename to components/local-region-selector.yaml/podselector.yaml index 9391e7e..6b50aa6 100644 --- a/apps/kube-dashboard/patches/nodeselector.yaml +++ b/components/local-region-selector.yaml/podselector.yaml @@ -3,7 +3,5 @@ kind: not-important metadata: name: not-important spec: - template: - spec: - nodeSelector: - region: local \ No newline at end of file + nodeSelector: + region: local \ No newline at end of file diff --git a/infrastructure/02-argocd/kustomization.yaml b/infrastructure/02-argocd/kustomization.yaml index a7aab96..68ebfc0 100644 --- a/infrastructure/02-argocd/kustomization.yaml +++ b/infrastructure/02-argocd/kustomization.yaml @@ -3,6 +3,9 @@ kind: Kustomization namespace: argocd +components: + - ../../components/local-region-selector.yaml + resources: # Base functionality - base/argo-cd-k-with-helm.yaml @@ -13,6 +16,3 @@ patches: - path: patches/argocd-server-service.yaml - path: patches/argocd-cm-patch.yaml - path: patches/argocd-cmd-params-cm.yaml -- path: patches/nodeselector.yaml - target: - kind: (StatefulSet|Deployment|Job) diff --git a/infrastructure/02-argocd/patches/nodeselector.yaml b/infrastructure/02-argocd/patches/nodeselector.yaml deleted file mode 100644 index 9391e7e..0000000 --- a/infrastructure/02-argocd/patches/nodeselector.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: apps/v1 -kind: not-important -metadata: - name: not-important -spec: - template: - spec: - nodeSelector: - region: local \ No newline at end of file diff --git a/infrastructure/03-traefik/overlay-external/kustomization.yaml b/infrastructure/03-traefik/overlay-external/kustomization.yaml index 5923eb9..3a91415 100644 --- a/infrastructure/03-traefik/overlay-external/kustomization.yaml +++ b/infrastructure/03-traefik/overlay-external/kustomization.yaml @@ -5,6 +5,9 @@ namespace: traefik namePrefix: front- +components: + - ../../components/front-region-selector.yaml + resources: - ../base @@ -12,6 +15,3 @@ resources: patches: - path: patches/traefik-service-patch.yaml - path: patches/traefik-deployment-patch.yaml - - path: patches/nodeselector.yaml - target: - kind: (StatefulSet|Deployment|Job) \ No newline at end of file diff --git a/infrastructure/03-traefik/overlay-external/patches/nodeselector.yaml b/infrastructure/03-traefik/overlay-external/patches/nodeselector.yaml deleted file mode 100644 index 29cb9d8..0000000 --- a/infrastructure/03-traefik/overlay-external/patches/nodeselector.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: apps/v1 -kind: not-important -metadata: - name: not-important -spec: - template: - spec: - nodeSelector: - region: front \ No newline at end of file diff --git a/infrastructure/03-traefik/overlay-internal/kustomization.yaml b/infrastructure/03-traefik/overlay-internal/kustomization.yaml index 82f89fd..49a0466 100644 --- a/infrastructure/03-traefik/overlay-internal/kustomization.yaml +++ b/infrastructure/03-traefik/overlay-internal/kustomization.yaml @@ -5,12 +5,12 @@ namespace: traefik namePrefix: local- +components: + - ../../components/local-region-selector.yaml + resources: - traefik-ingress-dashboard-local.yaml - ../base patches: - path: patches/traefik-service-patch.yaml - - path: patches/nodeselector.yaml - target: - kind: (StatefulSet|Deployment|Job) \ No newline at end of file diff --git a/infrastructure/03-traefik/overlay-internal/patches/nodeselector.yaml b/infrastructure/03-traefik/overlay-internal/patches/nodeselector.yaml deleted file mode 100644 index 9391e7e..0000000 --- a/infrastructure/03-traefik/overlay-internal/patches/nodeselector.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: apps/v1 -kind: not-important -metadata: - name: not-important -spec: - template: - spec: - nodeSelector: - region: local \ No newline at end of file diff --git a/infrastructure/04-longhorn/kustomization.yaml b/infrastructure/04-longhorn/kustomization.yaml index ef217ef..2419e6c 100644 --- a/infrastructure/04-longhorn/kustomization.yaml +++ b/infrastructure/04-longhorn/kustomization.yaml @@ -3,6 +3,9 @@ kind: Kustomization namespace: longhorn-system +components: + - ../../components/local-region-selector.yaml + resources: - base/longhorn-ui-ingress.yaml @@ -12,12 +15,3 @@ helmCharts: version: 1.6.0 repo: https://charts.longhorn.io valuesFile: base/values.yaml - -patches: -- path: patches/nodeselector.yaml - target: - kind: (StatefulSet|Deployment|Job) -- path: patches/podselector.yaml - target: - kind: Pod - diff --git a/infrastructure/04-longhorn/patches/nodeselector.yaml b/infrastructure/04-longhorn/patches/nodeselector.yaml deleted file mode 100644 index 9391e7e..0000000 --- a/infrastructure/04-longhorn/patches/nodeselector.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: apps/v1 -kind: not-important -metadata: - name: not-important -spec: - template: - spec: - nodeSelector: - region: local \ No newline at end of file