From 28ad3c783af1bd7e7b14476142d8666a805bf5e1 Mon Sep 17 00:00:00 2001 From: "thibault.raquet" Date: Fri, 27 Sep 2024 16:04:16 +0200 Subject: [PATCH] add vault auto unseal --- .../resources/hashicorp-vault.yaml | 24 +++++++++++++++++++ .../resources/kustomization.yaml | 1 + infrastructure/traefik/helm-release.yaml | 8 ------- 3 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 infrastructure/hashicorp-vault/external-secrets/resources/hashicorp-vault.yaml diff --git a/infrastructure/hashicorp-vault/external-secrets/resources/hashicorp-vault.yaml b/infrastructure/hashicorp-vault/external-secrets/resources/hashicorp-vault.yaml new file mode 100644 index 0000000..06c7be3 --- /dev/null +++ b/infrastructure/hashicorp-vault/external-secrets/resources/hashicorp-vault.yaml @@ -0,0 +1,24 @@ +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: docker-registry-credentials + namespace: common-services +spec: + refreshInterval: "15s" + secretStoreRef: + name: vault-secret-store + kind: ClusterSecretStore + target: + name: docker-registry-credentials + template: + engineVersion: v2 + type: kubernetes.io/dockerconfigjson + data: + .dockerconfigjson: "{{ .config }}" + data: + - secretKey: config + remoteRef: + key: secret/docker + property: auth_config + decodingStrategy: Base64 diff --git a/infrastructure/hashicorp-vault/external-secrets/resources/kustomization.yaml b/infrastructure/hashicorp-vault/external-secrets/resources/kustomization.yaml index 2ade5d7..d21ca3c 100644 --- a/infrastructure/hashicorp-vault/external-secrets/resources/kustomization.yaml +++ b/infrastructure/hashicorp-vault/external-secrets/resources/kustomization.yaml @@ -6,6 +6,7 @@ resources: - flux-resources.yaml - gitlab-agent.yaml - gitlab-runner.yaml + - hashicorp-vault.yaml - mariadb.yaml - prometheus-stack.yaml - review.yaml diff --git a/infrastructure/traefik/helm-release.yaml b/infrastructure/traefik/helm-release.yaml index 8c590c9..b895fa1 100644 --- a/infrastructure/traefik/helm-release.yaml +++ b/infrastructure/traefik/helm-release.yaml @@ -86,14 +86,6 @@ spec: enabled: true extraObjects: - - apiVersion: traefik.io/v1alpha1 - kind: Middleware - metadata: - name: auth - namespace: common-services - spec: - basicAuth: - secret: traefik-auth-ldc-oe - apiVersion: traefik.io/v1alpha1 # Redirect www URLs to their no-www equivalent kind: Middleware metadata: