From cc860d1fc9b74c3b0579a80d744ec8e0ae80d4fa Mon Sep 17 00:00:00 2001 From: Steffen Illium Date: Thu, 28 Mar 2024 21:14:20 +0100 Subject: [PATCH] nodeselector pathces --- apps/adguard/base/adguard-deployment.yaml | 1 + apps/adguard/kustomization.yaml | 5 +++++ apps/adguard/patches/nodeselector.yaml | 9 +++++++++ apps/gitea/kustomization.yaml | 5 +++++ apps/gitea/patches/nodeselector.yaml | 9 +++++++++ apps/kube-dashboard/kustomization.yaml | 5 ++++- apps/kube-dashboard/patches/nodeselector.yaml | 9 +++++++++ apps/nextcloud/kustomization.yaml | 5 +++++ apps/nextcloud/patches/nodeselector.yaml | 9 +++++++++ apps/vaultwarden/kustomization.yaml | 5 +++++ apps/vaultwarden/patches/nodeselector.yaml | 9 +++++++++ ...-ui-ingress.yaml => 0-argo-cd-ui-ingress.yaml} | 0 infrastructure/02-argocd/kustomization.yaml | 3 +++ .../02-argocd/patches/nodeselector.yaml | 9 +++++++++ infrastructure/03-traefik/kustomization.yaml | 5 +++++ .../03-traefik/patches/nodeselector.yaml | 9 +++++++++ infrastructure/04-longhorn/kustomization.yaml | 5 +++++ .../04-longhorn/patches/nodeselector.yaml | 8 ++++++++ infrastructure/05-cert-manager/kustomization.yaml | 5 +++++ .../05-cert-manager/patches/nodeselector.yaml | 9 +++++++++ projects/website/base/nodeselector.yaml | 9 +++++++++ .../base/website-deployment.yaml} | 14 ++++++++------ projects/website/base/website-ingress.yaml | 15 +++++++++++++++ projects/website/base/website-namespace.yaml | 4 ++++ projects/website/base/website-service.yaml | 13 +++++++++++++ projects/website/kustomization.yaml | 15 +++++++++++++++ 26 files changed, 187 insertions(+), 7 deletions(-) create mode 100644 apps/adguard/patches/nodeselector.yaml create mode 100644 apps/gitea/patches/nodeselector.yaml create mode 100644 apps/kube-dashboard/patches/nodeselector.yaml create mode 100644 apps/nextcloud/patches/nodeselector.yaml create mode 100644 apps/vaultwarden/patches/nodeselector.yaml rename infrastructure/{argo-cd-ui-ingress.yaml => 0-argo-cd-ui-ingress.yaml} (100%) create mode 100644 infrastructure/02-argocd/patches/nodeselector.yaml create mode 100644 infrastructure/03-traefik/patches/nodeselector.yaml create mode 100644 infrastructure/04-longhorn/patches/nodeselector.yaml create mode 100644 infrastructure/05-cert-manager/patches/nodeselector.yaml create mode 100644 projects/website/base/nodeselector.yaml rename projects/{website.yaml => website/base/website-deployment.yaml} (51%) create mode 100644 projects/website/base/website-ingress.yaml create mode 100644 projects/website/base/website-namespace.yaml create mode 100644 projects/website/base/website-service.yaml create mode 100644 projects/website/kustomization.yaml diff --git a/apps/adguard/base/adguard-deployment.yaml b/apps/adguard/base/adguard-deployment.yaml index c061bd4..bc99e04 100644 --- a/apps/adguard/base/adguard-deployment.yaml +++ b/apps/adguard/base/adguard-deployment.yaml @@ -34,6 +34,7 @@ spec: volumeMounts: - name: adguard-pvc mountPath: /opt/adguardhome/work + resources: {} volumes: - name: adguard-pvc persistentVolumeClaim: diff --git a/apps/adguard/kustomization.yaml b/apps/adguard/kustomization.yaml index 33a09c0..28ca329 100644 --- a/apps/adguard/kustomization.yaml +++ b/apps/adguard/kustomization.yaml @@ -10,3 +10,8 @@ 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/adguard/patches/nodeselector.yaml b/apps/adguard/patches/nodeselector.yaml new file mode 100644 index 0000000..9391e7e --- /dev/null +++ b/apps/adguard/patches/nodeselector.yaml @@ -0,0 +1,9 @@ +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/gitea/kustomization.yaml b/apps/gitea/kustomization.yaml index 16a3468..d68c936 100644 --- a/apps/gitea/kustomization.yaml +++ b/apps/gitea/kustomization.yaml @@ -9,3 +9,8 @@ resources: - base/gitea-deployment.yaml - 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 diff --git a/apps/gitea/patches/nodeselector.yaml b/apps/gitea/patches/nodeselector.yaml new file mode 100644 index 0000000..9391e7e --- /dev/null +++ b/apps/gitea/patches/nodeselector.yaml @@ -0,0 +1,9 @@ +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/kube-dashboard/kustomization.yaml b/apps/kube-dashboard/kustomization.yaml index 707f7f5..13fecca 100644 --- a/apps/kube-dashboard/kustomization.yaml +++ b/apps/kube-dashboard/kustomization.yaml @@ -12,4 +12,7 @@ resources: patches: - path: patches/dashboard-insecure-access.yaml -- path: patches/dashboard-insecure-service.yaml \ No newline at end of file +- path: patches/dashboard-insecure-service.yaml +- path: patches/nodeselector.yaml + target: + kind: (StatefulSet|Deployment|Job) \ No newline at end of file diff --git a/apps/kube-dashboard/patches/nodeselector.yaml b/apps/kube-dashboard/patches/nodeselector.yaml new file mode 100644 index 0000000..9391e7e --- /dev/null +++ b/apps/kube-dashboard/patches/nodeselector.yaml @@ -0,0 +1,9 @@ +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/nextcloud/kustomization.yaml b/apps/nextcloud/kustomization.yaml index 859d3c5..0224da3 100644 --- a/apps/nextcloud/kustomization.yaml +++ b/apps/nextcloud/kustomization.yaml @@ -15,3 +15,8 @@ helmCharts: repo: https://nextcloud.github.io/helm/ valuesFile: base/values.yaml releaseName: lcl + +patches: +- path: patches/nodeselector.yaml + target: + kind: (StatefulSet|Deployment|Job) \ No newline at end of file diff --git a/apps/nextcloud/patches/nodeselector.yaml b/apps/nextcloud/patches/nodeselector.yaml new file mode 100644 index 0000000..9391e7e --- /dev/null +++ b/apps/nextcloud/patches/nodeselector.yaml @@ -0,0 +1,9 @@ +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/vaultwarden/kustomization.yaml b/apps/vaultwarden/kustomization.yaml index 5cd4346..bdf6a32 100644 --- a/apps/vaultwarden/kustomization.yaml +++ b/apps/vaultwarden/kustomization.yaml @@ -10,3 +10,8 @@ resources: - base/vaultwarden-namespace.yaml - 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 diff --git a/apps/vaultwarden/patches/nodeselector.yaml b/apps/vaultwarden/patches/nodeselector.yaml new file mode 100644 index 0000000..9391e7e --- /dev/null +++ b/apps/vaultwarden/patches/nodeselector.yaml @@ -0,0 +1,9 @@ +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/argo-cd-ui-ingress.yaml b/infrastructure/0-argo-cd-ui-ingress.yaml similarity index 100% rename from infrastructure/argo-cd-ui-ingress.yaml rename to infrastructure/0-argo-cd-ui-ingress.yaml diff --git a/infrastructure/02-argocd/kustomization.yaml b/infrastructure/02-argocd/kustomization.yaml index 64fedc0..18358e8 100644 --- a/infrastructure/02-argocd/kustomization.yaml +++ b/infrastructure/02-argocd/kustomization.yaml @@ -13,3 +13,6 @@ patches: - path: patches/argocd-cmd-params-cm-patch.yaml - path: patches/argocd-server-service.yaml - path: patches/argocd-cm-patch.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 new file mode 100644 index 0000000..9391e7e --- /dev/null +++ b/infrastructure/02-argocd/patches/nodeselector.yaml @@ -0,0 +1,9 @@ +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/kustomization.yaml b/infrastructure/03-traefik/kustomization.yaml index 40ca20b..6a0a9a7 100644 --- a/infrastructure/03-traefik/kustomization.yaml +++ b/infrastructure/03-traefik/kustomization.yaml @@ -14,3 +14,8 @@ helmCharts: releaseName: lcl repo: https://traefik.github.io/charts valuesFile: base/values.yaml + +patches: +- path: patches/nodeselector.yaml + target: + kind: (StatefulSet|Deployment|Job) diff --git a/infrastructure/03-traefik/patches/nodeselector.yaml b/infrastructure/03-traefik/patches/nodeselector.yaml new file mode 100644 index 0000000..9391e7e --- /dev/null +++ b/infrastructure/03-traefik/patches/nodeselector.yaml @@ -0,0 +1,9 @@ +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 e755a54..921b5ca 100644 --- a/infrastructure/04-longhorn/kustomization.yaml +++ b/infrastructure/04-longhorn/kustomization.yaml @@ -13,3 +13,8 @@ helmCharts: repo: https://charts.longhorn.io valuesFile: base/values.yaml +patches: +- path: patches/nodeselector.yaml + target: + kind: (StatefulSet|Deployment|Job) + diff --git a/infrastructure/04-longhorn/patches/nodeselector.yaml b/infrastructure/04-longhorn/patches/nodeselector.yaml new file mode 100644 index 0000000..48cd449 --- /dev/null +++ b/infrastructure/04-longhorn/patches/nodeselector.yaml @@ -0,0 +1,8 @@ +apiVersion: apps/v1 +kind: not-important +metadata: + name: not-important + template: + spec: + nodeSelector: + region: local \ No newline at end of file diff --git a/infrastructure/05-cert-manager/kustomization.yaml b/infrastructure/05-cert-manager/kustomization.yaml index c4c007b..4895d1d 100644 --- a/infrastructure/05-cert-manager/kustomization.yaml +++ b/infrastructure/05-cert-manager/kustomization.yaml @@ -20,3 +20,8 @@ helmCharts: version: 1.0.2 repo: https://fabmade.github.io/cert-manager-webhook-ionos # valuesFile: base/ionos-values.yaml + +patches: +- path: patches/nodeselector.yaml + target: + kind: (StatefulSet|Deployment|Job) \ No newline at end of file diff --git a/infrastructure/05-cert-manager/patches/nodeselector.yaml b/infrastructure/05-cert-manager/patches/nodeselector.yaml new file mode 100644 index 0000000..9391e7e --- /dev/null +++ b/infrastructure/05-cert-manager/patches/nodeselector.yaml @@ -0,0 +1,9 @@ +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/projects/website/base/nodeselector.yaml b/projects/website/base/nodeselector.yaml new file mode 100644 index 0000000..29cb9d8 --- /dev/null +++ b/projects/website/base/nodeselector.yaml @@ -0,0 +1,9 @@ +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/projects/website.yaml b/projects/website/base/website-deployment.yaml similarity index 51% rename from projects/website.yaml rename to projects/website/base/website-deployment.yaml index e2402ae..237397a 100644 --- a/projects/website.yaml +++ b/projects/website/base/website-deployment.yaml @@ -1,9 +1,9 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: website-deployment labels: app: website + name: website spec: replicas: 1 selector: @@ -14,9 +14,11 @@ spec: labels: app: website spec: - nodeName: gatekeeper containers: - - name: website - image: registry.steffenillium.de/website - ports: - - containerPort: 80 + - image: ghcr.io/illiumst/website:latest + name: website + ports: + - containerPort: 80 + protocol: TCP + resources: {} + restartPolicy: Always diff --git a/projects/website/base/website-ingress.yaml b/projects/website/base/website-ingress.yaml new file mode 100644 index 0000000..b62e478 --- /dev/null +++ b/projects/website/base/website-ingress.yaml @@ -0,0 +1,15 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: website-ingress + namespace: website +spec: + entryPoints: + - web + - websecure + routes: + - match: Host(`www.steffenillium.de`) || Host(`steffenillium.de`) + kind: Rule + services: + - name: website + port: 80 diff --git a/projects/website/base/website-namespace.yaml b/projects/website/base/website-namespace.yaml new file mode 100644 index 0000000..8cc95c5 --- /dev/null +++ b/projects/website/base/website-namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: website \ No newline at end of file diff --git a/projects/website/base/website-service.yaml b/projects/website/base/website-service.yaml new file mode 100644 index 0000000..3a6f2a0 --- /dev/null +++ b/projects/website/base/website-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: website + name: website +spec: + ports: + - name: "http" + port: 80 + targetPort: 80 + selector: + app: website diff --git a/projects/website/kustomization.yaml b/projects/website/kustomization.yaml new file mode 100644 index 0000000..0f4188d --- /dev/null +++ b/projects/website/kustomization.yaml @@ -0,0 +1,15 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: website + +resources: +- base/website-deployment.yaml +- base/website-ingress.yaml +- base/website-namespace.yaml +- base/website-service.yaml + +patches: +- path: patches/nodeselector.yaml + target: + kind: (StatefulSet|Deployment|Job)