From c39218582da51fefdf60e09923044c8d8d3a3e81 Mon Sep 17 00:00:00 2001 From: Julius de Jeu Date: Tue, 24 May 2022 12:38:44 +0200 Subject: [PATCH] Add pinbot to cluster --- flux/cluster/apps/kustomization.yaml | 2 +- .../kustomization.yaml} | 4 +-- .../apps/misc/pinbot/kustomization.yaml | 5 ++++ flux/cluster/apps/misc/pinbot/pinbot.yaml | 29 +++++++++++++++++++ .../pinbot/secret.yaml} | 12 ++++---- .../apps/{test => misc}/registry-creds.yaml | 2 +- flux/cluster/apps/test/deployment.yaml | 27 ----------------- flux/cluster/apps/test/ingress.yaml | 17 ----------- flux/cluster/apps/test/kustomization.yaml | 8 ----- flux/cluster/apps/test/service.yaml | 12 -------- .../core/namespaces/kustomization.yaml | 1 + flux/cluster/core/namespaces/misc.yaml | 6 ++++ 12 files changed, 50 insertions(+), 75 deletions(-) rename flux/cluster/apps/{family/galerie-staging/kustomization copy.yaml => misc/kustomization.yaml} (58%) create mode 100644 flux/cluster/apps/misc/pinbot/kustomization.yaml create mode 100644 flux/cluster/apps/misc/pinbot/pinbot.yaml rename flux/cluster/apps/{test/test-secret.yaml => misc/pinbot/secret.yaml} (56%) rename flux/cluster/apps/{test => misc}/registry-creds.yaml (87%) delete mode 100644 flux/cluster/apps/test/deployment.yaml delete mode 100644 flux/cluster/apps/test/ingress.yaml delete mode 100644 flux/cluster/apps/test/kustomization.yaml delete mode 100644 flux/cluster/apps/test/service.yaml create mode 100644 flux/cluster/core/namespaces/misc.yaml diff --git a/flux/cluster/apps/kustomization.yaml b/flux/cluster/apps/kustomization.yaml index 55f4a72..f414f65 100644 --- a/flux/cluster/apps/kustomization.yaml +++ b/flux/cluster/apps/kustomization.yaml @@ -1,7 +1,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - test + - misc - authentik - networking - drone diff --git a/flux/cluster/apps/family/galerie-staging/kustomization copy.yaml b/flux/cluster/apps/misc/kustomization.yaml similarity index 58% rename from flux/cluster/apps/family/galerie-staging/kustomization copy.yaml rename to flux/cluster/apps/misc/kustomization.yaml index ef7dbba..b22d842 100644 --- a/flux/cluster/apps/family/galerie-staging/kustomization copy.yaml +++ b/flux/cluster/apps/misc/kustomization.yaml @@ -1,6 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - deployment.yaml - - ingress.yaml - - service.yaml + - pinbot diff --git a/flux/cluster/apps/misc/pinbot/kustomization.yaml b/flux/cluster/apps/misc/pinbot/kustomization.yaml new file mode 100644 index 0000000..71de828 --- /dev/null +++ b/flux/cluster/apps/misc/pinbot/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - pinbot.yaml + - secret.yaml diff --git a/flux/cluster/apps/misc/pinbot/pinbot.yaml b/flux/cluster/apps/misc/pinbot/pinbot.yaml new file mode 100644 index 0000000..5d698ed --- /dev/null +++ b/flux/cluster/apps/misc/pinbot/pinbot.yaml @@ -0,0 +1,29 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pinbot-deployment + namespace: misc + labels: + app: pinbot-deployment + keel.sh/policy: force +spec: + replicas: 1 + selector: + matchLabels: + app: pinbot-deployment + template: + metadata: + labels: + app: pinbot-deployment + spec: + containers: + - name: pinbot-deployment + image: registry.asraphiel.dev/library/pinbot:main + env: + - name: DISCORD_TOKEN + valueFrom: + secretKeyRef: + name: pinbot-secrets + key: token + imagePullSecrets: + - name: registry-creds diff --git a/flux/cluster/apps/test/test-secret.yaml b/flux/cluster/apps/misc/pinbot/secret.yaml similarity index 56% rename from flux/cluster/apps/test/test-secret.yaml rename to flux/cluster/apps/misc/pinbot/secret.yaml index e37063a..d2b2e43 100644 --- a/flux/cluster/apps/test/test-secret.yaml +++ b/flux/cluster/apps/misc/pinbot/secret.yaml @@ -1,17 +1,17 @@ apiVersion: external-secrets.io/v1beta1 kind: ExternalSecret metadata: - name: vault-example - namespace: test + name: pinbot-secrets + namespace: misc spec: refreshInterval: "15s" secretStoreRef: name: vault kind: ClusterSecretStore target: - name: example-sync + name: pinbot-secrets data: - - secretKey: foobar + - secretKey: pinbot-discord-token remoteRef: - key: k8s/foo - property: my-value + key: k8s/pinbot + property: token diff --git a/flux/cluster/apps/test/registry-creds.yaml b/flux/cluster/apps/misc/registry-creds.yaml similarity index 87% rename from flux/cluster/apps/test/registry-creds.yaml rename to flux/cluster/apps/misc/registry-creds.yaml index 58e18c5..092ddba 100644 --- a/flux/cluster/apps/test/registry-creds.yaml +++ b/flux/cluster/apps/misc/registry-creds.yaml @@ -2,7 +2,7 @@ apiVersion: external-secrets.io/v1beta1 kind: ExternalSecret metadata: name: registry-creds - namespace: test + namespace: misc spec: refreshInterval: "5m" secretStoreRef: diff --git a/flux/cluster/apps/test/deployment.yaml b/flux/cluster/apps/test/deployment.yaml deleted file mode 100644 index 3bfde36..0000000 --- a/flux/cluster/apps/test/deployment.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: whoami-deployment - namespace: test - labels: - app: whoami-deployment - keel.sh/policy: force - keel.sh/match-tag: "true" -spec: - replicas: 1 - selector: - matchLabels: - app: whoami-deployment - template: - metadata: - labels: - app: whoami-deployment - spec: - containers: - - name: whoami-deployment - imagePullPolicy: Always - image: registry.asraphiel.dev/whoami - ports: - - containerPort: 80 - imagePullSecrets: - - name: registry-creds diff --git a/flux/cluster/apps/test/ingress.yaml b/flux/cluster/apps/test/ingress.yaml deleted file mode 100644 index 7980eb2..0000000 --- a/flux/cluster/apps/test/ingress.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: whoami-deployment-ingress - namespace: test -spec: - rules: - - host: "whoami.asraphiel.dev" - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: whoami-deployment-service - port: - number: 80 diff --git a/flux/cluster/apps/test/kustomization.yaml b/flux/cluster/apps/test/kustomization.yaml deleted file mode 100644 index b178dd0..0000000 --- a/flux/cluster/apps/test/kustomization.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - deployment.yaml - - ingress.yaml - - service.yaml - - registry-creds.yaml - - test-secret.yaml diff --git a/flux/cluster/apps/test/service.yaml b/flux/cluster/apps/test/service.yaml deleted file mode 100644 index 0d25d72..0000000 --- a/flux/cluster/apps/test/service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: whoami-deployment-service - namespace: test -spec: - selector: - app: whoami-deployment - ports: - - protocol: TCP - port: 80 - targetPort: 80 diff --git a/flux/cluster/core/namespaces/kustomization.yaml b/flux/cluster/core/namespaces/kustomization.yaml index 4e36c44..6af1302 100644 --- a/flux/cluster/core/namespaces/kustomization.yaml +++ b/flux/cluster/core/namespaces/kustomization.yaml @@ -8,3 +8,4 @@ resources: - drone.yaml - keel.yaml - family.yaml + - misc.yaml diff --git a/flux/cluster/core/namespaces/misc.yaml b/flux/cluster/core/namespaces/misc.yaml new file mode 100644 index 0000000..0dddb0a --- /dev/null +++ b/flux/cluster/core/namespaces/misc.yaml @@ -0,0 +1,6 @@ +kind: Namespace +apiVersion: v1 +metadata: + name: misc + labels: + name: misc \ No newline at end of file