Skip to content

Commit

Permalink
version 0.2.0 for support mviewer and mviewerstudio
Browse files Browse the repository at this point in the history
  • Loading branch information
edevosc2c committed Oct 26, 2023
1 parent d17ecf5 commit ab8fa9c
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 88 deletions.
4 changes: 2 additions & 2 deletions mviewer/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: mviewer
description: A Helm chart to deploy the mviewer application
description: A Helm chart to deploy the mviewer stack
type: application
version: 0.1.0
version: 0.2.0
appVersion: "3.9"
maintainers:
- name: geOrchestra
Expand Down
3 changes: 3 additions & 0 deletions mviewer/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Mviewer

TODO: UPDATE README

mviewer est une application cartographique initiée et développée par la Région Bretagne, sous le nom de Kartenn (carte en breton).

Le code source de cette application est librement réutilisable depuis 2014.
Expand All @@ -9,6 +11,7 @@ De nombreuses collectivités mais également des entreprises, le secteur de la r
## Source Code

* https://github.com/mviewer/mviewer
* https://github.com/mviewer/mviewerstudio

## Requirements

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "helm-mviewer.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
Expand Down Expand Up @@ -33,25 +32,45 @@ spec:
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
{{- range .Values.ingress.hosts | default (list "") }}
{{- if $.Values.ingress.hosts }}
- host: {{ .host | quote }}
{{- else }}
- host: {{ $.Values.fqdn | quote }}
{{- end }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
{{- if $.Values.mviewer.enabled }}
- path: /mviewer
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
pathType: Prefix
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "helm-mviewer.fullname" $ }}-mviewer-svc
port:
number: 80
{{- else }}
serviceName: {{ include "helm-mviewer.fullname" $ }}-mviewer-svc
servicePort: 80
{{- end }}
{{- end }}
{{- if $.Values.mviewerstudio.enabled }}
- path: /mviewer
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
pathType: Prefix
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}-mviewer-svc
name: {{ include "helm-mviewer.fullname" $ }}-mviewerstudio-svc
port:
number: {{ $svcPort }}
number: 8000
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
serviceName: {{ include "helm-mviewer.fullname" $ }}-mviewerstudio-svc
servicePort: 8000
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
46 changes: 28 additions & 18 deletions mviewer/templates/mviewer-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
{{- if .Values.mviewer.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "helm-mviewer.fullname" . }}-mviewer-deployment
labels:
{{- include "helm-mviewer.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
replicas: {{ .Values.mviewer.replicaCount }}
selector:
matchLabels:
{{- include "helm-mviewer.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
{{- with .Values.mviewer.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "helm-mviewer.selectorLabels" . | nindent 8 }}
application/name: {{ include "helm-mviewer.fullname" . }}-mviewer-deployment
spec:
{{- if .Values.configuration.git.url }}
{{- if .Values.mviewer.configuration.git.url }}
initContainers:
{{- include "mviewer.bootstrap_mviewer_configuration" $ | nindent 6 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
{{- with .Values.mviewer.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- toYaml .Values.mviewer.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- toYaml .Values.mviewer.securityContext | nindent 12 }}
image: "{{ .Values.mviewer.image.repository }}:{{ .Values.mviewer.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.mviewer.image.pullPolicy }}
ports:
- name: http
containerPort: 80
Expand All @@ -47,37 +48,46 @@ spec:
httpGet:
path: /
port: http
{{- with .Values.lifecycle }}
{{- with .Values.mviewer.lifecycle }}
lifecycle:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.extra_environment }}
{{- toYaml .Values.mviewer.resources | nindent 12 }}
{{- with .Values.mviewer.extra_environment }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.mviewer.configuration.git.url }}
volumeMounts:
- name: mviewer-configuration
mountPath: /etc/mviewer
mountPath: /usr/share/nginx/html/apps
{{- else if .Values.mviewer.extraVolumesMounts }}
volumeMounts:
{{- .Values.mviewer.extraVolumesMounts | toYaml | nindent 6 }}
{{- end }}
{{- if .Values.mviewer.configuration.git.url }}
volumes:
- name: mviewer-configuration
emptyDir: {}
{{- if .Values.configuration.git.ssh_secret }}
- name: ssh-secret
secret:
secretName: {{ .Values.configuration.git.ssh_secret }}
secretName: {{ .Values.mviewer.configuration.git.ssh_secret }}
defaultMode: 0400
{{- end }}
{{- with .Values.nodeSelector }}
{{- else if .Values.mviewer.extraVolumes }}
volumes:
{{- .Values.mviewer.mviewer.extraVolumes | toYaml | nindent 6 }}
{{- end }}
{{- with .Values.mviewer.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with .Values.mviewer.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.mviewer.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
6 changes: 4 additions & 2 deletions mviewer/templates/mviewer-svc.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{{- if .Values.mviewer.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "helm-mviewer.fullname" . }}-mviewer-svc
labels:
{{- include "helm-mviewer.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
type: {{ .Values.mviewer.service.type }}
ports:
- port: {{ .Values.service.port }}
- port: {{ .Values.mviewer.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
application/name: {{ include "helm-mviewer.fullname" . }}-mviewer-deployment
{{- end }}
77 changes: 77 additions & 0 deletions mviewer/templates/mviewerstudio-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{{- if .Values.mviewerstudio.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "helm-mviewer.fullname" . }}-mviewerstudio-deployment
labels:
{{- include "helm-mviewer.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.mviewerstudio.replicaCount }}
selector:
matchLabels:
{{- include "helm-mviewer.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.mviewerstudio.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "helm-mviewer.selectorLabels" . | nindent 8 }}
application/name: {{ include "helm-mviewer.fullname" . }}-mviewerstudio-deployment
spec:
{{- with .Values.mviewerstudio.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.mviewerstudio.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.mviewerstudio.securityContext | nindent 12 }}
image: "{{ .Values.mviewerstudio.image.repository }}:{{ .Values.mviewerstudio.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.mviewerstudio.image.pullPolicy }}
ports:
- name: http
containerPort: 8000
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
{{- with .Values.mviewerstudio.lifecycle }}
lifecycle:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.mviewerstudio.resources | nindent 12 }}
{{- with .Values.mviewerstudio.extra_environment }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.mviewerstudio.extraVolumesMounts }}
volumeMounts:
{{- .Values.mviewerstudio.extraVolumesMounts | toYaml | nindent 6 }}
{{- end }}
{{- if .Values.mviewerstudio.extraVolumes }}
volumes:
{{- .Values.mviewerstudio.extraVolumes | toYaml | nindent 6 }}
{{- end }}
{{- with .Values.mviewerstudio.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.mviewerstudio.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.mviewerstudio.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
17 changes: 17 additions & 0 deletions mviewer/templates/mviewerstudio-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.mviewerstudio.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "helm-mviewer.fullname" . }}-mviewerstudio-svc
labels:
{{- include "helm-mviewer.labels" . | nindent 4 }}
spec:
type: {{ .Values.mviewerstudio.service.type }}
ports:
- port: {{ .Values.mviewerstudio.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
application/name: {{ include "helm-mviewer.fullname" . }}-mviewerstudio-deployment
{{- end }}
Loading

0 comments on commit ab8fa9c

Please sign in to comment.