Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🧵 split argo applications: one per repo #37

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
this-is-tobi marked this conversation as resolved.
Show resolved Hide resolved
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: '.'
6 changes: 5 additions & 1 deletion charts/dso-ns/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
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
maintainers:
- name: this-is-tobi
email: [email protected]
url: https://this-is-tobi.com
10 changes: 8 additions & 2 deletions charts/dso-ns/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# 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, ...).

## Maintainers

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

## Values

| Key | Type | Default | Description |
Expand All @@ -14,4 +20,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)
2 changes: 2 additions & 0 deletions charts/dso-ns/templates/ns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ metadata:
name: {{ .Values.application.destination.namespace }}
labels:
app.kubernetes.io/managed-by: dso-console
{{- if .Values.commonLabels }}
{{- .Values.commonLabels | toYaml | nindent 4 }}
{{- end }}
3 changes: 2 additions & 1 deletion charts/dso-ns/templates/quota.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ metadata:
namespace: {{ .Values.application.destination.namespace }}
labels:
app.kubernetes.io/managed-by: dso-console
{{- if .Values.commonLabels }}
{{- .Values.commonLabels | toYaml | nindent 4 }}
{{- end }}
spec:
hard:
limits.cpu: {{ .Values.application.quota.cpu | quote }}
limits.memory: {{ .Values.application.quota.memory }}
requests.cpu: {{ .Values.application.quota.cpu | quote }}
requests.memory: {{ .Values.application.quota.memory }}

1 change: 0 additions & 1 deletion charts/dso-ns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ application:
cpu:
# -- Quota mémoire pour le namespace
memory: