Skip to content

Commit f70c855

Browse files
feat: deploy sealed secrets from the values repo (#1924)
Co-authored-by: Dennis van Kekem <[email protected]>
1 parent a2f1349 commit f70c855

File tree

18 files changed

+393
-123
lines changed

18 files changed

+393
-123
lines changed

.values/env/settings.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 28
1+
version: 33

.values/env/teams.yaml

-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
teamConfig:
22
admin:
33
id: admin
4-
managedMonitoring:
5-
alertmanager: true
6-
grafana: true
7-
prometheus: true
8-
selfService:
9-
access:
10-
- shell
11-
- downloadCertificateAuthority
12-
policies:
13-
- edit policies
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{{- $v := .Values }}
2+
{{- $a := $v.apps.argocd }}
3+
{{- if $a.enabled }}
4+
apiVersion: argoproj.io/v1alpha1
5+
kind: Application
6+
metadata:
7+
name: team-{{ $v.teamId }}-values-gitops
8+
namespace: argocd
9+
spec:
10+
project: team-{{ $v.teamId }}
11+
source:
12+
repoURL: {{ $v.gitOps.valuesRepoUrl }}
13+
targetRevision: HEAD
14+
path: 'env/teams/{{ $v.teamId }}/sealedsecrets'
15+
destination:
16+
server: https://kubernetes.default.svc
17+
namespace: team-{{ $v.teamId }}
18+
syncPolicy:
19+
automated:
20+
allowEmpty: false
21+
prune: true
22+
selfHeal: true
23+
retry:
24+
backoff:
25+
# duration - Retry backoff base duration. Input needs to be a duration (e.g. 2m, 1h) (default 5s)
26+
# factor - Factor multiplies the base duration after each failed retry (default 2)
27+
# maxDuration - Max retry backoff duration. Input needs to be a duration (e.g. 2m, 1h) (default 3m0s)
28+
duration: 10s
29+
factor: 2
30+
syncOptions: []
31+
{{- end }}

charts/team-ns/templates/argocd/argocd-project.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
# Allow manifests to deploy from any Git repos
1515
sourceRepos:
1616
- {{ $v.gitOps.teamRepoUrl }}
17+
- {{ $v.gitOps.valuesRepoUrl }}
1718
{{- range $v.workloads }}
1819
- {{ .url }}
1920
{{- end }}

charts/team-ns/templates/sealedsecrets.yaml

-55
This file was deleted.

helmfile.d/snippets/defaults.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1335,4 +1335,4 @@ environments:
13351335
upgrade:
13361336
version: main
13371337
# TODO: update this when schema version changes
1338-
version: 32
1338+
version: 33

helmfile.d/snippets/env.gotmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ environments:
4444
- {{ $database }}
4545
{{- end }}{{ end }}
4646
{{- range $team := $teams }}
47-
{{- range $type := list "services" "netpols" "jobs" "workloads" "backups" "builds" "policies" "sealedsecrets" "apps"}}
47+
{{- range $type := list "services" "netpols" "jobs" "workloads" "backups" "builds" "policies" "apps"}}
4848
{{- if eq (exec "bash" (list "-c" (printf "( test -f $ENV_DIR/env/teams/%s.%s.yaml && echo 'true' ) || echo 'false'" $type $team)) | trim) "true" }}
4949
- {{ $ENV_DIR }}/env/teams/{{ $type }}.{{ $team }}.yaml
5050
{{- end }}

0 commit comments

Comments
 (0)