Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

add-helm-charts : import initial 👷 #156

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
23 changes: 23 additions & 0 deletions helm/ohmyform/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
25 changes: 25 additions & 0 deletions helm/ohmyform/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v2
#name: feature-architecture
name: ohmyform
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
#appVersion: 23.400.0.0
appVersion: APP_VERSION
26 changes: 26 additions & 0 deletions helm/ohmyform/README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
= Helm charts
Nom de l’auteur <aitkarrafarid@gmail.com>
v1.0, 2022-02-23
:toc:
:toc-title: Liste des rubriques
:imagesdir: ../images

image::/images/helm.png[float="center"]

== Ingress
- Istio : OK
- Traefik : TODO...
- Nginx : TODO...

== Commandes CLI
----
$ helm upgrade --install \
-f ./ohmyform/values.yaml \
ohmyform ./ohmyform \
--create-namespace \
--namespace ohmyform

$ helm ls -n ohmyform

$ helm delete ohmyform -n ohmyform
----
23 changes: 23 additions & 0 deletions helm/ohmyform/charts/api/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
23 changes: 23 additions & 0 deletions helm/ohmyform/charts/api/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v2
name: api
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.0.0
17 changes: 17 additions & 0 deletions helm/ohmyform/charts/api/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.app.name }}-configmap
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Values.app.name }}
data:
CREATE_ADMIN: {{ .Values.configmap.data.CREATE_ADMIN | quote }}
ADMIN_EMAIL: {{ .Values.configmap.data.ADMIN_EMAIL }}
ADMIN_USERNAME: {{ .Values.configmap.data.ADMIN_USERNAME }}
ADMIN_PASSWORD: {{ .Values.configmap.data.ADMIN_PASSWORD }}
DATABASE_DRIVER: {{ .Values.configmap.data.DATABASE_DRIVER }}
DATABASE_URL: {{ .Values.configmap.data.DATABASE_URL }}
MAILER_URI: {{ .Values.configmap.data.MAILER_URI }}
REDIS_URL: {{ .Values.configmap.data.REDIS_URL }}
PORT: {{ .Values.configmap.data.PORT | quote }}
67 changes: 67 additions & 0 deletions helm/ohmyform/charts/api/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.app.name }}-deployment
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Values.app.name }}
spec:
replicas: {{ .Values.deployment.spec.replicas }}
selector:
matchLabels:
app: {{ .Values.app.name }}
template:
metadata:
labels:
app: {{ .Values.app.name }}
spec:
containers:
- env:
- name: CREATE_ADMIN
valueFrom:
configMapKeyRef:
name: {{ .Values.app.name }}-configmap
key: CREATE_ADMIN
- name: ADMIN_EMAIL
valueFrom:
configMapKeyRef:
name: {{ .Values.app.name }}-configmap
key: ADMIN_EMAIL
- name: ADMIN_USERNAME
valueFrom:
configMapKeyRef:
name: {{ .Values.app.name }}-configmap
key: ADMIN_USERNAME
- name: ADMIN_PASSWORD
valueFrom:
configMapKeyRef:
name: {{ .Values.app.name }}-configmap
key: ADMIN_PASSWORD
- name: DATABASE_DRIVER
valueFrom:
configMapKeyRef:
name: {{ .Values.app.name }}-configmap
key: DATABASE_DRIVER
- name: DATABASE_URL
valueFrom:
configMapKeyRef:
name: {{ .Values.app.name }}-configmap
key: DATABASE_URL
- name: MAILER_URI
valueFrom:
configMapKeyRef:
name: {{ .Values.app.name }}-configmap
key: MAILER_URI
- name: REDIS_URL
valueFrom:
configMapKeyRef:
name: {{ .Values.app.name }}-configmap
key: REDIS_URL
- name: PORT
valueFrom:
configMapKeyRef:
name: {{ .Values.app.name }}-configmap
key: PORT
image: {{ .Values.deployment.spec.templatee.spec.containers.image }}
name: {{ .Values.app.name }}
restartPolicy: {{ .Values.deployment.spec.templatee.spec.restartPolicy }}
17 changes: 17 additions & 0 deletions helm/ohmyform/charts/api/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.app.name }}-service
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Values.app.name }}
spec:
selector:
app: {{ .Values.app.name }}
type: {{ .Values.service.type }}
ports:
{{- range $port := .Values.service.spec.ports }}
- port: {{ $port.port }}
targetPort: {{ $port.targetPort }}
name: {{ $port.name }}
{{- end }}
Empty file.
23 changes: 23 additions & 0 deletions helm/ohmyform/charts/db/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
23 changes: 23 additions & 0 deletions helm/ohmyform/charts/db/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v2
name: db
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.0.0
10 changes: 10 additions & 0 deletions helm/ohmyform/charts/db/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.app.name }}-configmap
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Values.app.name }}
data:
POSTGRES_USER: {{ .Values.configmap.data.user }}
POSTGRES_DB: {{ .Values.configmap.data.dbname }}
41 changes: 41 additions & 0 deletions helm/ohmyform/charts/db/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.app.name }}-deployment
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Values.app.name }}
spec:
replicas: {{ .Values.deployment.spec.replicas }}
selector:
matchLabels:
app: {{ .Values.app.name }}
template:
metadata:
labels:
app: {{ .Values.app.name }}
spec:
containers:
- env:
- name: POSTGRES_DB
valueFrom:
configMapKeyRef:
name: {{ .Values.app.name }}-configmap
key: POSTGRES_DB
- name: POSTGRES_USER
valueFrom:
configMapKeyRef:
name: {{ .Values.app.name }}-configmap
key: POSTGRES_USER
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.app.name }}-secret
key: POSTGRES_PASSWORD
image: {{ .Values.deployment.spec.templatee.spec.containers.image }}
name: {{ .Values.app.name }}
ports:
{{- range $port := .Values.service.spec.ports }}
- containerPort: {{ $port.port }}
{{- end }}
restartPolicy: {{ .Values.deployment.spec.templatee.spec.restartPolicy }}
10 changes: 10 additions & 0 deletions helm/ohmyform/charts/db/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.app.name }}-secret
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Values.app.name }}
type: {{ .Values.secret.type }}
data:
POSTGRES_PASSWORD: {{ .Values.secret.data.pwd }}
20 changes: 20 additions & 0 deletions helm/ohmyform/charts/db/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.app.name }}-service
namespace: {{ .Values.global.namespace }}
labels:
app: {{ .Values.app.name }}
spec:
selector:
app: {{ .Values.app.name }}
#type: {{ .Values.service.type }}
type: NodePort
ports:
{{- range $port := .Values.service.spec.ports }}
- port: {{ $port.port }}
targetPort: {{ $port.targetPort }}
name: {{ $port.name }}
nodePort: 32263
{{- end }}

Empty file.
24 changes: 24 additions & 0 deletions helm/ohmyform/charts/nginx/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: nginx
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: 1.0.0
Loading