Skip to content

Commit

Permalink
feat: 🧵 split argo applications: one per repo
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieulaude authored and this-is-tobi committed Jul 10, 2024
1 parent 815246c commit ea87d14
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Helm chart automated files
/charts/*/charts
/charts/*/Chart.lock
6 changes: 5 additions & 1 deletion charts/dso-env/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ apiVersion: v2
name: dso-env
description: Creates argocd Project and Applications to deploy DSO project repositories.
type: application
version: 1.1.1
version: 1.2.0
appVersion: 1.0.0
maintainers:
- name: this-is-tobi
email: [email protected]
url: https://this-is-tobi.com
17 changes: 12 additions & 5 deletions charts/dso-env/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
# dso-env

![Version: 1.1.1](https://img.shields.io/badge/Version-1.1.1-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)
![Version: 1.2.0](https://img.shields.io/badge/Version-1.2.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)

Creates argocd Project and Applications to deploy DSO project repositories.

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| this-is-tobi | <[email protected]> | <https://this-is-tobi.com> |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| application.destination.name | string | `""` | Nom du cluster applicatif cible |
| application.destination.name | string | `"dest"` | Nom du cluster applicatif cible |
| application.destination.namespace | string | `"app1"` | Nom du namespace applicatif cible |
| application.repositories | list | `[{"path":".","repoURL":"https://gitlab.com/projects/org/demo/quota-explorer.git","targetRevision":"main"}]` | Liste des dépôts à déployer |
| application.repositories | list | `[{"name":"quota-explorer","path":".","repoURL":"https://gitlab.com/projects/org/demo/quota-explorer.git","targetRevision":"main"}]` | Liste des dépôts à déployer |
| application.sourceReposPrefix | string | `"https://gitlab.com/projects/org/demo"` | Préfixe des dépôts autorisés |
| argocd.namespace | string | `"argocd"` | Namespace de création des objets ArgoCD |
| argocd.nsChartVersion | string | `"1.0.0"` | Version du Chart dso-ns à utiliser |
| argocd.project | string | `"project1"` | Préfixe des projets ArgoCD à créer |
| commonLabels | object | `{}` | Labels appliqués sur les différents objets |
| commonLabels | string | `""` | Labels appliqués sur les différents objets |
| environment.roGroup | string | `"/project/environment/RO"` | Nom du groupe à autoriser en lecture seule sur les objets applicatifs (-app) déployés par ArgoCD |
| environment.rwGroup | string | `"/project/environment/RW"` | Nom du groupe à autoriser en lecture/écriture sur les objets applicatifs (-app) déployés par ArgoCD |
| environment.valueFilePath | string | `"values.yaml"` | Chemin du fichier à utiliser lors de la récupération des values |
| environment.valueFileRepository | string | `"https://gitlab.com/projects/Infra/org/demo/infra.git"` | URL du repo avec le fichier values à utiliser pour cet environnement |
| environment.valueFileRevision | string | `"HEAD"` | Revision Git à utiliser lors de la récupération des values |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
21 changes: 14 additions & 7 deletions charts/dso-env/templates/application-app.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
{{- range .Values.application.repositories }}
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ .Values.argocd.project }}-app
namespace: {{ .Values.argocd.namespace }}
name: {{ $.Values.argocd.project }}-app-{{ .name }}
namespace: {{ $.Values.argocd.namespace }}
labels:
app.kubernetes.io/managed-by: dso-console
{{- .Values.commonLabels | toYaml | nindent 4 }}
{{- if $.Values.commonLabels -}}
{{- $.Values.commonLabels | toYaml | nindent 4 }}
{{- end }}
spec:
project: {{ .Values.argocd.project }}-app
sources: {{ .Values.application.repositories | toYaml | nindent 4 }}
project: {{ $.Values.argocd.project }}-app
source:
repoURL: {{ .repoURL }}
targetRevision: {{ .targetRevision }}
path: {{ .path }}
destination:
name: {{ .Values.application.destination.name }}
namespace: {{ .Values.application.destination.namespace }}
name: {{ $.Values.application.destination.name }}
namespace: {{ $.Values.application.destination.namespace }}
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: true
{{- end }}
4 changes: 3 additions & 1 deletion charts/dso-env/templates/application-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ metadata:
namespace: {{ .Values.argocd.namespace }}
labels:
app.kubernetes.io/managed-by: dso-console
{{- .Values.commonLabels | toYaml | nindent 4 }}
{{- if $.Values.commonLabels -}}
{{- $.Values.commonLabels | toYaml | nindent 4 }}
{{- end }}
spec:
project: {{ .Values.argocd.project }}-env
sources:
Expand Down
4 changes: 3 additions & 1 deletion charts/dso-env/templates/project-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ kind: AppProject
metadata:
labels:
app.kubernetes.io/managed-by: dso-console
{{- .Values.commonLabels | toYaml | nindent 4 }}
{{- if $.Values.commonLabels -}}
{{- $.Values.commonLabels | toYaml | nindent 4 }}
{{- end }}
name: {{ .Values.argocd.project }}-app
namespace: {{ .Values.argocd.namespace }}
spec:
Expand Down
4 changes: 3 additions & 1 deletion charts/dso-env/templates/project-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ kind: AppProject
metadata:
labels:
app.kubernetes.io/managed-by: dso-console
{{- .Values.commonLabels | toYaml | nindent 4 }}
{{- if $.Values.commonLabels -}}
{{- $.Values.commonLabels | toYaml | nindent 4 }}
{{- end }}
name: {{ .Values.argocd.project }}-env
namespace: {{ .Values.argocd.namespace }}
spec:
Expand Down
9 changes: 6 additions & 3 deletions charts/dso-env/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -- Labels appliqués sur les différents objets
commonLabels: {}
commonLabels: ""
argocd:
# -- Préfixe des projets ArgoCD à créer
project: project1
Expand All @@ -8,6 +8,8 @@ argocd:
# -- Version du Chart dso-ns à utiliser
nsChartVersion: 1.0.0
environment:
# -- URL du repo avec le fichier values à utiliser pour cet environnement
valueFileRepository: https://gitlab.com/projects/Infra/org/demo/infra.git
# -- Revision Git à utiliser lors de la récupération des values
valueFileRevision: HEAD
# -- Chemin du fichier à utiliser lors de la récupération des values
Expand All @@ -21,11 +23,12 @@ application:
sourceReposPrefix: https://gitlab.com/projects/org/demo
destination:
# -- Nom du cluster applicatif cible
name: ""
name: dest
# -- Nom du namespace applicatif cible
namespace: app1
# -- Liste des dépôts à déployer
repositories:
- repoURL: https://gitlab.com/projects/org/demo/quota-explorer.git
- name: quota-explorer
repoURL: https://gitlab.com/projects/org/demo/quota-explorer.git
targetRevision: main
path: '.'
2 changes: 1 addition & 1 deletion charts/dso-ns/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: dso-ns
description: A Helm chart to create all the necessary resources for deploying applications by the DSO console (namespace, secrets, quota, ...).
version: 1.0.0
version: 1.0.1
appVersion: 1.0.0
4 changes: 2 additions & 2 deletions charts/dso-ns/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dso-ns

![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)
![Version: 1.0.1](https://img.shields.io/badge/Version-1.0.1-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)

A Helm chart to create all the necessary resources for deploying applications by the DSO console (namespace, secrets, quota, ...).

Expand All @@ -14,4 +14,4 @@ A Helm chart to create all the necessary resources for deploying applications by
| commonLabels | object | `{}` | Labels appliqués sur les différents objets |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
1 change: 0 additions & 1 deletion charts/dso-ns/templates/quota.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ spec:
limits.memory: {{ .Values.application.quota.memory }}
requests.cpu: {{ .Values.application.quota.cpu | quote }}
requests.memory: {{ .Values.application.quota.memory }}

0 comments on commit ea87d14

Please sign in to comment.