add external secrets

This commit is contained in:
thibault.raquet 2024-06-25 15:03:16 +02:00
parent 6089acab77
commit 4f6a475f23
10 changed files with 164 additions and 65 deletions

View file

@ -1,22 +1,22 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: gitlab-agent
namespace: flux-system
spec:
interval: 30s
path: ./infrastructure/gitlab-agent
prune: false
dependsOn:
- name: flux-resources
namespace: flux-system
sourceRef:
kind: GitRepository
name: cluster-k8s
healthChecks:
- apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
name: gitlab-agent
namespace: common-services
timeout: 5m
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: gitlab-agent
namespace: flux-system
spec:
interval: 30s
path: ./infrastructure/gitlab-agent
prune: false
dependsOn:
- name: flux-resources
namespace: flux-system
sourceRef:
kind: GitRepository
name: cluster-k8s
healthChecks:
- apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
name: gitlab-agent
namespace: common-services
timeout: 5m

View file

@ -1,22 +1,22 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: gitlab-runner
namespace: flux-system
spec:
interval: 30s
path: ./infrastructure/gitlab-runner
prune: false
dependsOn:
- name: flux-resources
namespace: flux-system
sourceRef:
kind: GitRepository
name: cluster-k8s
healthChecks:
- apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
name: gitlab-runner
namespace: common-services
timeout: 5m
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: gitlab-runner
namespace: flux-system
spec:
interval: 30s
path: ./infrastructure/gitlab-runner
prune: false
dependsOn:
- name: flux-resources
namespace: flux-system
sourceRef:
kind: GitRepository
name: cluster-k8s
healthChecks:
- apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
name: gitlab-runner
namespace: common-services
timeout: 5m

View file

@ -1,17 +1,17 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: ldc-custom
namespace: flux-system
spec:
interval: 30s
path: ./infrastructure/ldc-custom
prune: false
sourceRef:
kind: GitRepository
name: cluster-k8s
dependsOn:
- name: prometheus-stack
namespace: flux-system
timeout: 5m
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: ldc-custom
namespace: flux-system
spec:
interval: 30s
path: ./infrastructure/ldc-custom
prune: false
sourceRef:
kind: GitRepository
name: cluster-k8s
dependsOn:
- name: prometheus-stack
namespace: flux-system
timeout: 5m

View file

@ -0,0 +1,22 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: cloudflare-api-token-secret
namespace: common-services
spec:
refreshInterval: "15s"
secretStoreRef:
name: vault-secret-store
kind: ClusterSecretStore
target:
name: cloudflare-api-token-secret
template:
engineVersion: v2
type: Opaque
data:
api-token: "{{ .api_key }}"
data:
- secretKey: api_key
remoteRef:
key: secret/certificate
property: cloudflare_token

View file

@ -5,7 +5,7 @@ metadata:
spec:
provider:
vault:
server: "http://vault.vault.svc.cluster.local:8200"
server: "http://vault.common-services.svc.cluster.local:8200"
path: "secret"
version: "v2"
auth:
@ -13,5 +13,5 @@ spec:
# https://www.vaultproject.io/docs/auth/token
tokenSecretRef:
name: "vault-token"
namespace: "vault"
namespace: "common-services"
key: "token"

View file

@ -0,0 +1,22 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: msteams-url
namespace: flux-system
spec:
refreshInterval: "15s"
secretStoreRef:
name: vault-secret-store
kind: ClusterSecretStore
target:
name: msteams-url
template:
engineVersion: v2
type: Opaque
data:
address: "{{ .url }}"
data:
- secretKey: url
remoteRef:
key: secret/teams
property: flux_teams_webhook

View file

@ -2,7 +2,7 @@ apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: gitlab-agent-token
namespace: gitlab
namespace: common-services
spec:
refreshInterval: "15s"
secretStoreRef:

View file

@ -3,7 +3,7 @@ apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: gitlab-runner-token
namespace: gitlab
namespace: common-services
spec:
refreshInterval: "15s"
secretStoreRef:

View file

@ -0,0 +1,28 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: mariadb-credentials
namespace: common-services
spec:
refreshInterval: "15s"
secretStoreRef:
name: vault-secret-store
kind: ClusterSecretStore
target:
name: mariadb-credentials
template:
engineVersion: v2
type: Opaque
data:
mariadb-password: "{{ .password }}"
mariadb-replication-password: "{{ .root_password }}"
mariadb-root-password: "{{ .root_password }}"
data:
- secretKey: root_password
remoteRef:
key: secret/mariadb
property: root_password
- secretKey: password
remoteRef:
key: secret/mariadb
property: password

View file

@ -0,0 +1,27 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: grafana-admin
namespace: common-services
spec:
refreshInterval: "15s"
secretStoreRef:
name: vault-secret-store
kind: ClusterSecretStore
target:
name: grafana-admin
template:
engineVersion: v2
type: Opaque
data:
user: "{{ .user }}"
password: "{{ .password }}"
data:
- secretKey: user
remoteRef:
key: secret/prometheus-stack
property: grafana_user
- secretKey: password
remoteRef:
key: secret/prometheus-stack
property: grafana_admin_password