From bac4b15974bb583cb6fdc08130ba188398790884 Mon Sep 17 00:00:00 2001 From: Mathieu LAUDE Date: Tue, 23 Apr 2024 15:56:44 +0200 Subject: [PATCH] feat: :rocket: second chart to deploy ns resources --- README.md | 27 +++++++++++++++++++++++++++ charts/dso-env/README.md | 2 -- charts/dso-env/values.yaml | 5 ----- charts/dso-ns/Chart.yaml | 5 +++++ charts/dso-ns/README.md | 17 +++++++++++++++++ charts/dso-ns/templates/ns.yaml | 7 +++++++ charts/dso-ns/templates/quota.yaml | 15 +++++++++++++++ charts/dso-ns/values.yaml | 12 ++++++++++++ 8 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 README.md create mode 100644 charts/dso-ns/Chart.yaml create mode 100644 charts/dso-ns/README.md create mode 100644 charts/dso-ns/templates/ns.yaml create mode 100644 charts/dso-ns/templates/quota.yaml create mode 100644 charts/dso-ns/values.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..0aeae4f --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# CPiN Charts + +## Description + +Ce dépôt héberge les Helm Charts développés et maintenus par Cloud Pi Native. + +Il expose également un Helm Repository sur [cloud-pi-native.github.io/helm-charts](https://cloud-pi-native.github.io/helm-charts/index.yaml) grâce à Github Pages et la Github Action [chart releaser](https://github.com/helm/chart-releaser-action). + + +## Utilisation + +### CLI +```sh +helm repo add cpin https://cloud-pi-native.github.io/helm-charts +helm search repo dso +helm install dso-env cpin/dso-env +``` + +### ArgoCD + +```yaml +[...] +sources: +- repoURL: https://github.com/cloud-pi-native/helm-charts.git + targetRevision: dso-env-1.0.0 + path: charts/dso-env +``` diff --git a/charts/dso-env/README.md b/charts/dso-env/README.md index ec954dc..f5ec168 100644 --- a/charts/dso-env/README.md +++ b/charts/dso-env/README.md @@ -10,8 +10,6 @@ Creates argocd Project and Applications to deploy DSO project repositories. |-----|------|---------|-------------| | application.destination.name | string | `""` | Nom du cluster applicatif cible | | application.destination.namespace | string | `"app1"` | Nom du namespace applicatif cible | -| application.quota.cpu | int | `nil` | Quota CPU pour le namespace | -| application.quota.memory | string | `nil` | Quota mémoire pour le namespace | | application.repositories | list | `[{"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 | diff --git a/charts/dso-env/values.yaml b/charts/dso-env/values.yaml index ac7ed50..f15d58d 100644 --- a/charts/dso-env/values.yaml +++ b/charts/dso-env/values.yaml @@ -17,11 +17,6 @@ environment: application: # -- Préfixe des dépôts autorisés sourceReposPrefix: https://gitlab.com/projects/org/demo - quota: - # -- (int) Quota CPU pour le namespace - cpu: - # -- Quota mémoire pour le namespace - memory: destination: # -- Nom du cluster applicatif cible name: "" diff --git a/charts/dso-ns/Chart.yaml b/charts/dso-ns/Chart.yaml new file mode 100644 index 0000000..fa25aa2 --- /dev/null +++ b/charts/dso-ns/Chart.yaml @@ -0,0 +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 +appVersion: 1.0.0 diff --git a/charts/dso-ns/README.md b/charts/dso-ns/README.md new file mode 100644 index 0000000..310423b --- /dev/null +++ b/charts/dso-ns/README.md @@ -0,0 +1,17 @@ +# 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) + +A Helm chart to create all the necessary resources for deploying applications by the DSO console (namespace, secrets, quota, ...). + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| application.destination.namespace | string | `"app1"` | Nom du namespace applicatif cible | +| application.quota.cpu | int | `nil` | Quota CPU pour le namespace | +| application.quota.memory | string | `nil` | Quota mémoire pour le namespace | +| 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) diff --git a/charts/dso-ns/templates/ns.yaml b/charts/dso-ns/templates/ns.yaml new file mode 100644 index 0000000..cc20346 --- /dev/null +++ b/charts/dso-ns/templates/ns.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.application.destination.namespace }} + labels: + app.kubernetes.io/managed-by: dso-console + {{- .Values.commonLabels | toYaml | nindent 4 }} diff --git a/charts/dso-ns/templates/quota.yaml b/charts/dso-ns/templates/quota.yaml new file mode 100644 index 0000000..e6cadd8 --- /dev/null +++ b/charts/dso-ns/templates/quota.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ResourceQuota +metadata: + name: dso-quota + namespace: {{ .Values.application.destination.namespace }} + labels: + app.kubernetes.io/managed-by: dso-console + {{- .Values.commonLabels | toYaml | nindent 4 }} +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 }} + diff --git a/charts/dso-ns/values.yaml b/charts/dso-ns/values.yaml new file mode 100644 index 0000000..5fcba2a --- /dev/null +++ b/charts/dso-ns/values.yaml @@ -0,0 +1,12 @@ +# -- Labels appliqués sur les différents objets +commonLabels: {} +application: + destination: + # -- Nom du namespace applicatif cible + namespace: app1 + quota: + # -- (int) Quota CPU pour le namespace + cpu: + # -- Quota mémoire pour le namespace + memory: +