Rename frontend to dashboard

This commit is contained in:
Varac 2021-11-22 15:43:51 +01:00
parent 603fabf3b7
commit 427f484839
No known key found for this signature in database
GPG key ID: 5465E77E7876ED04
7 changed files with 101 additions and 101 deletions

View file

@ -61,11 +61,11 @@ Return true if backend SMTP uses password authentication
Get the user defined LoadBalancerIP for this release
Note, returns 127.0.0.1 if using ClusterIP.
*/}}
{{- define "frontend.serviceIP" -}}
{{- if eq .Values.frontend.service.type "ClusterIP" -}}
{{- define "dashboard.serviceIP" -}}
{{- if eq .Values.dashboard.service.type "ClusterIP" -}}
127.0.0.1
{{- else -}}
{{- .Values.frontend.service.loadBalancerIP | default "" -}}
{{- .Values.dashboard.service.loadBalancerIP | default "" -}}
{{- end -}}
{{- end -}}
@ -73,9 +73,9 @@ Note, returns 127.0.0.1 if using ClusterIP.
Gets the host to be used for this application.
If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value will be empty
*/}}
{{- define "frontend.host" -}}
{{- $host := .Values.frontend.host | default "" -}}
{{- default (include "frontend.serviceIP" .) $host -}}
{{- define "dashboard.host" -}}
{{- $host := .Values.dashboard.host | default "" -}}
{{- default (include "dashboard.serviceIP" .) $host -}}
{{- end -}}
{{/*
@ -86,9 +86,9 @@ Service name for the backend service
{{- end -}}
{{/*
Service name for the frontend service
Service name for the dashboard service
*/}}
{{- define "frontend.serviceName" -}}
{{- define "dashboard.serviceName" -}}
{{ include "common.names.fullname" . }}
{{- end -}}
@ -114,10 +114,10 @@ If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value
{{- end -}}
{{/*
Return the proper frontend image name
Return the proper dashboard image name
*/}}
{{- define "frontend.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.frontend.image "global" .Values.global) }}
{{- define "dashboard.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.dashboard.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper backend image name

View file

@ -54,67 +54,67 @@ spec:
{{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: frontend
securityContext: {{- toYaml .Values.frontend.containerSecurityContext | nindent 12 }}
image: {{ template "frontend.image" . }}
- name: dashboard
securityContext: {{- toYaml .Values.dashboard.containerSecurityContext | nindent 12 }}
image: {{ template "dashboard.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.frontend.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.command "context" $) | nindent 12 }}
{{- if .Values.dashboard.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.dashboard.command "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.frontend.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.args "context" $) | nindent 12 }}
{{- if .Values.dashboard.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.dashboard.args "context" $) | nindent 12 }}
{{- end }}
env:
{{- if .Values.frontend.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.frontend.extraEnvVars "context" $) | nindent 12 }}
{{- if .Values.dashboard.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.dashboard.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
- configMapRef:
name: {{ include "common.names.fullname" . }}
{{- if .Values.frontend.extraEnvVarsCM }}
{{- if .Values.dashboard.extraEnvVarsCM }}
- configMapRef:
name: {{ .Values.frontend.extraEnvVarsCM }}
name: {{ .Values.dashboard.extraEnvVarsCM }}
{{- end }}
{{- if .Values.frontend.extraEnvVarsSecret }}
{{- if .Values.dashboard.extraEnvVarsSecret }}
- secretRef:
name: {{ .Values.frontend.extraEnvVarsSecret }}
name: {{ .Values.dashboard.extraEnvVarsSecret }}
{{- end }}
ports:
- name: frontend-http
- name: dashboard-http
containerPort: 80
protocol: TCP
{{- if .Values.frontend.livenessProbe.enabled }}
{{- if .Values.dashboard.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /
port: frontend-http
initialDelaySeconds: {{ .Values.frontend.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.frontend.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.frontend.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.frontend.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.frontend.livenessProbe.failureThreshold }}
{{- else if .Values.frontend.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.customLivenessProbe "context" $) | nindent 12 }}
port: dashboard-http
initialDelaySeconds: {{ .Values.dashboard.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.dashboard.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.dashboard.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.dashboard.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.dashboard.livenessProbe.failureThreshold }}
{{- else if .Values.dashboard.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.dashboard.customLivenessProbe "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.frontend.readinessProbe.enabled }}
{{- if .Values.dashboard.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /
port: frontend-http
initialDelaySeconds: {{ .Values.frontend.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.frontend.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.frontend.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.frontend.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.frontend.readinessProbe.failureThreshold }}
{{- else if .Values.frontend.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.customReadinessProbe "context" $) | nindent 12 }}
port: dashboard-http
initialDelaySeconds: {{ .Values.dashboard.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.dashboard.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.dashboard.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.dashboard.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.dashboard.readinessProbe.failureThreshold }}
{{- else if .Values.dashboard.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.dashboard.customReadinessProbe "context" $) | nindent 12 }}
{{- end }}
volumeMounts:
{{- if .Values.frontend.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.frontend.extraVolumeMounts "context" $) | nindent 12 }}
{{- if .Values.dashboard.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.dashboard.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.frontend.resources }}
resources: {{- toYaml .Values.frontend.resources | nindent 12 }}
{{- if .Values.dashboard.resources }}
resources: {{- toYaml .Values.dashboard.resources | nindent 12 }}
{{- end }}
- name: backend
securityContext: {{- toYaml .Values.backend.containerSecurityContext | nindent 12 }}

View file

@ -1,42 +1,42 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "frontend.serviceName" . }}
name: {{ include "dashboard.serviceName" . }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or .Values.frontend.service.annotations .Values.commonAnnotations}}
{{- if or .Values.dashboard.service.annotations .Values.commonAnnotations}}
annotations:
{{- if .Values.frontend.service.annotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.frontend.service.annotations "context" $) | nindent 4 }}
{{- if .Values.dashboard.service.annotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.dashboard.service.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
{{- end }}
spec:
type: {{ .Values.frontend.service.type }}
{{- if (or (eq .Values.frontend.service.type "LoadBalancer") (eq .Values.frontend.service.type "NodePort")) }}
externalTrafficPolicy: {{ .Values.frontend.service.externalTrafficPolicy | quote }}
type: {{ .Values.dashboard.service.type }}
{{- if (or (eq .Values.dashboard.service.type "LoadBalancer") (eq .Values.dashboard.service.type "NodePort")) }}
externalTrafficPolicy: {{ .Values.dashboard.service.externalTrafficPolicy | quote }}
{{- end }}
{{- if (and (eq .Values.frontend.service.type "LoadBalancer") (not (empty .Values.frontend.service.loadBalancerIP))) }}
loadBalancerIP: {{ .Values.frontend.service.loadBalancerIP }}
{{- if (and (eq .Values.dashboard.service.type "LoadBalancer") (not (empty .Values.dashboard.service.loadBalancerIP))) }}
loadBalancerIP: {{ .Values.dashboard.service.loadBalancerIP }}
{{- end }}
{{- if (and (eq .Values.frontend.service.type "LoadBalancer") .Values.frontend.service.loadBalancerSourceRanges) }}
{{- if (and (eq .Values.dashboard.service.type "LoadBalancer") .Values.dashboard.service.loadBalancerSourceRanges) }}
loadBalancerSourceRanges:
{{ toYaml .Values.frontend.service.loadBalancerSourceRanges | nindent 4 }}
{{ toYaml .Values.dashboard.service.loadBalancerSourceRanges | nindent 4 }}
{{- end }}
ports:
- name: http
port: {{ .Values.frontend.service.port }}
targetPort: frontend-http
{{- if (and (or (eq .Values.frontend.service.type "NodePort") (eq .Values.frontend.service.type "LoadBalancer")) (not (empty .Values.frontend.service.nodePorts.http))) }}
nodePort: {{ .Values.frontend.service.nodePorts.http }}
{{- else if eq .Values.frontend.service.type "ClusterIP" }}
port: {{ .Values.dashboard.service.port }}
targetPort: dashboard-http
{{- if (and (or (eq .Values.dashboard.service.type "NodePort") (eq .Values.dashboard.service.type "LoadBalancer")) (not (empty .Values.dashboard.service.nodePorts.http))) }}
nodePort: {{ .Values.dashboard.service.nodePorts.http }}
{{- else if eq .Values.dashboard.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- if .Values.frontend.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.frontend.service.extraPorts "context" $) | nindent 4 }}
{{- if .Values.dashboard.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.dashboard.service.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}

View file

@ -40,7 +40,7 @@ spec:
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
pathType: {{ .Values.ingress.pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "frontend.serviceName" .) "servicePort" "frontend-http" "context" $) | nindent 14 }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "dashboard.serviceName" .) "servicePort" "dashboard-http" "context" $) | nindent 14 }}
# Forward API calls to the back-end container
- path: {{ .Values.ingress.path }}api/v1
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
@ -56,7 +56,7 @@ spec:
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ default "ImplementationSpecific" .pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "frontend.serviceName" $) "servicePort" "frontend-http" "context" $) | nindent 14 }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "dashboard.serviceName" $) "servicePort" "dashboard-http" "context" $) | nindent 14 }}
- path: {{ default "/" .path }}api/v1
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ default "ImplementationSpecific" .pathType }}

View file

@ -1,5 +1,5 @@
# Disabled by default because the current dashboard does not need persistence
{{- if and (include "frontend.host" .) .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
{{- if and (include "dashboard.host" .) .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:

View file

@ -1,6 +1,6 @@
# Values you will likely want to override. See values.yaml for their meanings
frontend:
dashboard:
host: dashboard.oas.example.com
backend:

View file

@ -43,12 +43,12 @@ commonAnnotations: {}
image:
imagePullSecrets: []
## Admin frontend configuration parameters
## Admin dashboard configuration parameters
## ref: https://open.greenhost.net/stackspin/dashboard
##
frontend:
## Admin frontend image version
## ref: https://hub.docker.com/r/bitnami/frontend/tags/
dashboard:
## Admin dashboard image version
## ref: https://hub.docker.com/r/bitnami/dashboard/tags/
## @param image.registry Stackspin image registry
## @param image.repository Stackspin image repository
## @param image.tag Stackspin image tag
@ -111,18 +111,18 @@ frontend:
##
nodePorts:
http: ""
## @param frontend.extendEslint Whether to read .eslint.json rules
## @param dashboard.extendEslint Whether to read .eslint.json rules
extendEslint: false
## @param frontend.host Stackspin host to create application URLs (include the port if =/= 80)
## @param dashboard.host Stackspin host to create application URLs (include the port if =/= 80)
##
host: ""
## @param frontend.command Custom command to override image cmd
## @param dashboard.command Custom command to override image cmd
##
command: []
## @param frontend.args Custom args for the custom command
## @param dashboard.args Custom args for the custom command
##
args: []
## @param frontend.containerSecurityContext Container security context specification
## @param dashboard.containerSecurityContext Container security context specification
## Example:
## capabilities:
## drop:
@ -138,8 +138,8 @@ frontend:
## choice for the user. This also increases chances charts run on environments with little
## resources, such as Minikube. If you do want to specify resources, uncomment the following
## lines, adjust them as necessary, and remove the curly braces after 'resources:'.
## @param frontend.resources.limits The resources limits for the container
## @param frontend.resources.requests The requested resources for the container
## @param dashboard.resources.limits The resources limits for the container
## @param dashboard.resources.requests The requested resources for the container
##
resources:
## Example:
@ -156,12 +156,12 @@ frontend:
## WARNING: Stackspin installation process may take up some time and
## setting inappropriate values here may lead to pods failure.
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
## @param frontend.livenessProbe.enabled Enable/disable livenessProbe
## @param frontend.livenessProbe.initialDelaySeconds Delay before liveness probe is initiated
## @param frontend.livenessProbe.periodSeconds How often to perform the probe
## @param frontend.livenessProbe.timeoutSeconds When the probe times out
## @param frontend.livenessProbe.failureThreshold Minimum consecutive failures for the probe
## @param frontend.livenessProbe.successThreshold Minimum consecutive successes for the probe
## @param dashboard.livenessProbe.enabled Enable/disable livenessProbe
## @param dashboard.livenessProbe.initialDelaySeconds Delay before liveness probe is initiated
## @param dashboard.livenessProbe.periodSeconds How often to perform the probe
## @param dashboard.livenessProbe.timeoutSeconds When the probe times out
## @param dashboard.livenessProbe.failureThreshold Minimum consecutive failures for the probe
## @param dashboard.livenessProbe.successThreshold Minimum consecutive successes for the probe
##
livenessProbe:
enabled: true
@ -174,12 +174,12 @@ frontend:
## WARNING: Stackspin installation process may take up some time and
## setting inappropriate values here may lead to pods failure.
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
## @param frontend.readinessProbe.enabled Enable/disable readinessProbe
## @param frontend.readinessProbe.initialDelaySeconds Delay before readiness probe is initiated
## @param frontend.readinessProbe.periodSeconds How often to perform the probe
## @param frontend.readinessProbe.timeoutSeconds When the probe times out
## @param frontend.readinessProbe.failureThreshold Minimum consecutive failures for the probe
## @param frontend.readinessProbe.successThreshold Minimum consecutive successes for the probe
## @param dashboard.readinessProbe.enabled Enable/disable readinessProbe
## @param dashboard.readinessProbe.initialDelaySeconds Delay before readiness probe is initiated
## @param dashboard.readinessProbe.periodSeconds How often to perform the probe
## @param dashboard.readinessProbe.timeoutSeconds When the probe times out
## @param dashboard.readinessProbe.failureThreshold Minimum consecutive failures for the probe
## @param dashboard.readinessProbe.successThreshold Minimum consecutive successes for the probe
##
readinessProbe:
enabled: true
@ -188,27 +188,27 @@ frontend:
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1
## @param frontend.customLivenessProbe Custom liveness probe to execute (when the main one is disabled)
## @param dashboard.customLivenessProbe Custom liveness probe to execute (when the main one is disabled)
##
customLivenessProbe: {}
## @param frontend.customReadinessProbe Custom readiness probe to execute (when the main one is disabled)
## @param dashboard.customReadinessProbe Custom readiness probe to execute (when the main one is disabled)
##
customReadinessProbe: {}
## @param frontend.extraEnvVars An array to add extra env vars
## @param dashboard.extraEnvVars An array to add extra env vars
## For example:
## extraEnvVars:
## frontend:
## dashboard:
## - name: ADMIN_PANEL_ELASTICSEARCH_URL
## value: test
##
extraEnvVars: []
## @param frontend.extraEnvVarsCM Array to add extra configmaps
## @param dashboard.extraEnvVarsCM Array to add extra configmaps
##
extraEnvVarsCM: []
## @param frontend.extraEnvVarsSecret Array to add extra environment variables from a secret
## @param dashboard.extraEnvVarsSecret Array to add extra environment variables from a secret
##
extraEnvVarsSecret: ""
## @param frontend.extraVolumeMounts Additional volume mounts (used along with `extraVolumes`)
## @param dashboard.extraVolumeMounts Additional volume mounts (used along with `extraVolumes`)
## Example: Mount CA file
## extraVolumeMounts
## - name: ca-cert
@ -220,8 +220,8 @@ frontend:
## ref: https://open.greenhost.net/stackspin/dashboard-backend
##
backend:
## Admin frontend image version
## ref: https://hub.docker.com/r/bitnami/frontend/tags/
## Admin dashboard image version
## ref: https://hub.docker.com/r/bitnami/dashboard/tags/
## @param image.registry Stackspin image registry
## @param image.repository Stackspin image repository
## @param image.tag Stackspin image tag