diff --git a/templates/NOTES.txt b/templates/NOTES.txt index 6c6f8b6..f770ec4 100644 --- a/templates/NOTES.txt +++ b/templates/NOTES.txt @@ -16,29 +16,29 @@ Get the application URL by running these commands: http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} {{- end }} {{- end }} -{{- else if contains "NodePort" .Values.zenflow.service.type }} +{{- else if contains "NodePort" .Values.frontend.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "fcoscore.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.zenflow.service.type }} +{{- else if contains "LoadBalancer" .Values.frontend.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "fcoscore.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "fcoscore.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.zenflow.service.port }} + echo http://$SERVICE_IP:{{ .Values.frontend.service.port }} -{{- else if contains "ClusterIP" .Values.zenflow.service.type }} +{{- else if contains "ClusterIP" .Values.frontend.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "fcoscore.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT - echo "Visit http://127.0.0.1:{{ .Values.zenflow.service.port }} to use your application" + echo "Visit http://127.0.0.1:{{ .Values.frontend.service.port }} to use your application" {{- end }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml index d078c50..5b2bb80 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -187,3 +187,96 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Chart.Name }}-{{ .Values.frontend.name }}" + labels: + {{- include "fcoscore.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "fcoscore.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "fcoscore.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "fcoscore.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Values.frontend.name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.frontend.repository }}:{{ .Values.frontend.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.frontend.pullPolicy }} + {{- if .Values.lifecycleHooks }} + lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.containerSecurityContext.enabled }} + securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} + {{- else if .Values.command }} + command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} + {{- end }} + {{- if .Values.diagnosticMode.enabled }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} + {{- else if .Values.args }} + args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} + {{- end }} + env: + - name: PORT + value: {{ .Values.frontend.service.port | quote }} + - name: BASE_URL + value: "https://gateway0.interfacer.dyne.org" + - name: NEXT_PUBLIC_ZENFLOWS_ADMIN + valueFrom: + secretKeyRef: + name: {{ include "zenflow.secretName" . }} + key: admin-key + - name: NEXT_PUBLIC_INVITATION_KEY + valueFrom: + secretKeyRef: + name: {{ include "zenflow.secretName" . }} + key: invitation-key + ports: + - name: http + containerPort: {{ .Values.frontend.service.port }} + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/templates/secrets.yaml b/templates/secrets.yaml index f246ac9..a577f70 100644 --- a/templates/secrets.yaml +++ b/templates/secrets.yaml @@ -15,3 +15,4 @@ type: Opaque data: room-salt: {{ ternary (randAlphaNum 64 | b64enc) .Values.zenflow.room.salt (empty .Values.zenflow.room.salt) | b64enc | quote }} admin-key: {{ ternary (include "randHex" 128) .Values.auth.password (empty .Values.auth.password) | b64enc | quote }} + invitation-key: {{ ternary (randAlphaNum 32 | b64enc) .Values.auth.invitationKey (empty .Values.auth.invitationKey) | b64enc | quote }} diff --git a/templates/service.yaml b/templates/service.yaml index aef555f..c86dbc5 100644 --- a/templates/service.yaml +++ b/templates/service.yaml @@ -30,3 +30,19 @@ spec: name: http selector: {{- include "fcoscore.selectorLabels" . | nindent 4 }} +--- +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Chart.Name }}-{{ .Values.frontend.name }}" + labels: + {{- include "fcoscore.labels" . | nindent 4 }} +spec: + type: {{ .Values.frontend.service.type }} + ports: + - port: {{ .Values.frontend.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "fcoscore.selectorLabels" . | nindent 4 }} diff --git a/values.yaml b/values.yaml index 67e96ac..62ab7bf 100644 --- a/values.yaml +++ b/values.yaml @@ -54,6 +54,7 @@ auth: ## The value is evaluated as a template ## existingSecret: "" + invitationKey: "" ## @param host Hostname to create application URLs (include the port if =/= 80) ## @@ -231,6 +232,32 @@ zvmlet: type: ClusterIP port: 3000 +frontend: + name: interfacer-gui + registry: docker.io + repository: fabcityhamburg/interfacer-gui + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## e.g: + ## pullSecrets: + ## - myRegistryKeySecretName + ## + pullSecrets: [] + ## Set to true if you would like to see extra information on logs + ## + # Overrides the image tag whose default is the chart appVersion. + tag: "" + debug: false + service: + type: ClusterIP + port: 3030 + ## Persistence Parameters ## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/ ##