Skip to content

Commit 591e83e

Browse files
committed
feat: 🚀 add a chart dedicated to argocd managed zone
1 parent f4eb3dc commit 591e83e

File tree

6 files changed

+171
-0
lines changed

6 files changed

+171
-0
lines changed

charts/dso-argocd-zone/Chart.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v2
2+
name: dso-argocd-zone
3+
description: Creates an ApplicationSet that will scan and deploy all Console-managed applications for its zone (multiple clusters).
4+
type: application
5+
version: 1.0.0
6+
appVersion: 1.0.0
7+
maintainers:
8+
- name: cloud-pi-native
9+
email: cloudpinative-relations@interieur.gouv.fr
10+
url: https://cloud-pi-native.fr

charts/dso-argocd-zone/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# dso-argocd-zone
2+
3+
![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)
4+
5+
Creates an ApplicationSet that will scan and deploy all Console-managed applications for its zone (multiple clusters).
6+
7+
## Maintainers
8+
9+
| Name | Email | Url |
10+
| ---- | ------ | --- |
11+
| cloud-pi-native | <cloudpinative-relations@interieur.gouv.fr> | <https://cloud-pi-native.fr> |
12+
13+
## Values
14+
15+
| Key | Type | Default | Description |
16+
|-----|------|---------|-------------|
17+
| clusters | list | `[]` | List of managed cluster names for the entire zone |
18+
| dsoZoneRepo | string | `"https://gitlab.com/infra/zone.git"` | Repository URL where DSO Cosnole stores application specifications that must be applied by ArgoCD in current zone |
19+
| openshift.enabled | bool | `false` | Indicates if OpenShift specificities are needed |
20+
| vault.kvName | string | `"zone-kv"` | Name of the key-value store to use for retreiving zone secrets |
21+
| vault.roleId | string | `"app-role"` | AppRole to use when connecting to Vault |
22+
| vault.secretId | string | `"secret"` | AppRole associated secret to autorize Vault connection |
23+
| vault.url | string | `"test.com"` | URL of the Vualt instance storing zone secrets (like kubeconfigs) |
24+
25+
----------------------------------------------
26+
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- range $cluster := .Values.clusters }}
2+
---
3+
apiVersion: secrets.hashicorp.com/v1beta1
4+
kind: VaultStaticSecret
5+
metadata:
6+
name: {{ $cluster }}-cluster-secret
7+
namespace: argo-cpin
8+
spec:
9+
vaultAuthRef: vault-auth
10+
type: kv-v2
11+
mount: {{ $.Values.vault.kvName }}
12+
path: clusters/cluster-{{ $cluster }}/argocd-cluster-secret
13+
destination:
14+
create: true
15+
name: {{ $cluster }}-cluster-secret
16+
labels:
17+
'argocd.argoproj.io/secret-type': 'cluster'
18+
{{- end }}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
apiVersion: argoproj.io/v1alpha1
3+
kind: AppProject
4+
metadata:
5+
name: dso-project # Pour les Applications déployées par la Console DSO
6+
namespace: {{ .Release.Namespace }}
7+
annotations:
8+
argocd.argoproj.io/sync-wave: "1" # Evite la suppression avant les Applications
9+
spec:
10+
description: Project to deploy DSO Applications
11+
destinations:
12+
- name: "*"
13+
namespace: "*"
14+
server: "*"
15+
sourceRepos:
16+
- "https://github.com/cloud-pi-native/helm-charts.git"
17+
- "{{ .Values.dsoZoneRepo }}"
18+
---
19+
apiVersion: argoproj.io/v1alpha1
20+
kind: ApplicationSet
21+
metadata:
22+
name: dso-appset
23+
namespace: {{ .Release.Namespace }}
24+
annotations:
25+
argocd.argoproj.io/sync-wave: "2" # Evite la suppression avant l'instance ArgoCD
26+
spec:
27+
goTemplate: true
28+
generators:
29+
- git:
30+
repoURL: {{ .Values.dsoZoneRepo }}
31+
revision: HEAD
32+
files:
33+
- path: "**/values.yaml" # project/cluster/environment/values.yaml
34+
ignoreApplicationDifferences:
35+
- jsonPointers:
36+
- /spec/syncPolicy
37+
- /spec/sources/0/targetRevision
38+
template:
39+
metadata:
40+
name: {{"\"{{ index .path.segments 0 }}-{{ index .path.segments 1 }}-{{ index .path.segments 2 }}-root\"" }}
41+
namespace: {{ .Release.Namespace }}
42+
labels:
43+
app.kubernetes.io/managed-by: dso-console
44+
dso/projet: {{"\"{{ index .path.segments 0 }}\""}}
45+
dso/environment: {{"\"{{ index .path.segments 2 }}\""}}
46+
spec:
47+
project: dso-project
48+
sources:
49+
- repoURL: https://github.com/cloud-pi-native/helm-charts.git
50+
targetRevision: {{"\"{{ .argocd.envChartVersion }}\""}}
51+
path: charts/dso-env
52+
helm:
53+
valueFiles:
54+
- {{"\"$values/{{ .path.path }}/{{ .path.filename }}\""}}
55+
values: |
56+
argocd:
57+
namespace: {{ .Release.Namespace }}
58+
- repoURL: "{{ .Values.dsoZoneRepo }}"
59+
targetRevision: HEAD
60+
ref: values
61+
destination:
62+
server: https://kubernetes.default.svc
63+
namespace: {{ .Release.Namespace }}
64+
syncPolicy:
65+
automated:
66+
prune: true
67+
selfHeal: true
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{{ if not .Values.openshift.enabled -}}
2+
apiVersion: secrets.hashicorp.com/v1beta1
3+
kind: VaultConnection
4+
metadata:
5+
name: default
6+
namespace: {{ .Release.Namespace }}
7+
spec:
8+
address: {{ .Values.vault.url }}
9+
{{- end }}
10+
---
11+
apiVersion: v1
12+
kind: Secret
13+
metadata:
14+
name: vso-approle
15+
namespace: {{ .Release.Namespace }}
16+
stringData:
17+
id: {{ .Values.vault.secretId }}
18+
---
19+
apiVersion: secrets.hashicorp.com/v1beta1
20+
kind: VaultAuth
21+
metadata:
22+
name: vault-auth
23+
namespace: {{ .Release.Namespace }}
24+
spec:
25+
method: appRole
26+
mount: approle
27+
appRole:
28+
roleId: {{ .Values.vault.roleId }}
29+
secretRef: vso-approle
30+
allowedNamespaces:
31+
- {{ .Release.Namespace }}

charts/dso-argocd-zone/values.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -- Repository URL where DSO Cosnole stores application specifications that must be applied by ArgoCD in current zone
2+
dsoZoneRepo: https://gitlab.com/infra/zone.git
3+
4+
openshift:
5+
# -- Indicates if OpenShift specificities are needed
6+
enabled: false
7+
8+
vault:
9+
# -- URL of the Vualt instance storing zone secrets (like kubeconfigs)
10+
url: test.com
11+
# -- Name of the key-value store to use for retreiving zone secrets
12+
kvName: zone-kv
13+
# -- AppRole to use when connecting to Vault
14+
roleId: app-role
15+
# -- AppRole associated secret to autorize Vault connection
16+
secretId: secret
17+
18+
# -- List of managed cluster names for the entire zone
19+
clusters: []

0 commit comments

Comments
 (0)