change layout of login

This commit is contained in:
Daniel Noulet 2026-09-20 15:41:01 +02:00
parent 6063b18052
commit 6ac4efbf9e
23 changed files with 875 additions and 7 deletions

View file

@ -0,0 +1,5 @@
.git/
.github/
.idea/
.vscode/
*.tgz

View file

@ -0,0 +1,6 @@
apiVersion: v2
name: cms
description: CMS application
type: application
version: 0.1.0
appVersion: "0.1.0"

View file

@ -0,0 +1,12 @@
CMS has been installed in namespace {{ .Release.Namespace }}.
{{- if .Values.ingress.enabled }}
Open the host configured in ingress.hosts.
{{- else if eq .Values.service.type "NodePort" }}
The application is exposed on cluster node port {{ .Values.service.nodePort }}.
Open it through the configured external reverse proxy.
{{- else }}
Run:
kubectl -n {{ .Release.Namespace }} port-forward service/{{ include "cms.fullname" . }} 8080:{{ .Values.service.port }}
Then open http://127.0.0.1:8080.
{{- end }}

View file

@ -0,0 +1,33 @@
{{- define "cms.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- define "cms.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{- define "cms.labels" -}}
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" }}
app.kubernetes.io/name: {{ include "cms.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{- define "cms.selectorLabels" -}}
app.kubernetes.io/name: {{ include "cms.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- define "cms.secretName" -}}
{{- printf "%s-secrets" (include "cms.fullname" .) }}
{{- end }}

View file

@ -0,0 +1,108 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "cms.fullname" . }}
labels:
{{- include "cms.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: {{ .Values.strategy.type }}
selector:
matchLabels:
{{- include "cms.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: application
template:
metadata:
annotations:
checksum/secrets: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "cms.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: application
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
automountServiceAccountToken: false
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: cms
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
env:
- name: CMS_PROFILE
value: {{ .Values.app.environment | quote }}
- name: CMS_ALLOWED_ORIGINS
value: {{ .Values.app.allowedOrigins | quote }}
- name: CMS_CONTENT_FILE
value: {{ ternary .Values.app.contentFile "" .Values.persistence.enabled | quote }}
- name: CMS_POSTGRES_URL
value: {{ .Values.app.postgresURL | quote }}
- name: CMS_SSO_HEADER
value: {{ .Values.app.ssoHeader | quote }}
- name: CMS_SSO_COOKIE
value: {{ .Values.app.ssoCookie | quote }}
- name: CMS_SSO_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "cms.secretName" . }}
key: sso-token
ports:
- name: http
containerPort: 8080
protocol: TCP
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 12
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: temporary-files
mountPath: /tmp
{{- if .Values.persistence.enabled }}
- name: content
mountPath: /data
{{- end }}
volumes:
- name: temporary-files
emptyDir: {}
{{- if .Values.persistence.enabled }}
- name: content
persistentVolumeClaim:
claimName: {{ include "cms.fullname" . }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View file

@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "cms.fullname" . }}
labels:
{{- include "cms.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
selector:
{{- include "cms.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: application
ports:
- name: http
port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
{{- if and (eq .Values.service.type "NodePort") .Values.service.nodePort }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}

View file

@ -0,0 +1,35 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "cms.fullname" . }}
labels:
{{- include "cms.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.ingress.className }}
ingressClassName: {{ . }}
{{- end }}
{{- with .Values.ingress.tls }}
tls:
{{- toYaml . | nindent 4 }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ include "cms.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "cms.secretName" . }}
labels:
{{- include "cms.labels" . | nindent 4 }}
type: Opaque
stringData:
sso-token: {{ .Values.secrets.ssoToken | quote }}

View file

@ -0,0 +1,20 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "cms.fullname" . }}-test-connection"
labels:
{{- include "cms.labels" . | nindent 4 }}
annotations:
helm.sh/hook: test
helm.sh/hook-delete-policy: before-hook-creation
spec:
automountServiceAccountToken: false
restartPolicy: Never
containers:
- name: wget
image: busybox:1.37
command:
- wget
args:
- -qO-
- "http://{{ include "cms.fullname" . }}:{{ .Values.service.port }}/health"

View file

@ -0,0 +1,26 @@
image:
tag: latest
pullPolicy: Always
app:
environment: demo
allowedOrigins: http://localhost:30081
contentFile: ""
service:
type: NodePort
nodePort: 30081
ingress:
enabled: false
resources:
requests:
cpu: 50m
memory: 96Mi
limits:
cpu: 300m
memory: 384Mi
persistence:
enabled: false

View file

@ -0,0 +1,27 @@
image:
tag: latest
pullPolicy: IfNotPresent
app:
environment: production
allowedOrigins: https://cms.urpi.be
contentFile: /data/content.json
service:
type: NodePort
nodePort: 31373
ingress:
enabled: false
resources:
requests:
cpu: 200m
memory: 256Mi
limits:
cpu: "1"
memory: 768Mi
persistence:
enabled: true
size: 5Gi

View file

@ -0,0 +1,76 @@
nameOverride: ""
fullnameOverride: ""
replicaCount: 1
image:
repository: batty1039.startdedicated.net:5000/cms
tag: latest
pullPolicy: IfNotPresent
imagePullSecrets: []
app:
environment: production
allowedOrigins: http://localhost:8080
contentFile: /data/content.json
postgresURL: ""
ssoHeader: X-SSO-Token
ssoCookie: ""
secrets:
ssoToken: ""
service:
type: ClusterIP
port: 80
nodePort: null
ingress:
enabled: false
className: nginx
annotations: {}
hosts:
- host: cms.local
paths:
- path: /
pathType: Prefix
tls: []
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
podAnnotations: {}
podLabels: {}
podSecurityContext:
fsGroup: 10001
fsGroupChangePolicy: OnRootMismatch
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10001
strategy:
type: Recreate
persistence:
enabled: true
size: 2Gi
accessModes:
- ReadWriteOnce
storageClass: ""
nodeSelector: {}
tolerations: []
affinity: {}