Skip to content

Commit

Permalink
fix: add external secret for argocd oidc config
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsimonemms committed Dec 4, 2024
1 parent d07264f commit 55807be
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/kubernetes/argocd.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ data "infisical_secrets" "common_secrets" {
folder_path = "/"
}

# An external-secret exists to manage drift
resource "kubernetes_secret_v1" "oidc_secret" {
metadata {
name = "oidc"
Expand Down
22 changes: 22 additions & 0 deletions registry/clusters/dev/components/argocd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argocd-components
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "30"
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://github.com/mrsimonemms/infrastructure
path: registry/components/argocd
targetRevision: HEAD
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated:
prune: true
selfHeal: true
22 changes: 22 additions & 0 deletions registry/clusters/prod/components/argocd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argocd-components
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "30"
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://github.com/mrsimonemms/infrastructure
path: registry/components/argocd
targetRevision: HEAD
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated:
prune: true
selfHeal: true
22 changes: 22 additions & 0 deletions registry/components/argocd/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This secret is created by Terraform, but the external-secret is to manage drift
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: oidc
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "10"
spec:
refreshInterval: 10s
secretStoreRef:
kind: ClusterSecretStore
name: infisical
target:
name: oidc
data:
- secretKey: clientId
remoteRef:
key: OIDC_CLIENT_ID
- secretKey: clientSecret
remoteRef:
key: OIDC_CLIENT_SECRET

0 comments on commit 55807be

Please sign in to comment.