From 735be23ba4188599dec6059054334da8096fa824 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Sun, 2 Apr 2023 22:45:20 -0400 Subject: [PATCH] Move things around --- cluster/apps/kustomization.yaml | 5 +- cluster/apps/media/kustomization.yaml | 5 ++ cluster/apps/media/namespace.yaml | 4 + cluster/apps/media/sonarr/deployment.yaml | 31 +++++++ cluster/apps/media/sonarr/kustomization.yaml | 4 + cluster/apps/traefik/traefik-values.yaml | 90 ------------------- cluster/core/kustomization.yaml | 4 + cluster/core/networking/kustomization.yaml | 5 ++ .../networking}/metallb/helm-release.yaml | 0 .../networking}/metallb/kustomization.yaml | 0 .../metallb/metallb-static-ips.yaml | 0 .../networking}/metallb/namespace.yaml | 0 .../traefik/dashboard-ingress.yaml | 0 .../networking}/traefik/helm-release.yaml | 44 +++++++-- .../networking}/traefik/helm-repository.yaml | 0 .../networking}/traefik/kustomization.yaml | 0 .../networking}/traefik/namespace.yaml | 0 .../traefik/traefik-secrets.sops.yaml | 0 18 files changed, 90 insertions(+), 102 deletions(-) create mode 100644 cluster/apps/media/kustomization.yaml create mode 100644 cluster/apps/media/namespace.yaml create mode 100644 cluster/apps/media/sonarr/deployment.yaml create mode 100644 cluster/apps/media/sonarr/kustomization.yaml delete mode 100644 cluster/apps/traefik/traefik-values.yaml create mode 100644 cluster/core/kustomization.yaml create mode 100644 cluster/core/networking/kustomization.yaml rename cluster/{apps => core/networking}/metallb/helm-release.yaml (100%) rename cluster/{apps => core/networking}/metallb/kustomization.yaml (100%) rename cluster/{apps => core/networking}/metallb/metallb-static-ips.yaml (100%) rename cluster/{apps => core/networking}/metallb/namespace.yaml (100%) rename cluster/{apps => core/networking}/traefik/dashboard-ingress.yaml (100%) rename cluster/{apps => core/networking}/traefik/helm-release.yaml (69%) rename cluster/{apps => core/networking}/traefik/helm-repository.yaml (100%) rename cluster/{apps => core/networking}/traefik/kustomization.yaml (100%) rename cluster/{apps => core/networking}/traefik/namespace.yaml (100%) rename cluster/{apps => core/networking}/traefik/traefik-secrets.sops.yaml (100%) diff --git a/cluster/apps/kustomization.yaml b/cluster/apps/kustomization.yaml index 6e3d43e..806c68c 100644 --- a/cluster/apps/kustomization.yaml +++ b/cluster/apps/kustomization.yaml @@ -1,5 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -resources: -- ./traefik -- ./metallb +resources: [] +#- ./media \ No newline at end of file diff --git a/cluster/apps/media/kustomization.yaml b/cluster/apps/media/kustomization.yaml new file mode 100644 index 0000000..fdb7ae0 --- /dev/null +++ b/cluster/apps/media/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./namespace.yaml +- ./sonarr.yaml \ No newline at end of file diff --git a/cluster/apps/media/namespace.yaml b/cluster/apps/media/namespace.yaml new file mode 100644 index 0000000..5ec5a62 --- /dev/null +++ b/cluster/apps/media/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: media \ No newline at end of file diff --git a/cluster/apps/media/sonarr/deployment.yaml b/cluster/apps/media/sonarr/deployment.yaml new file mode 100644 index 0000000..e15eeda --- /dev/null +++ b/cluster/apps/media/sonarr/deployment.yaml @@ -0,0 +1,31 @@ +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: aste88-charts + namespace: flux-system +spec: + interval: 1m + url: https://aste88.github.io/helm-charts/ +--- +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: sonarr + namespace: media +spec: + interval: 5m + chart: + spec: + chart: sonarr + version: '17.x.x' + sourceRef: + kind: HelmRepository + name: aste88-charts + namespace: flux-system + interval: 1m + values: + env: + TZ: America/New_York + ingress: + +# metrics.enabled: true \ No newline at end of file diff --git a/cluster/apps/media/sonarr/kustomization.yaml b/cluster/apps/media/sonarr/kustomization.yaml new file mode 100644 index 0000000..5388f4d --- /dev/null +++ b/cluster/apps/media/sonarr/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./sonarr.yaml \ No newline at end of file diff --git a/cluster/apps/traefik/traefik-values.yaml b/cluster/apps/traefik/traefik-values.yaml deleted file mode 100644 index f45fcc7..0000000 --- a/cluster/apps/traefik/traefik-values.yaml +++ /dev/null @@ -1,90 +0,0 @@ -additionalArguments: -- --certificatesresolvers.cloudflare.acme.dnschallenge.provider=cloudflare -- --certificatesresolvers.cloudflare.acme.email=seanomik@gmail.com -- --certificatesresolvers.cloudflare.acme.dnschallenge.resolvers=1.1.1.1 -- --certificatesresolvers.cloudflare.acme.storage=/ssl-certs/acme-cloudflare.json - -- --api.insecure -- --providers.kubernetesingress - -logs: - general: - level: DEBUG - -ports: - traefik: - port: 9000 - expose: true - exposedPort: 9000 - # The port protocol (TCP/UDP) - protocol: TCP - web: - port: 8000 - expose: true - exposedPort: 80 - # (optional) Permanent Redirect to HTTPS - # redirectTo: websecure - protocol: TCP - websecure: - port: 8443 - expose: true - exposedPort: 443 - protocol: TCP - tls: - enabled: true - certResolver: cloudflare - metrics: - port: 9100 - expose: true - exposedPort: 9100 - protocol: TCP - -service: - enabled: true - single: true - type: LoadBalancer - externalIPs: - - 192.168.87.10 - -env: -- name: CF_DNS_API_TOKEN - valueFrom: - secretKeyRef: - key: apiToken - name: cloudflare-credentials - -# Disable Dashboard -#ingressRoute: -# dashboard: -# enabled: true -# matchRule: Host(`k3st.***REMOVED***`) && (PathPrefix(`/dashboard/`) || PathPrefix(`/api`)) -# entryPoints: ["websecure"] - -# Persistent Storage -persistence: - enabled: true - name: ssl-certs - size: 1Gi - path: /ssl-certs - -#deployment: -# initContainers: -# The "volume-permissions" init container is required if you run into permission issues. -# Related issue: https://github.com/containous/traefik/issues/6972 -# - name: volume-permissions -# image: busybox:1.31.1 -# command: ["sh", "-c", "chmod -Rv 600 /ssl-certs"] -# volumeMounts: -# - name: ssl-certs -# mountPath: /ssl-certs - -# Set Traefik as your default Ingress Controller, according to Kubernetes 1.19+ changes. -ingressClass: - enabled: true - isDefaultClass: true - -metrics: - prometheus: - entryPoint: metrics - -namespaceOverride: traefik diff --git a/cluster/core/kustomization.yaml b/cluster/core/kustomization.yaml new file mode 100644 index 0000000..3039154 --- /dev/null +++ b/cluster/core/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./networking \ No newline at end of file diff --git a/cluster/core/networking/kustomization.yaml b/cluster/core/networking/kustomization.yaml new file mode 100644 index 0000000..37a9b9a --- /dev/null +++ b/cluster/core/networking/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./traefik +- ./metallb \ No newline at end of file diff --git a/cluster/apps/metallb/helm-release.yaml b/cluster/core/networking/metallb/helm-release.yaml similarity index 100% rename from cluster/apps/metallb/helm-release.yaml rename to cluster/core/networking/metallb/helm-release.yaml diff --git a/cluster/apps/metallb/kustomization.yaml b/cluster/core/networking/metallb/kustomization.yaml similarity index 100% rename from cluster/apps/metallb/kustomization.yaml rename to cluster/core/networking/metallb/kustomization.yaml diff --git a/cluster/apps/metallb/metallb-static-ips.yaml b/cluster/core/networking/metallb/metallb-static-ips.yaml similarity index 100% rename from cluster/apps/metallb/metallb-static-ips.yaml rename to cluster/core/networking/metallb/metallb-static-ips.yaml diff --git a/cluster/apps/metallb/namespace.yaml b/cluster/core/networking/metallb/namespace.yaml similarity index 100% rename from cluster/apps/metallb/namespace.yaml rename to cluster/core/networking/metallb/namespace.yaml diff --git a/cluster/apps/traefik/dashboard-ingress.yaml b/cluster/core/networking/traefik/dashboard-ingress.yaml similarity index 100% rename from cluster/apps/traefik/dashboard-ingress.yaml rename to cluster/core/networking/traefik/dashboard-ingress.yaml diff --git a/cluster/apps/traefik/helm-release.yaml b/cluster/core/networking/traefik/helm-release.yaml similarity index 69% rename from cluster/apps/traefik/helm-release.yaml rename to cluster/core/networking/traefik/helm-release.yaml index cfbc168..21eb024 100644 --- a/cluster/apps/traefik/helm-release.yaml +++ b/cluster/core/networking/traefik/helm-release.yaml @@ -1,7 +1,7 @@ apiVersion: helm.toolkit.fluxcd.io/v2beta1 kind: HelmRelease metadata: - name: traefik-helm + name: traefik namespace: traefik spec: interval: 5m @@ -31,19 +31,39 @@ spec: level: DEBUG ports: - web: + traefik: + port: 9000 expose: true - exposedPort: 8080 - # (optional) Permanent Redirect to HTTPS - # redirectTo: websecure + exposedPort: 9000 + # The port protocol (TCP/UDP) + protocol: TCP + web: + port: 8000 + expose: true + exposedPort: 80 + # (optional) Permanent Redirect to HTTPS + # redirectTo: websecure + protocol: TCP websecure: + port: 8443 + expose: true + exposedPort: 443 + protocol: TCP tls: - exposed: true - exposedPort: 8443 - enabled: true certResolver: cloudflare + metrics: + port: 9100 + expose: true + exposedPort: 9100 + protocol: TCP + service: + enabled: true + single: true + type: LoadBalancer + externalIPs: + - 192.168.87.10 env: - name: CF_DNS_API_TOKEN @@ -55,7 +75,9 @@ spec: # Disable Dashboard ingressRoute: dashboard: - enabled: false + enabled: true + matchRule: Host(`k3st.***REMOVED***`) && (PathPrefix(`/dashboard/`) || PathPrefix(`/api`)) + entryPoints: ["websecure"] # Persistent Storage persistence: @@ -80,4 +102,8 @@ spec: enabled: true isDefaultClass: true + metrics: + prometheus: + entryPoint: metrics + namespaceOverride: traefik diff --git a/cluster/apps/traefik/helm-repository.yaml b/cluster/core/networking/traefik/helm-repository.yaml similarity index 100% rename from cluster/apps/traefik/helm-repository.yaml rename to cluster/core/networking/traefik/helm-repository.yaml diff --git a/cluster/apps/traefik/kustomization.yaml b/cluster/core/networking/traefik/kustomization.yaml similarity index 100% rename from cluster/apps/traefik/kustomization.yaml rename to cluster/core/networking/traefik/kustomization.yaml diff --git a/cluster/apps/traefik/namespace.yaml b/cluster/core/networking/traefik/namespace.yaml similarity index 100% rename from cluster/apps/traefik/namespace.yaml rename to cluster/core/networking/traefik/namespace.yaml diff --git a/cluster/apps/traefik/traefik-secrets.sops.yaml b/cluster/core/networking/traefik/traefik-secrets.sops.yaml similarity index 100% rename from cluster/apps/traefik/traefik-secrets.sops.yaml rename to cluster/core/networking/traefik/traefik-secrets.sops.yaml