From eb7bc4ad62721538fe90927069df44c09d375f7e Mon Sep 17 00:00:00 2001 From: Wilco Louwerse Date: Thu, 27 Jul 2023 16:32:29 +0200 Subject: [PATCH 1/3] Started adding some helm files, w.i.p. --- helm/.helmignore | 25 +++++ helm/artifacthub-repo.yaml | 20 ++++ helm/huwelijksplanner/Chart.yaml | 25 +++++ helm/huwelijksplanner/templates/NOTES.txt | 22 ++++ helm/huwelijksplanner/templates/_helpers.tpl | 88 +++++++++++++++ .../huwelijksplanner/templates/configmap.yaml | 7 ++ .../templates/deployment.yaml | 83 ++++++++++++++ helm/huwelijksplanner/templates/ingress.yaml | 98 +++++++++++++++++ helm/huwelijksplanner/templates/secrets.yaml | 7 ++ .../templates/serviceaccount.yaml | 12 ++ helm/huwelijksplanner/values.yaml | 104 ++++++++++++++++++ 11 files changed, 491 insertions(+) create mode 100644 helm/.helmignore create mode 100644 helm/artifacthub-repo.yaml create mode 100644 helm/huwelijksplanner/Chart.yaml create mode 100644 helm/huwelijksplanner/templates/NOTES.txt create mode 100644 helm/huwelijksplanner/templates/_helpers.tpl create mode 100644 helm/huwelijksplanner/templates/configmap.yaml create mode 100644 helm/huwelijksplanner/templates/deployment.yaml create mode 100644 helm/huwelijksplanner/templates/ingress.yaml create mode 100644 helm/huwelijksplanner/templates/secrets.yaml create mode 100644 helm/huwelijksplanner/templates/serviceaccount.yaml create mode 100644 helm/huwelijksplanner/values.yaml diff --git a/helm/.helmignore b/helm/.helmignore new file mode 100644 index 0000000..534230f --- /dev/null +++ b/helm/.helmignore @@ -0,0 +1,25 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ + +/*.tgz diff --git a/helm/artifacthub-repo.yaml b/helm/artifacthub-repo.yaml new file mode 100644 index 0000000..8d22c77 --- /dev/null +++ b/helm/artifacthub-repo.yaml @@ -0,0 +1,20 @@ +# Artifact Hub repository metadata file +# +# Some settings like the verified publisher flag or the ignored packages won't +# be applied until the next time the repository is processed. Please keep in +# mind that the repository won't be processed if it has not changed since the +# last time it was processed. Depending on the repository kind, this is checked +# in a different way. For Helm http based repositories, we consider it has +# changed if the `index.yaml` file changes. For git based repositories, it does +# when the hash of the last commit in the branch you set up changes. This does +# NOT apply to ownership claim operations, which are processed immediately. +# +repositoryID: +owners: # (optional, used to claim repository ownership) + - name: Ruben van der linde + email: ruben@conduction.nl + - name: Conduction + email: info@conduction.nl +ignore: # (optional, packages that should not be indexed by Artifact Hub) + - name: postgresql + - name: redis diff --git a/helm/huwelijksplanner/Chart.yaml b/helm/huwelijksplanner/Chart.yaml new file mode 100644 index 0000000..c34c854 --- /dev/null +++ b/helm/huwelijksplanner/Chart.yaml @@ -0,0 +1,25 @@ +apiVersion: v2 +name: huwelijksplanner +description: A Helm chart for the Skeleton Gatsby Application + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.0.1 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +appVersion: 1.0.0 + +dependencies: [] \ No newline at end of file diff --git a/helm/huwelijksplanner/templates/NOTES.txt b/helm/huwelijksplanner/templates/NOTES.txt new file mode 100644 index 0000000..4b308b7 --- /dev/null +++ b/helm/huwelijksplanner/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "api-platform.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.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 "api-platform.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "api-platform.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "api-platform.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}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/helm/huwelijksplanner/templates/_helpers.tpl b/helm/huwelijksplanner/templates/_helpers.tpl new file mode 100644 index 0000000..cbc9093 --- /dev/null +++ b/helm/huwelijksplanner/templates/_helpers.tpl @@ -0,0 +1,88 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "api-platform.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "api-platform.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 }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "api-platform.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "api-platform.labels" -}} +helm.sh/chart: {{ include "api-platform.chart" . }} +{{ include "api-platform.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Common labels PWA +*/}} +{{- define "api-platform.labelsPWA" -}} +helm.sh/chart: {{ include "api-platform.chart" . }} +{{ include "api-platform.selectorLabelsPWA" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "api-platform.selectorLabels" -}} +app.kubernetes.io/name: {{ include "api-platform.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/part-of: {{ include "api-platform.name" . }} +{{- end }} + +{{/* +Selector labels PWA +*/}} +{{- define "api-platform.selectorLabelsPWA" -}} +app.kubernetes.io/name: {{ include "api-platform.name" . }}-pwa +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/part-of: {{ include "api-platform.name" . }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "api-platform.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "api-platform.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{- define "commonground-gateway.fullname" -}} +{{- printf "%s-%s" .Release.Name "commonground-gateway" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/helm/huwelijksplanner/templates/configmap.yaml b/helm/huwelijksplanner/templates/configmap.yaml new file mode 100644 index 0000000..1a7a0ef --- /dev/null +++ b/helm/huwelijksplanner/templates/configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "api-platform.fullname" . }} + labels: + {{- include "api-platform.labels" . | nindent 4 }} +data: [] \ No newline at end of file diff --git a/helm/huwelijksplanner/templates/deployment.yaml b/helm/huwelijksplanner/templates/deployment.yaml new file mode 100644 index 0000000..1ca740c --- /dev/null +++ b/helm/huwelijksplanner/templates/deployment.yaml @@ -0,0 +1,83 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "api-platform.fullname" . }} + labels: + {{- include "api-platform.labelsPWA" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "api-platform.selectorLabelsPWA" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "api-platform.selectorLabelsPWA" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.serviceAccount.create }} + serviceAccountName: {{ include "api-platform.serviceAccountName" . }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + volumes: + - name: tmpfs + emptyDir: {} + - name: tmpfs2 + emptyDir: {} + - name: env + configMap: + name: {{ include "api-platform.fullname" . }} + items: + - key: "properties" + path: "env.js" + + containers: + - name: {{ .Chart.Name }}-pwa + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.pwa.image.image }}:{{ .Values.pwa.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.pwa.image.pullPolicy }} + volumeMounts: + - name: env + mountPath: "/usr/share/nginx/html/env.js" + subPath: "env.js" + - mountPath: /var/cache/nginx/client_temp + name: tmpfs + - mountPath: /var/run + name: tmpfs2 + ports: + - name: http + containerPort: 3000 + 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/helm/huwelijksplanner/templates/ingress.yaml b/helm/huwelijksplanner/templates/ingress.yaml new file mode 100644 index 0000000..53bb29c --- /dev/null +++ b/helm/huwelijksplanner/templates/ingress.yaml @@ -0,0 +1,98 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "api-platform.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- $gateway := include "commonground-gateway.fullname" . -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "api-platform.labels" . | nindent 4 }} + annotations: + {{- with .Values.ingress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- if .Values.global.tls }} + cert-manager.io/cluster-issuer: letsencrypt-prod + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + {{- if .Values.global.tls }} + tls: + - hosts: + - {{ .Values.global.domain }} + secretName: {{ $fullName }}-frontend-tls + {{- end }} + rules: + - host: {{ .Values.global.domain }} + http: + paths: + - path: {{ .Values.ingress.path }}/ + {{- if and .Values.ingress.pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .Values.ingress.pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} diff --git a/helm/huwelijksplanner/templates/secrets.yaml b/helm/huwelijksplanner/templates/secrets.yaml new file mode 100644 index 0000000..577923f --- /dev/null +++ b/helm/huwelijksplanner/templates/secrets.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "api-platform.fullname" . }} + labels: + {{- include "api-platform.labels" . | nindent 4 }} +type: Opaque diff --git a/helm/huwelijksplanner/templates/serviceaccount.yaml b/helm/huwelijksplanner/templates/serviceaccount.yaml new file mode 100644 index 0000000..a0d5bff --- /dev/null +++ b/helm/huwelijksplanner/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "api-platform.serviceAccountName" . }} + labels: + {{- include "api-platform.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/helm/huwelijksplanner/values.yaml b/helm/huwelijksplanner/values.yaml new file mode 100644 index 0000000..9b81f0b --- /dev/null +++ b/helm/huwelijksplanner/values.yaml @@ -0,0 +1,104 @@ +# Default values for api-platform. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +pwa: + image: + image: "ghcr.io/frameless/utrecht-huwelijksplanner" + pullPolicy: Always + tag: "0737a7b" + # Overrides the image tag whose default is the chart appVersion. + apiUrl: "useDomain" + meUrl: "useDomain" + baseUrl: "useDomain" + frontendUrl: "useDomain" + organization: "" + redirectUrl: "vault" + adminUrl: "useDomain" + dashboardUrl: "useDomain" + +replicacount: 2 + +global: + domain: huwelijksplanner.nl + # The main domain the application should be run on. The api's will be available at api., the admin ui on admin. + tls: true + # Whether the helm file should take care of creating TLS certificates and adding them to the ingress resource. + +gateway: + enabled: true + # config: + # trustedProxies: [] + # If the application needs to run HTTPS only without any HTTP to HTTPS redirects, add in the internal IP of the + # load balancer in the field above. The application otherwise might redirect to HTTP addresses that should be HTTPS. + # This due to internal traffic in Kubernetes typically being without TLS. Adding the load balancer to the trusted proxies + # will tell the application that the traffic was sent in HTTPS. + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} +# fsGroup: 2000 + +securityContext: + {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true +# runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: true + path: "" + pathType: ImplementationSpecific + className: nginx + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # 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:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} From 9eaec6f836cfd47171ecc005dcd1b4ca9ed914a5 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Mon, 31 Jul 2023 14:03:26 +0200 Subject: [PATCH 2/3] Helm file and container for Leiden --- .env | 2 +- Dockerfile | 3 +++ docker-compose.yml | 2 ++ .../huwelijksplanner/templates/configmap.yaml | 7 ------- .../templates/deployment.yaml | 19 ------------------- helm/huwelijksplanner/templates/secrets.yaml | 7 ------- helm/huwelijksplanner/templates/service.yaml | 14 ++++++++++++++ 7 files changed, 20 insertions(+), 34 deletions(-) delete mode 100644 helm/huwelijksplanner/templates/configmap.yaml delete mode 100644 helm/huwelijksplanner/templates/secrets.yaml create mode 100644 helm/huwelijksplanner/templates/service.yaml diff --git a/.env b/.env index db3a627..60c619f 100644 --- a/.env +++ b/.env @@ -6,6 +6,6 @@ NPM_REGISTRY= NPM_TOKEN= VCS_REF= VERSION= -NEXT_PUBLIC_API_URL=https://api.huwelijksplanner.online/api +NEXT_PUBLIC_API_URL=https://api.leiden-hp.commonground.nu/api NEXT_PUBLIC_MATOMO_URL=https://stats.utrecht.nl/analytics/ NEXT_PUBLIC_MATOMO_SITE_ID=5 diff --git a/Dockerfile b/Dockerfile index 6a637f9..5004c30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,9 @@ ARG NODE_ENV ARG NPM_REGISTRY ARG NPM_STRICT_SSL ARG NPM_TOKEN +ARG NEXT_PUBLIC_API_URL + +RUN echo $NEXT_PUBLIC_API_URL RUN if test "$NODE_ENV" = 'development'; \ then \ diff --git a/docker-compose.yml b/docker-compose.yml index 4608587..85482aa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,8 +13,10 @@ services: - "NPM_TOKEN=${NPM_TOKEN}" - "VCS_REF=${VCS_REF}" - "VERSION=${VERSION}" + - "NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}" context: . dockerfile: ./Dockerfile ports: - "3000:3000" command: "start" + image: ghcr.io/conductionnl/huwelijksplanner-utrecht:leiden diff --git a/helm/huwelijksplanner/templates/configmap.yaml b/helm/huwelijksplanner/templates/configmap.yaml deleted file mode 100644 index 1a7a0ef..0000000 --- a/helm/huwelijksplanner/templates/configmap.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "api-platform.fullname" . }} - labels: - {{- include "api-platform.labels" . | nindent 4 }} -data: [] \ No newline at end of file diff --git a/helm/huwelijksplanner/templates/deployment.yaml b/helm/huwelijksplanner/templates/deployment.yaml index 1ca740c..3c52fbc 100644 --- a/helm/huwelijksplanner/templates/deployment.yaml +++ b/helm/huwelijksplanner/templates/deployment.yaml @@ -29,17 +29,6 @@ spec: {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} - volumes: - - name: tmpfs - emptyDir: {} - - name: tmpfs2 - emptyDir: {} - - name: env - configMap: - name: {{ include "api-platform.fullname" . }} - items: - - key: "properties" - path: "env.js" containers: - name: {{ .Chart.Name }}-pwa @@ -47,14 +36,6 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.pwa.image.image }}:{{ .Values.pwa.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.pwa.image.pullPolicy }} - volumeMounts: - - name: env - mountPath: "/usr/share/nginx/html/env.js" - subPath: "env.js" - - mountPath: /var/cache/nginx/client_temp - name: tmpfs - - mountPath: /var/run - name: tmpfs2 ports: - name: http containerPort: 3000 diff --git a/helm/huwelijksplanner/templates/secrets.yaml b/helm/huwelijksplanner/templates/secrets.yaml deleted file mode 100644 index 577923f..0000000 --- a/helm/huwelijksplanner/templates/secrets.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "api-platform.fullname" . }} - labels: - {{- include "api-platform.labels" . | nindent 4 }} -type: Opaque diff --git a/helm/huwelijksplanner/templates/service.yaml b/helm/huwelijksplanner/templates/service.yaml new file mode 100644 index 0000000..04ba526 --- /dev/null +++ b/helm/huwelijksplanner/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "api-platform.fullname" . }} + labels: + {{- include "api-platform.labelsPWA" . | nindent 4 }} +spec: + ports: + - port: 80 + targetPort: 3000 + protocol: TCP + name: http + selector: + {{- include "api-platform.selectorLabelsPWA" . | nindent 4 }} From 40a2e54e4323b20e17e3bc5c0523f27e5018c350 Mon Sep 17 00:00:00 2001 From: Sarai Misidjan Date: Mon, 31 Jul 2023 14:51:33 +0200 Subject: [PATCH 3/3] small fix dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5004c30..86c3fd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ ADD ./ /var/www/ RUN if test "$NODE_ENV" != 'development'; \ then \ npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}" \ - && NODE_ENV=development npm ci --no-update-notifier \ + && NODE_ENV=development && npm ci --no-update-notifier \ && npm run build \ && npm prune \ && npm config set "//registry.npmjs.org/:_authToken" "" \