feat(sealed-secrets): add sealed secrets management scripts and configurations
This commit is contained in:
Regular → Executable
@@ -4,7 +4,7 @@ metadata:
|
|||||||
name: nowchess
|
name: nowchess
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
annotations:
|
annotations:
|
||||||
kargo.akuity.io/authorized-stage: nowchess-kargo:prod
|
kargo.akuity.io/authorized-stage: nowchess-kargo:eu-central-1-prod
|
||||||
spec:
|
spec:
|
||||||
project: default
|
project: default
|
||||||
destination:
|
destination:
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: sealed-secrets
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
destination:
|
||||||
|
namespace: kube-system
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
sources:
|
||||||
|
- repoURL: https://bitnami-labs.github.io/sealed-secrets
|
||||||
|
chart: sealed-secrets
|
||||||
|
targetRevision: 2.16.1
|
||||||
|
helm:
|
||||||
|
valueFiles:
|
||||||
|
- $values/sealed-secrets/eu-central-1/values.yaml
|
||||||
|
- repoURL: git@git.janis-eccarius.de:NowChess/GitOps.git
|
||||||
|
path: ./sealed-secrets/eu-central-1
|
||||||
|
ref: values
|
||||||
|
targetRevision: main
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: secrets
|
||||||
|
namespace: argocd
|
||||||
|
annotations:
|
||||||
|
argocd.argoproj.io/sync-wave: "1"
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
destination:
|
||||||
|
namespace: argocd
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
sources:
|
||||||
|
- repoURL: git@git.janis-eccarius.de:NowChess/GitOps.git
|
||||||
|
path: ./secrets
|
||||||
|
targetRevision: main
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
@@ -6,4 +6,4 @@ spec:
|
|||||||
promotionPolicies:
|
promotionPolicies:
|
||||||
- autoPromotionEnabled: true
|
- autoPromotionEnabled: true
|
||||||
stageSelector:
|
stageSelector:
|
||||||
name: regex:^staging|prod$
|
name: regex:^staging|eu-central-1-prod$
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ spec:
|
|||||||
kind: Stage
|
kind: Stage
|
||||||
apiVersion: kargo.akuity.io/v1alpha1
|
apiVersion: kargo.akuity.io/v1alpha1
|
||||||
metadata:
|
metadata:
|
||||||
name: prod
|
name: eu-central-1-prod
|
||||||
namespace: nowchess-kargo
|
namespace: nowchess-kargo
|
||||||
annotations:
|
annotations:
|
||||||
kargo.akuity.io/color: green
|
kargo.akuity.io/color: green
|
||||||
|
|||||||
Executable
+28
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
CONTROLLER_NAME="sealed-secrets"
|
||||||
|
CONTROLLER_NS="kube-system"
|
||||||
|
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
SECRETS_DIR="$REPO_ROOT/secrets"
|
||||||
|
|
||||||
|
seal_file() {
|
||||||
|
local f="$1"
|
||||||
|
local tmp="${f}.tmp"
|
||||||
|
kubeseal \
|
||||||
|
--controller-name="$CONTROLLER_NAME" \
|
||||||
|
--controller-namespace="$CONTROLLER_NS" \
|
||||||
|
--format=yaml \
|
||||||
|
< "$f" > "$tmp"
|
||||||
|
mv "$tmp" "$f"
|
||||||
|
echo "sealed: $f"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Only seal plain Secrets (not already-sealed SealedSecrets or kustomizations)
|
||||||
|
while IFS= read -r -d '' f; do
|
||||||
|
if grep -q "^kind: Secret$" "$f" 2>/dev/null; then
|
||||||
|
seal_file "$f"
|
||||||
|
fi
|
||||||
|
done < <(find "$SECRETS_DIR" -name "*.yaml" ! -name "kustomization.yaml" -print0)
|
||||||
|
|
||||||
|
echo "done — commit the sealed files and push"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
fullnameOverride: sealed-secrets
|
||||||
Reference in New Issue
Block a user