Skip to content

Commit 9bc2f12

Browse files
authored
Merge pull request #1419 from salleman33/master
restauration des sources de la chart helm suite à un mauvais nettoyage
2 parents 900dcb2 + 3a33d69 commit 9bc2f12

File tree

8 files changed

+212
-24
lines changed

8 files changed

+212
-24
lines changed

_helm_chart/chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type: application
2828
# This is the chart version. This version number should be incremented each time you make changes
2929
# to the chart and its templates, including the app version.
3030
# Versions are expected to follow Semantic Versioning (https://semver.org/)
31-
version: 2.0.4
31+
version: 2.0.5
3232

3333
# This is the version number of the application being deployed. This version number should be
3434
# incremented each time you make changes to the application. Versions are not expected to

_helm_chart/chart/README.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Mercator Helm Chart
2+
## TL;DR
3+
4+
```bash
5+
helm install mercator .
6+
```
7+
8+
## Introduction
9+
10+
This chart bootstraps **Mercator** deployment on a [Kubernetes](https://kubernetes.io/) cluster using the [Helm](https://helm.sh/) package manager.
11+
12+
## Prerequisites
13+
- Kubernetes 1.23+
14+
- Helm 3.8.0+
15+
16+
## Persistence
17+
The Mercator chart relies on the PostgreSQL chart persistence. This means that Mercator does not persist anything.
18+
19+
## Parameters
20+
This part provides an overview of all the configurable parameters used in the `values.yaml` file for deploying the Mercator application using a Helm chart.
21+
22+
### Global parameters
23+
24+
| Parameter | Description | Default Value |
25+
|------------------------------------------------|------------------------------------------------------------------------------|----------------------------|
26+
| **replicaCount** | Number of application replicas to deploy. | `1` |
27+
| **image.repository** | Docker image repository for the Mercator application. | `ghcr.io/dbarzin/mercator` |
28+
| **image.pullPolicy** | Specifies when to pull the Docker image (`Always`, `IfNotPresent`, `Never`). | `IfNotPresent` |
29+
| **image.tag** | Tag of the Docker image. | `"latest"` |
30+
| **imagePullSecrets** | Secrets to use for pulling private Docker images. | `[]` |
31+
| **serviceAccount.create** | Specifies whether a service account should be created. | `true` |
32+
| **serviceAccount.automount** | Automatically mount the ServiceAccount’s API credentials. | `true` |
33+
| **serviceAccount.annotations** | Annotations to add to the service account. | `{}` |
34+
| **serviceAccount.name** | Name of the service account to use or create. | `""` |
35+
| **podAnnotations** | Annotations to add to the pod. | `{}` |
36+
| **podLabels** | Labels to add to the pod. | `{}` |
37+
| **podSecurityContext** | Security context for the pod. | `{}` |
38+
| **securityContext** | Security context for the container, e.g., user permissions. | `{}` |
39+
| **service.type** | Kubernetes service type (`ClusterIP`, `NodePort`, `LoadBalancer`). | `ClusterIP` |
40+
| **service.port** | Port exposed by the service. | `80` |
41+
| **ingress.enabled** | Enable or disable ingress resource creation. | `false` |
42+
| **resources** | Resource limits and requests for the application. | `{}` |
43+
| **livenessProbe.httpGet.path** | HTTP path for liveness probe. | `/` |
44+
| **livenessProbe.httpGet.port** | Port for liveness probe. | `http` |
45+
| **readinessProbe.httpGet.path** | HTTP path for readiness probe. | `/` |
46+
| **readinessProbe.httpGet.port** | Port for readiness probe. | `http` |
47+
| **autoscaling.enabled** | Enable or disable horizontal pod autoscaling. | `false` |
48+
| **autoscaling.minReplicas** | Minimum number of replicas for autoscaling. | `1` |
49+
| **autoscaling.maxReplicas** | Maximum number of replicas for autoscaling. | `100` |
50+
| **autoscaling.targetCPUUtilizationPercentage** | Target CPU utilization for autoscaling. | `80` |
51+
| **volumes** | Additional volumes for the deployment. | `[]` |
52+
| **volumeMounts** | Additional volume mounts for the deployment. | `[]` |
53+
| **nodeSelector** | Node selector for scheduling pods. | `{}` |
54+
| **tolerations** | Tolerations for scheduling pods. | `[]` |
55+
| **affinity** | Affinity rules for scheduling pods. | `{}` |
56+
57+
### Mercator parameters
58+
59+
| Parameter | Description | Default Value |
60+
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
61+
| **debug** | Enable debug mode for the application. | `false` |
62+
| **environment** | Environment to deploy (`development`, `production`). | `"development"` |
63+
| **key** | Secret key for the application. | `""` |
64+
| **reverse_proxy** | URL for the reverse proxy used by the application. | `"http://localhost"` |
65+
| **use_demo_data** | Specify if demo data should be used (1 for true, 0 for false). | `1` |
66+
67+
### Mercator LDAP parameters
68+
69+
| Parameter | Description | Default Value |
70+
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
71+
| **ldap.enabled** | Enable or disable LDAP integration. | `false` |
72+
| **ldap.type** | Type of LDAP server (e.g., Active Directory). | `"AD"` |
73+
| **ldap.host** | LDAP server host. | `"127.0.0.1"` |
74+
| **ldap.username** | LDAP bind user credentials. | `"cn=user,dc=local,dc=com"` |
75+
| **ldap.password** | Password for the LDAP bind user. | `"secret"` |
76+
| **ldap.base_dn** | Base DN for LDAP queries. | `"dc=local,dc=com"` |
77+
| **ldap.service.number** | LDAP service port number. | `"389"` |
78+
| **ldap.scope** | Scope for LDAP queries. | `"ou=Accounting,dc=com"` |
79+
80+
### Mercator SMTP parameters
81+
| Parameter | Description | Default Value |
82+
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
83+
| **smtp.host** | SMTP server host for sending emails. | `"smtp.mailtrap.io"` |
84+
| **smtp.port** | SMTP server port. | `"25"` |
85+
| **smtp.username** | SMTP username for authentication. | `""` |
86+
| **smtp.password** | SMTP password for authentication. | `""` |
87+
88+
### Mercator AWS parameters
89+
| Parameter | Description | Default Value |
90+
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
91+
| **aws.access_key_id** | AWS access key ID. | `""` |
92+
| **aws.secret_access_key** | AWS secret access key. | `""` |
93+
| **aws.default_region** | Default AWS region. | `"us-east-1"` |
94+
| **aws.bucket** | AWS S3 bucket name. | `""` |
95+
96+
### Mercator PUSHER parameters
97+
| Parameter | Description | Default Value |
98+
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
99+
| **pusher.app_id** | Pusher app ID. | `""` |
100+
| **pusher.app_key** | Pusher app key. | `""` |
101+
| **pusher.app_secret** | Pusher app secret. | `""` |
102+
103+
### Mercator KEYCLOAK parameters
104+
| Parameter | Description | Default Value |
105+
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
106+
| **keycloak.enabled** | Enable or disable Keycloak integration. | `false` |
107+
| **keycloak.client_id** | Keycloak client ID. | `""` |
108+
| **keycloak.client_secret** | Keycloak client secret. | `""` |
109+
| **keycloak.redirect_uri** | Redirect URI for Keycloak integration. | `""` |
110+
| **keycloak.base_url** | Base URL of Keycloak server. | `""` |
111+
| **keycloak.realm** | Keycloak realm name. | `""` |
112+
113+
### Mercator database parameters
114+
115+
| Parameter | Description | Default Value |
116+
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
117+
| **secret.postgres.postgresPassword** | PostgreSQL password for the application. | `"2ù_-qeeYT21!8zA2~"` |
118+
| **postgresql.enabled** | Enable or disable PostgreSQL deployment. | `true` |
119+
| **postgresql.auth.username** | PostgreSQL username for authentication. | `"mercator_user"` |
120+
| **postgresql.auth.database** | PostgreSQL database name. | `"mercator"` |
121+
| **redis.enabled** | Enable or disable Redis deployment. | `true` |
122+
| **redis.auth.enabled** | Enable or disable Redis authentication. | `true` |
123+
| **redis.auth.password** | Password for Redis authentication.

_helm_chart/chart/templates/NOTES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@
2020
echo "Visit http://127.0.0.1:8080 to use your application"
2121
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
2222
{{- end }}
23+
{{- if .Values.seed_database }}
24+
Login with [email protected] and password: password
25+
{{- end }}

_helm_chart/chart/templates/deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{{- $defaultSecretName := printf "%s-%s" (include "chart.fullname" .) "postgresql" -}}
2+
{{- $postgresSecretName := .Values.secret.managed | ternary $defaultSecretName .Values.postgresql.auth.existingSecret -}}
13
apiVersion: apps/v1
24
kind: Deployment
35
metadata:
@@ -43,7 +45,7 @@ spec:
4345
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4446
imagePullPolicy: {{ .Values.image.pullPolicy }}
4547
ports:
46-
- name: 8080-tcp
48+
- name: http
4749
containerPort: 8080
4850
protocol: TCP
4951
livenessProbe:
@@ -78,7 +80,7 @@ spec:
7880
- name: DB_PASSWORD
7981
valueFrom:
8082
secretKeyRef:
81-
name: {{ .Values.postgresql.auth.existingSecret | quote }}
83+
name: {{ $postgresSecretName }}
8284
key: password
8385
- name: BROADCAST_DRIVER
8486
value: "log"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{{- if .Values.seed_database }}
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: {{ include "chart.fullname" . }}-seed
6+
labels:
7+
{{- include "chart.labels" . | nindent 4 }}
8+
annotations:
9+
"helm.sh/hook": post-install
10+
"helm.sh/hook-delete-policy": before-hook-creation
11+
"helm.sh/hook-weight": "-1"
12+
spec:
13+
backoffLimit: 8
14+
template:
15+
metadata:
16+
name: {{ .Chart.Name }}-seed
17+
spec:
18+
restartPolicy: Never
19+
initContainers:
20+
- name: check-mercator-ready
21+
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
22+
command: [ 'sh', '-c',
23+
'until [ "$(curl -s -o /dev/null -w ''%{http_code}'' {{ include "chart.fullname" . }}:{{ .Values.service.port }}/login)" -eq "200" ];
24+
do echo waiting for {{ include "chart.fullname" . }}:{{ .Values.service.port }}/login; sleep 10; done;' ]
25+
containers:
26+
- name: seed
27+
image: {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
28+
command: ["php", "artisan", "migrate:fresh", "--force", "--seed"]
29+
securityContext:
30+
{{- toYaml .Values.securityContext | nindent 12 }}
31+
env:
32+
- name: NAMESPACE
33+
valueFrom:
34+
fieldRef:
35+
fieldPath: metadata.namespace
36+
- name: APP_NAME
37+
value: {{ .Chart.Name | quote }}
38+
- name: REDIS_HOST
39+
value: {{ .Values.redis.fullnameOverride | quote }}
40+
- name: REDIS_PASSWORD
41+
value: "null"
42+
- name: REDIS_PORT
43+
value: "6379"
44+
- name: DB_CONNECTION
45+
value: "pgsql"
46+
- name: DB_HOST
47+
value: {{ .Values.postgresql.fullnameOverride | quote }}
48+
- name: DB_PORT
49+
value: "5432"
50+
- name: DB_DATABASE
51+
value: {{ .Values.postgresql.auth.database | quote }}
52+
- name: DB_USERNAME
53+
value: {{ .Values.postgresql.auth.username | quote }}
54+
- name: DB_PASSWORD
55+
valueFrom:
56+
secretKeyRef:
57+
name: {{ .Values.postgresql.auth.existingSecret | quote }}
58+
key: password
59+
{{- end }}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
{{- if .Values.secret.postgres.managed }}
1+
{{- if .Values.secret.managed -}}
22
apiVersion: v1
33
kind: Secret
44
metadata:
5-
name: {{ include "chart.name" . }}-postgresql
5+
name: {{ include "chart.fullname" . }}-postgresql
66
labels:
77
{{- include "chart.labels" . | nindent 4 }}
88
type: Opaque
99
data:
1010
password: {{ .Values.secret.postgres.password | b64enc | quote }}
1111
postgres-password: {{ .Values.secret.postgres.postgresPassword | b64enc | quote }}
12-
{{ end }}
12+
{{- end }}

_helm_chart/chart/templates/service.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ spec:
88
type: {{ .Values.service.type }}
99
ports:
1010
- port: {{ .Values.service.port }}
11-
targetPort: 8080
11+
targetPort: http
1212
protocol: TCP
13-
name: 8080-tcp
13+
name: http
1414
selector:
1515
{{- include "chart.selectorLabels" . | nindent 4 }}

_helm_chart/chart/values.yaml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,17 @@ service:
4545

4646
ingress:
4747
enabled: false
48-
# className: ""
49-
# annotations: {}
50-
# kubernetes.io/ingress.class: nginx
51-
# kubernetes.io/tls-acme: "true"
52-
# hosts:
53-
# - host: chart-example.local
54-
# paths:
55-
# - path: /
56-
# pathType: ImplementationSpecific
57-
# tls: []
58-
# - secretName: chart-example-tls
59-
# hosts:
60-
# - chart-example.local
48+
className: ""
49+
annotations: {}
50+
hosts:
51+
- host: chart-example.local
52+
paths:
53+
- path: /
54+
pathType: ImplementationSpecific
55+
# tls:
56+
# - secretName: chart-example-tls
57+
# hosts:
58+
# - chart-example.local
6159

6260
resources: {}
6361
# We usually recommend not to specify default resources and to leave this as a conscious
@@ -76,6 +74,7 @@ environment: "development"
7674
key: ""
7775
reverse_proxy: "http://localhost"
7876
use_demo_data: 1
77+
seed_database: 1
7978

8079
ldap:
8180
enabled: false
@@ -125,11 +124,13 @@ keycloak:
125124
livenessProbe:
126125
httpGet:
127126
path: /
128-
port: 8080-tcp
127+
port: http
128+
initialDelaySeconds: 5
129129
readinessProbe:
130130
httpGet:
131131
path: /
132-
port: 8080-tcp
132+
port: http
133+
initialDelaySeconds: 5
133134

134135
autoscaling:
135136
enabled: false
@@ -158,8 +159,8 @@ tolerations: []
158159
affinity: {}
159160

160161
secret:
162+
managed: true
161163
postgres:
162-
managed: true
163164
postgresPassword: "2ù_-qeeYT21!8zA2~"
164165
password: "1ù_-qeeRH21!8zA1~"
165166

0 commit comments

Comments
 (0)