diff --git a/src/clusters/main/apps/emilounge/emilounge.yaml b/src/clusters/main/apps/emilounge/emilounge.yaml new file mode 100644 index 0000000..6adc1b5 --- /dev/null +++ b/src/clusters/main/apps/emilounge/emilounge.yaml @@ -0,0 +1,25 @@ +# Create emilounge Kustomization +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: emilounge +spec: + # Path inside repository to a directory containing Kustomization files + path: src/clusters/main/apps/emilounge/kustomize + dependsOn: + # Deploy Traefik first + - name: traefik + # Apply patches for common configurations + # This key always needs to be here for patching to work + patches: + # Set target namespace + - target: + group: kustomize.toolkit.fluxcd.io + kind: Kustomization + name: .* + patch: | + kind: . + metadata: + name: . + spec: + targetNamespace: emilounge diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/emilounge-helm.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/emilounge-helm.yaml new file mode 100644 index 0000000..691b48f --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/emilounge-helm.yaml @@ -0,0 +1,13 @@ +# Create emilounge-helm Kustomization +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: emilounge-helm +spec: + # Path inside repository to a directory containing Kustomization files + path: src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize + dependsOn: + # Deploy namespace first + - name: emilounge-namespace + # This key always needs to be here for patching to work + patches: [] diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/configurations/names.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/configurations/names.yaml new file mode 100644 index 0000000..f1d6512 --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/configurations/names.yaml @@ -0,0 +1,8 @@ +# Configure names transformer +nameReference: + - kind: Secret + fieldSpecs: + # Replace secret names in HelmReleases + - group: helm.toolkit.fluxcd.io + kind: HelmRelease + path: spec/valuesFrom/name diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/kustomization.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/kustomization.yaml new file mode 100644 index 0000000..cb3ff91 --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/kustomization.yaml @@ -0,0 +1,17 @@ +# Create emilounge-helm Kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +# Include the following configuration files +configurations: + - configurations/names.yaml +# Include the following resources +resources: + - resources/release.yaml + - resources/repository.yaml +# Generate secrets +secretGenerator: + - files: + # It's important to include extension in the key + # SOPS will use it to determine the format of the content + - values.yaml=secrets/values.yaml + name: emilounge-helm-secrets-values diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/release.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/release.yaml new file mode 100644 index 0000000..cb414b3 --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/release.yaml @@ -0,0 +1,22 @@ +# Create emilounge Helm release +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: emilounge +spec: + chart: + spec: + # Use this chart from the repository + chart: emilounge + # Pin version to major + version: "0.x" + # Use this Helm repository + sourceRef: + kind: HelmRepository + name: radio-aktywne + # This key always needs to be here for patching to work + postRenderers: [] + valuesFrom: + - kind: Secret + name: emilounge-helm-secrets-values + valuesKey: values.yaml diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/repository.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/repository.yaml new file mode 100644 index 0000000..15347a7 --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/repository.yaml @@ -0,0 +1,8 @@ +# Create emilounge Helm repository +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: radio-aktywne +spec: + type: oci + url: oci://ghcr.io/radio-aktywne/charts diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/secrets/values.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/secrets/values.yaml new file mode 100644 index 0000000..9df7227 --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-helm/kustomize/secrets/values.yaml @@ -0,0 +1,34 @@ +app: + medialounge: + s3: + user: ENC[AES256_GCM,data:SZL43xCCQfqp,iv:oIPqo65bO69LZegNkKV5arzy9cByz1cNvTcMGeKP8mc=,tag:9BORbWNuNKiIyZS4woVIoA==,type:str] + password: ENC[AES256_GCM,data:H7C6GcLNfAE=,iv:o9naEoWvSWI8o0d3dmqK8YQaRKlGaJf5Gl8u1Di8zNU=,tag:ZDwQQvUHaDtWcIWD7NQsPw==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age14uepygtepskwehywergh9fe9j2a3ytqd80y9r2ekfmett6rq3peqjtgxns + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBGY1ZoYlZvWG04Zk9ZdXh2 + T0VWUk1oY0R0eEtpQnJRcWIzUXozQUlGOVRNCitxY0h5b3l6QnN2ejNZQ3Z1aXJX + aWhuNjZtYVNlTi9vV2pJOXJ3dkpZQjQKLS0tIGtJdFNOaDVtWXQ5aTd5L1diTzhw + c2RmaXczVnY0azVqWEtZTHQ5YUZFYkEK57cPtu0CelzVM9LFR/i3qUbAPt6HRAUZ + jAlPDHIQqQWeJE7x8E3CwCT3Z7LyA3fgSlt8eZ/n1OE6hNc1uWRz4Q== + -----END AGE ENCRYPTED FILE----- + - recipient: age1y5lqafxarcnlrduh8k3tycnaq63v2alagmtkf0k9gd59pg263axqtt928v + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBOalFvczJlL2xpUlVEblRD + TGlid0dzRWhxYTBUZENVQzNESGtyTmkvcVFJCmxtWDQyb2VJNUNPaEVJVzVja0RK + aEVOZ2ZsMmZTckduVGRzcHFWSUFJdjAKLS0tIFRHZ3M0dUlob0p6R0JPQlpSWG0x + cm1sN3U1VnZNNTU1NFQ2UlRmSUJiVUkKcDxNEToerq/aAa+m8Bmyg9R+UsuMXwx/ + 1guqoWy3m4ucGQBi7eCswg5m+rGee+FgzlQsan9EQwL8Zhh8sTwlaQ== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2024-08-30T17:56:46Z" + mac: ENC[AES256_GCM,data:gCWoiHFeqCIdX7ERtyZ1zL9qkK9T1yH+zsneDtJTZovXAlVAh2+jDyFt8nRiPYxq8nsunczMToXivd/Us0nlq1xneuoX3m2Rw/XiiciobGw6szE1Jl4gJ5tIGJIFNmxmyoSRWI0pop+65z9cHHJ9/5qb30LUdeHmw5zBPwVnGvo=,iv:f+deTKBFJmOMDkTosH8zYLQXBz6H+Ku1/+1HJTQJ3+M=,tag:Zkgf11TNu88VOUHjV761kQ==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.8.1 diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-namespace/emilounge-namespace.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-namespace/emilounge-namespace.yaml new file mode 100644 index 0000000..c2f2f3d --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-namespace/emilounge-namespace.yaml @@ -0,0 +1,10 @@ +# Create emilounge-namespace Kustomization +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: emilounge-namespace +spec: + # Path inside repository to a directory containing Kustomization files + path: src/clusters/main/apps/emilounge/kustomize/emilounge-namespace/kustomize + # This key always needs to be here for patching to work + patches: [] diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-namespace/kustomize/kustomization.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-namespace/kustomize/kustomization.yaml new file mode 100644 index 0000000..105176f --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-namespace/kustomize/kustomization.yaml @@ -0,0 +1,6 @@ +# Create emilounge-namespace Kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +# Include the following resources +resources: + - resources/namespace.yaml diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-namespace/kustomize/resources/namespace.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-namespace/kustomize/resources/namespace.yaml new file mode 100644 index 0000000..e700793 --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-namespace/kustomize/resources/namespace.yaml @@ -0,0 +1,5 @@ +# Create emilounge namespace +apiVersion: v1 +kind: Namespace +metadata: + name: emilounge diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-traefik/emilounge-traefik.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-traefik/emilounge-traefik.yaml new file mode 100644 index 0000000..9fc1b76 --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-traefik/emilounge-traefik.yaml @@ -0,0 +1,13 @@ +# Create emilounge-traefik Kustomization +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: emilounge-traefik +spec: + # Path inside repository to a directory containing Kustomization files + path: src/clusters/main/apps/emilounge/kustomize/emilounge-traefik/kustomize + dependsOn: + # Deploy Helm release first + - name: emilounge-helm + # This key always needs to be here for patching to work + patches: [] diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-traefik/kustomize/kustomization.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-traefik/kustomize/kustomization.yaml new file mode 100644 index 0000000..dce135f --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-traefik/kustomize/kustomization.yaml @@ -0,0 +1,6 @@ +# Create emilounge-traefik Kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +# Include the following resources +resources: + - resources/routes/http.yaml diff --git a/src/clusters/main/apps/emilounge/kustomize/emilounge-traefik/kustomize/resources/routes/http.yaml b/src/clusters/main/apps/emilounge/kustomize/emilounge-traefik/kustomize/resources/routes/http.yaml new file mode 100644 index 0000000..fdb56ec --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/emilounge-traefik/kustomize/resources/routes/http.yaml @@ -0,0 +1,18 @@ +# Create HTTP ingress route for emilounge +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: emilounge-http +spec: + entryPoints: + # Use entrypoint for HTTPS traffic + - https + routes: + # Match traffic with the Host header + - match: HostRegexp(`emilounge\..*`) + kind: Rule + services: + # Route traffic to the emilounge service + - name: emilounge + # This is the name of the port in the service + port: http diff --git a/src/clusters/main/apps/emilounge/kustomize/kustomization.yaml b/src/clusters/main/apps/emilounge/kustomize/kustomization.yaml new file mode 100644 index 0000000..f3b3c77 --- /dev/null +++ b/src/clusters/main/apps/emilounge/kustomize/kustomization.yaml @@ -0,0 +1,8 @@ +# Create emilounge Kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +# Include the following resources +resources: + - emilounge-helm/emilounge-helm.yaml + - emilounge-namespace/emilounge-namespace.yaml + - emilounge-traefik/emilounge-traefik.yaml diff --git a/src/clusters/main/apps/kustomization.yaml b/src/clusters/main/apps/kustomization.yaml index 35ff3b6..f6d15ba 100644 --- a/src/clusters/main/apps/kustomization.yaml +++ b/src/clusters/main/apps/kustomization.yaml @@ -5,6 +5,7 @@ kind: Kustomization resources: - emicast/emicast.yaml - emifuse/emifuse.yaml + - emilounge/emilounge.yaml - emipass/emipass.yaml - emirecords/emirecords.yaml - emischeduler/emischeduler.yaml diff --git a/tests/clusters/ci/main/apps/emilounge/emilounge.yaml b/tests/clusters/ci/main/apps/emilounge/emilounge.yaml new file mode 100644 index 0000000..0eacd23 --- /dev/null +++ b/tests/clusters/ci/main/apps/emilounge/emilounge.yaml @@ -0,0 +1,25 @@ +# Create emilounge Kustomization +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: emilounge +spec: + # Path inside repository to a directory containing Kustomization files + path: tests/clusters/ci/main/apps/emilounge/kustomize + dependsOn: + # Deploy Traefik first + - name: traefik + # Apply patches for common configurations + # This key always needs to be here for patching to work + patches: + # Set target namespace + - target: + group: kustomize.toolkit.fluxcd.io + kind: Kustomization + name: .* + patch: | + kind: . + metadata: + name: . + spec: + targetNamespace: emilounge diff --git a/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/emilounge-helm.yaml b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/emilounge-helm.yaml new file mode 100644 index 0000000..37666a0 --- /dev/null +++ b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/emilounge-helm.yaml @@ -0,0 +1,13 @@ +# Create emilounge-helm Kustomization +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: emilounge-helm +spec: + # Path inside repository to a directory containing Kustomization files + path: tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/kustomize + dependsOn: + # Deploy namespace first + - name: emilounge-namespace + # This key always needs to be here for patching to work + patches: [] diff --git a/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/kustomize/kustomization.yaml b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/kustomize/kustomization.yaml new file mode 100644 index 0000000..15ec46a --- /dev/null +++ b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/kustomize/kustomization.yaml @@ -0,0 +1,7 @@ +# Create emilounge-helm Kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +# Include the following resources +resources: + - resources/release.yaml + - resources/repository.yaml diff --git a/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/release.yaml b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/release.yaml new file mode 100644 index 0000000..fd9b0b7 --- /dev/null +++ b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/release.yaml @@ -0,0 +1,18 @@ +# Create emilounge Helm release +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: emilounge +spec: + chart: + spec: + # Use this chart from the repository + chart: emilounge + # Pin version to major + version: "0.x" + # Use this Helm repository + sourceRef: + kind: HelmRepository + name: radio-aktywne + # This key always needs to be here for patching to work + postRenderers: [] diff --git a/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/repository.yaml b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/repository.yaml new file mode 100644 index 0000000..15347a7 --- /dev/null +++ b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-helm/kustomize/resources/repository.yaml @@ -0,0 +1,8 @@ +# Create emilounge Helm repository +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: radio-aktywne +spec: + type: oci + url: oci://ghcr.io/radio-aktywne/charts diff --git a/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-namespace/emilounge-namespace.yaml b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-namespace/emilounge-namespace.yaml new file mode 100644 index 0000000..207c01d --- /dev/null +++ b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-namespace/emilounge-namespace.yaml @@ -0,0 +1,10 @@ +# Create emilounge-namespace Kustomization +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: emilounge-namespace +spec: + # Path inside repository to a directory containing Kustomization files + path: tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-namespace/kustomize + # This key always needs to be here for patching to work + patches: [] diff --git a/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-namespace/kustomize/kustomization.yaml b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-namespace/kustomize/kustomization.yaml new file mode 100644 index 0000000..1b235ef --- /dev/null +++ b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-namespace/kustomize/kustomization.yaml @@ -0,0 +1,5 @@ +# Overlay emilounge-namespace Kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../../../../../../../../src/clusters/main/apps/emilounge/kustomize/emilounge-namespace/kustomize diff --git a/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-traefik/emilounge-traefik.yaml b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-traefik/emilounge-traefik.yaml new file mode 100644 index 0000000..bde1396 --- /dev/null +++ b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-traefik/emilounge-traefik.yaml @@ -0,0 +1,13 @@ +# Create emilounge-traefik Kustomization +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: emilounge-traefik +spec: + # Path inside repository to a directory containing Kustomization files + path: tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-traefik/kustomize + dependsOn: + # Deploy Helm release first + - name: emilounge-helm + # This key always needs to be here for patching to work + patches: [] diff --git a/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-traefik/kustomize/kustomization.yaml b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-traefik/kustomize/kustomization.yaml new file mode 100644 index 0000000..5837294 --- /dev/null +++ b/tests/clusters/ci/main/apps/emilounge/kustomize/emilounge-traefik/kustomize/kustomization.yaml @@ -0,0 +1,5 @@ +# Overlay emilounge-traefik Kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../../../../../../../../src/clusters/main/apps/emilounge/kustomize/emilounge-traefik/kustomize diff --git a/tests/clusters/ci/main/apps/emilounge/kustomize/kustomization.yaml b/tests/clusters/ci/main/apps/emilounge/kustomize/kustomization.yaml new file mode 100644 index 0000000..f3b3c77 --- /dev/null +++ b/tests/clusters/ci/main/apps/emilounge/kustomize/kustomization.yaml @@ -0,0 +1,8 @@ +# Create emilounge Kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +# Include the following resources +resources: + - emilounge-helm/emilounge-helm.yaml + - emilounge-namespace/emilounge-namespace.yaml + - emilounge-traefik/emilounge-traefik.yaml diff --git a/tests/clusters/ci/main/apps/kustomization.yaml b/tests/clusters/ci/main/apps/kustomization.yaml index 35ff3b6..f6d15ba 100644 --- a/tests/clusters/ci/main/apps/kustomization.yaml +++ b/tests/clusters/ci/main/apps/kustomization.yaml @@ -5,6 +5,7 @@ kind: Kustomization resources: - emicast/emicast.yaml - emifuse/emifuse.yaml + - emilounge/emilounge.yaml - emipass/emipass.yaml - emirecords/emirecords.yaml - emischeduler/emischeduler.yaml