From 5cfcd8005e618ef1365aa4241b668d92ec5cc6ee Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Wed, 12 Apr 2023 01:30:13 -0400 Subject: [PATCH] Move 'utilities' to 'management', add transfersh --- cluster/apps/kustomization.yaml | 2 +- .../guacamole/guacamole.sops.yaml | 2 +- .../guacamole/helm-release.yaml | 2 +- .../guacamole/kustomization.yaml | 0 .../kustomization.yaml | 0 cluster/apps/management/namespace.yaml | 6 ++ .../network_policy.yaml | 6 +- cluster/apps/tools/kustomization.yaml | 6 ++ .../apps/{utility => tools}/namespace.yaml | 4 +- cluster/apps/tools/network_policy.yaml | 25 +++++++ .../apps/tools/transfersh/helm-release.yaml | 71 +++++++++++++++++++ .../apps/tools/transfersh/kustomization.yaml | 4 ++ 12 files changed, 120 insertions(+), 8 deletions(-) rename cluster/apps/{utility => management}/guacamole/guacamole.sops.yaml (99%) rename cluster/apps/{utility => management}/guacamole/helm-release.yaml (97%) rename cluster/apps/{utility => management}/guacamole/kustomization.yaml (100%) rename cluster/apps/{utility => management}/kustomization.yaml (100%) create mode 100644 cluster/apps/management/namespace.yaml rename cluster/apps/{utility => management}/network_policy.yaml (83%) create mode 100644 cluster/apps/tools/kustomization.yaml rename cluster/apps/{utility => tools}/namespace.yaml (60%) create mode 100644 cluster/apps/tools/network_policy.yaml create mode 100644 cluster/apps/tools/transfersh/helm-release.yaml create mode 100644 cluster/apps/tools/transfersh/kustomization.yaml diff --git a/cluster/apps/kustomization.yaml b/cluster/apps/kustomization.yaml index efc5d8b..31ccc57 100644 --- a/cluster/apps/kustomization.yaml +++ b/cluster/apps/kustomization.yaml @@ -5,4 +5,4 @@ resources: - ./authentik - ./media - ./download -- ./utility \ No newline at end of file +- ./management \ No newline at end of file diff --git a/cluster/apps/utility/guacamole/guacamole.sops.yaml b/cluster/apps/management/guacamole/guacamole.sops.yaml similarity index 99% rename from cluster/apps/utility/guacamole/guacamole.sops.yaml rename to cluster/apps/management/guacamole/guacamole.sops.yaml index b79128a..711a0ff 100644 --- a/cluster/apps/utility/guacamole/guacamole.sops.yaml +++ b/cluster/apps/management/guacamole/guacamole.sops.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret metadata: name: guacamole-secret - namespace: utility + namespace: management stringData: OPENID_CLIENT_ID: ENC[AES256_GCM,data:rIJWHZ9rJQ1jwXL3+Mg00ZrcUwu4CevdOHRuP/EYjbUR5cKccvgwMg==,iv:NU7HCctec1PJeE9RAi7PhSpsNR9jxSTqh/7IJgKm9aw=,tag:vAPLHnK8HbsTaisLPY/vfQ==,type:str] sops: diff --git a/cluster/apps/utility/guacamole/helm-release.yaml b/cluster/apps/management/guacamole/helm-release.yaml similarity index 97% rename from cluster/apps/utility/guacamole/helm-release.yaml rename to cluster/apps/management/guacamole/helm-release.yaml index 69cc437..fcfe346 100644 --- a/cluster/apps/utility/guacamole/helm-release.yaml +++ b/cluster/apps/management/guacamole/helm-release.yaml @@ -2,7 +2,7 @@ apiVersion: helm.toolkit.fluxcd.io/v2beta1 kind: HelmRelease metadata: name: guacamole - namespace: utility + namespace: management spec: interval: 5m chart: diff --git a/cluster/apps/utility/guacamole/kustomization.yaml b/cluster/apps/management/guacamole/kustomization.yaml similarity index 100% rename from cluster/apps/utility/guacamole/kustomization.yaml rename to cluster/apps/management/guacamole/kustomization.yaml diff --git a/cluster/apps/utility/kustomization.yaml b/cluster/apps/management/kustomization.yaml similarity index 100% rename from cluster/apps/utility/kustomization.yaml rename to cluster/apps/management/kustomization.yaml diff --git a/cluster/apps/management/namespace.yaml b/cluster/apps/management/namespace.yaml new file mode 100644 index 0000000..15896ad --- /dev/null +++ b/cluster/apps/management/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: management + labels: + name: management \ No newline at end of file diff --git a/cluster/apps/utility/network_policy.yaml b/cluster/apps/management/network_policy.yaml similarity index 83% rename from cluster/apps/utility/network_policy.yaml rename to cluster/apps/management/network_policy.yaml index 5b6fc20..684142d 100644 --- a/cluster/apps/utility/network_policy.yaml +++ b/cluster/apps/management/network_policy.yaml @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-most-allow-some - namespace: utility + namespace: management spec: # Apply to all pods in this namespace podSelector: {} @@ -11,7 +11,7 @@ spec: # Allow all pods in this namespace - namespaceSelector: matchLabels: - name: "utility" + name: "management" # Allow traefik pods - namespaceSelector: @@ -21,4 +21,4 @@ spec: # Allow all pods with this label - podSelector: matchLabels: - needsUtility: "yes" \ No newline at end of file + needsManagement: "yes" \ No newline at end of file diff --git a/cluster/apps/tools/kustomization.yaml b/cluster/apps/tools/kustomization.yaml new file mode 100644 index 0000000..218a175 --- /dev/null +++ b/cluster/apps/tools/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./namespace.yaml +- ./network_policy.yaml +- ./transfersh \ No newline at end of file diff --git a/cluster/apps/utility/namespace.yaml b/cluster/apps/tools/namespace.yaml similarity index 60% rename from cluster/apps/utility/namespace.yaml rename to cluster/apps/tools/namespace.yaml index 4a62806..9b10195 100644 --- a/cluster/apps/utility/namespace.yaml +++ b/cluster/apps/tools/namespace.yaml @@ -1,6 +1,6 @@ apiVersion: v1 kind: Namespace metadata: - name: utility + name: tools labels: - name: utility \ No newline at end of file + name: tools \ No newline at end of file diff --git a/cluster/apps/tools/network_policy.yaml b/cluster/apps/tools/network_policy.yaml new file mode 100644 index 0000000..11f5308 --- /dev/null +++ b/cluster/apps/tools/network_policy.yaml @@ -0,0 +1,25 @@ +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: deny-most-allow-some + namespace: tools +spec: + # Apply to all pods in this namespace + podSelector: {} + ingress: + - from: + # Allow all pods in this namespace + - namespaceSelector: + matchLabels: + name: "media" +# - podSelector: {} + + # Allow traefik pods + - namespaceSelector: + matchLabels: + name: "traefik" + + # Allow all pods with this label + - podSelector: + matchLabels: + needsTools: "yes" \ No newline at end of file diff --git a/cluster/apps/tools/transfersh/helm-release.yaml b/cluster/apps/tools/transfersh/helm-release.yaml new file mode 100644 index 0000000..9908b70 --- /dev/null +++ b/cluster/apps/tools/transfersh/helm-release.yaml @@ -0,0 +1,71 @@ +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: transfersh + namespace: tools +spec: + interval: 5m + chart: + spec: + chart: app-template + version: 1.3.x + sourceRef: + kind: HelmRepository + name: bjws-charts + namespace: flux-system + + values: + image: + repository: dutchcoders/transfer.sh + tag: latest + + args: + - --provider + - local + + - --basedir + - /storage/ + + - --temp-path + - /tmp/ + + - --max-upload-size + - "10000000" + + service: + main: + ports: + http: + port: 8080 + + probes: + liveness: + enabled: false + + ingress: + main: + enabled: true + annotations: + cert-manager.io/cluster-issuer: "letsencrypt-production" + traefik.ingress.kubernetes.io/router.entrypoints: websecure + hosts: + - host: "upload.${SECRET_NEW_DOMAIN}" + paths: + - path: / + pathType: Prefix + + persistence: + storage: + enabled: true + type: pvc + accessMode: ReadWriteOnce + size: 40Gi + mountPath: /storage + + resources: + requests: + cpu: 3m + memory: 1500Mi + + limits: + memory: 3000Mi \ No newline at end of file diff --git a/cluster/apps/tools/transfersh/kustomization.yaml b/cluster/apps/tools/transfersh/kustomization.yaml new file mode 100644 index 0000000..ea3145d --- /dev/null +++ b/cluster/apps/tools/transfersh/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ./helm-release.yaml \ No newline at end of file