diff --git a/cluster/apps/simplebookmarks-staging/Makefile b/cluster/apps/simplebookmarks-staging/Makefile deleted file mode 100644 index 71bf6e79..00000000 --- a/cluster/apps/simplebookmarks-staging/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -.PHONY: generate-registry-secret - -all: generate-registry-secret - -SECRET_DOMAIN = $(shell sops -d --extract '["stringData"]["SECRET_DOMAIN"]' ../../config/cluster-secrets.sops.yaml) -SECRET_DOCKER_USERNAME = $(shell sops -d --extract '["stringData"]["SECRET_SIMPLEBOOKMARKS_DOCKER_USERNAME"]' ../../config/cluster-secrets.sops.yaml) -SECRET_DOCKER_PASSWORD = $(shell sops -d --extract '["stringData"]["SECRET_SIMPLEBOOKMARKS_DOCKER_PASSWORD"]' ../../config/cluster-secrets.sops.yaml) -SECRET_DOCKER_EMAIL = $(shell sops -d --extract '["stringData"]["SECRET_SIMPLEBOOKMARKS_DOCKER_EMAIL"]' ../../config/cluster-secrets.sops.yaml) - -generate-registry-secret: - kubectl create secret docker-registry docker-registry-harbor --docker-server=harbor.$(SECRET_DOMAIN)/simplebookmarks --docker-username=$(SECRET_DOCKER_USERNAME) --docker-password=$(SECRET_DOCKER_PASSWORD) --docker-email=$(SECRET_DOCKER_EMAIL) --dry-run=client -o yaml > ./docker-secret.yaml diff --git a/cluster/apps/simplebookmarks-staging/apps.yaml b/cluster/apps/simplebookmarks-staging/apps.yaml new file mode 100644 index 00000000..6d0171c3 --- /dev/null +++ b/cluster/apps/simplebookmarks-staging/apps.yaml @@ -0,0 +1,23 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1beta2 +kind: Kustomization +metadata: + name: simplebookmarks-staging + namespace: flux-system +spec: + interval: 10m + targetNamespace: simplebookmarks-staging + sourceRef: + kind: GitRepository + name: simplebookmarks-deploy + path: "./staging" + prune: true + decryption: + provider: sops + secretRef: + name: sops-age + postBuild: + substituteFrom: + - kind: ConfigMap + name: cluster-settings + - kind: Secret + name: cluster-secrets diff --git a/cluster/apps/simplebookmarks-staging/certificate.yaml b/cluster/apps/simplebookmarks-staging/certificate.yaml deleted file mode 100644 index 7fd61d81..00000000 --- a/cluster/apps/simplebookmarks-staging/certificate.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: tls-staging-api - namespace: simplebookmarks-staging - annotations: - cert-manager.io/issue-temporary-certificate: "true" -spec: - commonName: api.staging.${SECRET_SIMPLEBOOKMARKS_DOMAIN} - secretName: tls-staging-api - dnsNames: - - api.staging.${SECRET_SIMPLEBOOKMARKS_DOMAIN} - issuerRef: - name: letsencrypt-production - kind: ClusterIssuer diff --git a/cluster/apps/simplebookmarks-staging/docker-secret.yaml b/cluster/apps/simplebookmarks-staging/docker-secret.yaml deleted file mode 100644 index 7d6d924a..00000000 --- a/cluster/apps/simplebookmarks-staging/docker-secret.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -data: - .dockerconfigjson: eyJhdXRocyI6eyJoYXJib3IuZGhvc3RpbmcueHl6L3NpbXBsZWJvb2ttYXJrcyI6eyJ1c2VybmFtZSI6InNpbXBsZWJvb2ttYXJrcyIsInBhc3N3b3JkIjoiYmdOeVFCQm1xdFRkMjNGY0p3WVVYa21sYXJuZGZ2MFgiLCJlbWFpbCI6ImR2ZF9sQGhvdG1haWwuY29tIiwiYXV0aCI6ImMybHRjR3hsWW05dmEyMWhjbXR6T21KblRubFJRa0p0Y1hSVVpESXpSbU5LZDFsVldHdHRiR0Z5Ym1SbWRqQlkifX19 -kind: Secret -metadata: - creationTimestamp: null - name: docker-registry-harbor -type: kubernetes.io/dockerconfigjson diff --git a/cluster/apps/simplebookmarks-staging/kustomization.yaml b/cluster/apps/simplebookmarks-staging/kustomization.yaml index 1f63f162..167962d5 100644 --- a/cluster/apps/simplebookmarks-staging/kustomization.yaml +++ b/cluster/apps/simplebookmarks-staging/kustomization.yaml @@ -1,8 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - docker-secret.yaml - - certificate.yaml - - route.yaml + - ssh-credentials.sops.yaml + - repository.yaml - oauth2-proxy-helm-release.yaml + - apps.yaml namespace: simplebookmarks-staging diff --git a/cluster/apps/simplebookmarks-staging/repository.yaml b/cluster/apps/simplebookmarks-staging/repository.yaml new file mode 100644 index 00000000..ecbaa010 --- /dev/null +++ b/cluster/apps/simplebookmarks-staging/repository.yaml @@ -0,0 +1,11 @@ +apiVersion: source.toolkit.fluxcd.io/v1beta1 +kind: GitRepository +metadata: + name: simplebookmarks-deploy +spec: + interval: 5m + url: ssh://git@gitlab.com/lefeverd/simplebookmarks-deploy.git + ref: + branch: feature/flux + secretRef: + name: ssh-credentials diff --git a/cluster/apps/simplebookmarks-staging/route.yaml b/cluster/apps/simplebookmarks-staging/route.yaml deleted file mode 100644 index 9c1fc25b..00000000 --- a/cluster/apps/simplebookmarks-staging/route.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -## Route going to oauth2-proxy service -apiVersion: traefik.containo.us/v1alpha1 -kind: IngressRoute -metadata: - name: staging-proxy - namespace: simplebookmarks-staging -spec: - entryPoints: - - websecure - routes: - - kind: Rule - match: Host(`proxy.staging.${SECRET_SIMPLEBOOKMARKS_DOMAIN}`) - priority: 10 - services: - - name: oauth2-proxy - port: 80 - tls: - secretName: tls-staging-proxy diff --git a/cluster/apps/simplebookmarks-staging/ssh-credentials.sops.yaml b/cluster/apps/simplebookmarks-staging/ssh-credentials.sops.yaml new file mode 100644 index 00000000..7c27d658 --- /dev/null +++ b/cluster/apps/simplebookmarks-staging/ssh-credentials.sops.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: Secret +metadata: + name: ssh-credentials + namespace: flux-system +stringData: + identity: ENC[AES256_GCM,data:hcFSjn/7Wq76HLuzwQowO5ZY34m62Qsq4LSokzv6ef+4D7VI8JWaZxHxztyNTI+gLKgv5j58G7Hnf3BxOCi6xKfXBvEYSWg/aNRoZ3F3pEPbNXCRx0f5iBIRNL+JrzAHwtTpQQ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Jfdf0z4Kpa1ATr40pSGY2608LkdHroAxKuev0WMiclsWulYIdU/XwlUAhpx7BBtzSy/ZDqY0Dnttri97pP9toLvg==,iv:oaCCLbcaCpoWB8JFH94d3MZnj5WPoI5zee3RrLKLDWE=,tag:WLLed5gix5Po9VQvoYNY1A==,type:str] + identity.pub: ENC[AES256_GCM,data:uMBD761X9MRV53o5EM1tFnWb3YTt/Fa8p65rhPEmj4ODtQekBCQuwMqiKpyBb6ApSsda3NquZ7SPZOz7tnB09TsNe/MVGtEoxCyZXbJYeCDHYa00ws1BEASpmannjTp3WFl3AEsUe/DZVeZIgBWEIrVdIbGjS69oPn6m1LjPAGxGeAldJTszzuGIeIXu2D0d3e5NbtztfEu2UnZ2Zb7IossFHLvWGFDwFnEObnyRBU821Xdwlz4MBv1FvbhtM/cDojsEqdD9Kk1hSrrQ5hawzNdypTQNyVmp+Q8diWqagI2dTOpLPbgfu0KInp5Z4PUz/OxgdY0IZHozZJQcZXBYY87rj236YQclJSCb0dITtFRlXe7ptXCFgSQTl7gU+dZZTP9wXHGoUCiryfqFnaoroz+t1R1sq2qtPGIxSN4ge4BUyBPW2VfgBGf6VZnTZSaqMmfQXJSWocgT6waphGbjuhlDUHIIpJCoIc4XQppTQ/FgEULSyouk7BkB8/1iEuCHQsBAgFQp2a7NOmJL2RQcQMNg21ViR8GErloWrLwYdUiMkoQdCKYXksbcpC0TgNRoy1KNvAJPVbJh+5luk6j7dfS0nXaW3tgXtvItjanWJymGaajy5aVfeEHe9Q6lzgcI2QgtsOLLxaH5qtBi+WTBgvRdgarXZPhlpw4KiS0RXATBp0ZNiVerBcfy0lxkrV56gttVkzxsffhmgYy43Spl8WI2oRyY4cjp6Q==,iv:RGzQKQ2KVAD1LD5121uvXP6MNElqbC5PiYIgtzL/9QU=,tag:TLeyNW2mYpkodG593RNy1w==,type:str] + known_hosts: ENC[AES256_GCM,data:XG+Dlc+uZjn8IG0nXFd4JR97WfBDv0S1t4ehd46l2twXcww9WdMPKfdgPBnRS0J+/GDj9eon0TVkwGcar7f4cjJkSCjFmPS4TumZ8b0Tmg/oH2TVDeo7sRKSzpxnmEvEkG4JQZT+lqE3XDTaECc6oAU062pDzTlIJWXtb4zZo7KYMSXUK7xXoLVs54w33Z0XWYcyLXVOyxyNkdFFwly3F1CIfwExvKeDpjtX,iv:7XEh+UBgbtHliyaqM3wZbSciZkVPx9t5s5NVBI4tP4E=,tag:HvRPiiOwGaXT68XHQCxw/g==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age1adgzd3kcelpz23rfek7hgp9saega7vea9n2fpkd6qqunpczfpv5sw8ns4a + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvakRHZ0JTOVZpb2tvVU9D + WndkeXhNRWdyUUpTRmt1MkdONHVTcjhoQ0h3CnRKa2JGUFFoSjFaRDk2TTAxUmZu + MnlkdjRhUzNlVVFuLythc1JFNG03cVEKLS0tIEtoZXAxYS8wZTI4QXA5MWlvQjVI + ZDgzRUJUTUhJQVp2VTVRYWJPYXRwbkkK66pem98A3JJ5T4kNce1tCXA9uFxDtHHQ + FRO78agCv3niubTBlBCFfBWotIqJ+TxxwGlOu6hW1P5uytOUlHn0kA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2023-03-25T21:16:26Z" + mac: ENC[AES256_GCM,data:fKpRoKFPH93RTpJZ3mZ13jAps0iTsNuSGO0lhnmKdDO4xIkVALfCOS63lyMf9B4rppVRu8QNL0a2zaPiikZ3zKiTI//GDzInlGC8ImvXEMBfmzSyKNFjTiGPAco8gta+6cMG2Qo9yMxkrIrGxM4JqC9htJpyKjEk4meF8jBqZmk=,iv:N2hAYJsSPPA4k656oUwSQByrBqMRIeOUoQQ2mvoxFww=,tag:ZopRqF0ygsEgfOs6Qt2zaA==,type:str] + pgp: [] + encrypted_regex: ^(data|stringData)$ + version: 3.7.1