diff --git a/helm/index.yaml b/helm/index.yaml new file mode 100644 index 00000000..7298823a --- /dev/null +++ b/helm/index.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +entries: + woo-website: + - apiVersion: v2 + appVersion: 1.0.0 + created: "2023-11-14T14:22:03.775981517+01:00" + description: A Helm chart for the Skeleton Gatsby Application + digest: 49a13c2e43c2bc6dda02a40f032f70d68bb4b877b9979566ad3511071f086458 + name: woo-website + type: application + urls: + - woo-website-1.0.6.tgz + version: 1.0.6 +generated: "2023-11-14T14:22:03.772476395+01:00" diff --git a/helm/woo-website-1.0.6.tgz b/helm/woo-website-1.0.6.tgz new file mode 100644 index 00000000..b38498cf Binary files /dev/null and b/helm/woo-website-1.0.6.tgz differ diff --git a/helm/woo-website/.helmignore b/helm/woo-website/.helmignore new file mode 100644 index 00000000..534230fb --- /dev/null +++ b/helm/woo-website/.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/woo-website/Chart.yaml b/helm/woo-website/Chart.yaml new file mode 100644 index 00000000..4d77b026 --- /dev/null +++ b/helm/woo-website/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: woo-website +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: 1.0.6 + +# 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 diff --git a/helm/woo-website/README.md b/helm/woo-website/README.md new file mode 100644 index 00000000..06bd50eb --- /dev/null +++ b/helm/woo-website/README.md @@ -0,0 +1,29 @@ +# Deploying to a Kubernetes Cluster + +In order to install the application in your own cloud environment we support installation in [Kubernetes](https://kubernetes.io) using the supplied [helm](https://helm.sh) chart. Kubernetes is a Container Orchestration Engine that has been standardised for Dutch municipalities under the [Haven](https://haven.commonground.nl) standard, and for which Helm is the default installation method of components. + +This helm chart can be installed with the help of Kubernetes Management Tools like [Rancher](https://rancher.com). + +This helm chart can be installed by running Helm from your local machine (see instructions on how to install Helm on [helm.sh](https://helm.sh/docs/intro/install/#through-package-managers), which requires to have [kubectl](https://kubernetes.io/docs/tasks/tools/) installed). + +If you have Helm and Kubectl installed and you have configured access to your cluster (usually via a kubeconfig file) you can run the following commands to install the application. + +```cli +$ helm repo add woo-website +$ helm install woowebsite woo-website/woo-website +``` + +The application can be adapted using the following helm values + +| Value | Description | Default | +|-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|-------------------| +| `global.domain` | Sets the domain for the application and its dependencies. | `opencatalogi.nl` | +| `global.tls` | If the application should request TLS certificates for itself on the domains in `global.domain`, uses a cluster issuer named `letsencrypt-prod`. | `true` | + + +For more information about the helm file for the common gateway see the [installation manual of the common gateway](https://github.com/CommonGateway/CoreBundle/blob/master/docs/features/Installation.md#haven--kubernetes). +Keep in mind that if the common gateway is installed via the subchart of this chart, all values in the manual mentioned should be prefixed by `gateway.`. + +## Changelog + +- 0.0.1: First version based upon opencatalogi helm file \ No newline at end of file diff --git a/helm/woo-website/artifacthub-repo.yaml b/helm/woo-website/artifacthub-repo.yaml new file mode 100644 index 00000000..8d22c776 --- /dev/null +++ b/helm/woo-website/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/woo-website/index.yaml b/helm/woo-website/index.yaml new file mode 100644 index 00000000..482c555b --- /dev/null +++ b/helm/woo-website/index.yaml @@ -0,0 +1,293 @@ +apiVersion: v1 +entries: + commonground-gateway: + - apiVersion: v2 + appVersion: "2.2" + created: "2023-08-18T11:15:18.184369292+02:00" + dependencies: + - condition: postgresql.enabled + name: postgresql + repository: https://charts.bitnami.com/bitnami + version: 12.1.2 + - condition: redis.enabled + name: redis + repository: https://charts.bitnami.com/bitnami + version: 17.3.11 + - name: rabbitmq + repository: https://charts.bitnami.com/bitnami + version: 11.9.1 + - condition: mongodb.enabled + name: mongodb + repository: https://charts.bitnami.com/bitnami + version: 13.4.4 + - condition: gateway-ui.enabled + name: gateway-ui + repository: https://raw.githubusercontent.com/ConductionNL/gateway-ui/development/helm/ + version: 0.1.7 + description: A Helm chart for Kubernetes + digest: f3367f85691a72ee2022df449e7d817e965a9597180964df8e748f507d7c4e56 + name: commonground-gateway + type: application + urls: + - charts/commonground-gateway-1.5.3.tgz + version: 1.5.3 + opencatalogi: + - apiVersion: v2 + appVersion: 1.0.0 + created: "2023-08-18T11:15:18.147552834+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/development/api/helm/ + version: 1.5.3 + description: A Helm chart for the Skeleton Gatsby Application + digest: 412d23b997426b4854b1dbea5cba3cb1efec21ef973b806df3b004f9a7ec7412 + name: opencatalogi + type: application + urls: + - opencatalogi-1.0.6.tgz + version: 1.0.6 + - apiVersion: v2 + appVersion: 1.0.0 + created: "2023-08-18T11:15:18.115539464+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/development/api/helm/ + version: 1.5.2 + description: A Helm chart for the Skeleton Gatsby Application + digest: b8851cd11621d8965ef0bc660df4ec102cf69014ae280c03fdcf5a2dbece2b15 + name: opencatalogi + type: application + urls: + - opencatalogi-1.0.5.tgz + version: 1.0.5 + - apiVersion: v2 + appVersion: 1.0.0 + created: "2023-08-18T11:15:18.075652994+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/development/api/helm/ + version: 1.5.1 + description: A Helm chart for the Skeleton Gatsby Application + digest: 6b748ba1a02296a6affce75c87d9072bd9e287c37b72a251c6f90fcc307b8115 + name: opencatalogi + type: application + urls: + - opencatalogi-1.0.4.tgz + version: 1.0.4 + - apiVersion: v2 + appVersion: 1.0.0 + created: "2023-08-18T11:15:18.032906954+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/development/api/helm/ + version: 1.5.0 + description: A Helm chart for the Skeleton Gatsby Application + digest: 3ef6405441cebeae2c92ca898a1cb57c01cbecda42072f4ea0fbd200f0fcffa8 + name: opencatalogi + type: application + urls: + - opencatalogi-1.0.3.tgz + version: 1.0.3 + - apiVersion: v2 + appVersion: 1.0.0 + created: "2023-08-18T11:15:17.992008117+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/feature-cleanup/api/helm/ + version: 1.4.4 + description: A Helm chart for the Skeleton Gatsby Application + digest: ad7ced8f7a1cdef9b9071ffb29770c991d99d25b8ba35f0818a911e93b3ed9c3 + name: opencatalogi + type: application + urls: + - opencatalogi-1.0.2.tgz + version: 1.0.2 + - apiVersion: v2 + appVersion: 1.0.0 + created: "2023-08-18T11:15:17.953153691+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/feature-cleanup/api/helm/ + version: 1.4.4 + description: A Helm chart for the Skeleton Gatsby Application + digest: ccefec45f231821d4fc1ee971d64ee5dc5bc14fc38403d6ff2ea98bbc42bb9a2 + name: opencatalogi + type: application + urls: + - opencatalogi-1.0.1.tgz + version: 1.0.1 + - apiVersion: v2 + appVersion: 1.0.0 + created: "2023-08-18T11:15:17.912086361+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/feature-cleanup/api/helm/ + version: 1.4.4 + description: A Helm chart for the Skeleton Gatsby Application + digest: 1a599f26bfbd73c38498195a68313d368eca8d37cac7e73ad763a7ce521d3758 + name: opencatalogi + type: application + urls: + - opencatalogi-1.0.0.tgz + version: 1.0.0 + - apiVersion: v2 + appVersion: 0.9.0 + created: "2023-08-18T11:15:17.864980341+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/feature-cleanup/api/helm/ + version: 1.2.8 + - alias: gatewayui + condition: gatewayui.enabled + name: skeleton-app + repository: https://raw.githubusercontent.com/ConductionNL/gateway-ui/refinement-demo-branch/helm + version: 0.1.4 + description: A Helm chart for the Skeleton Gatsby Application + digest: a19e0fb9156f3c6fc1584153a200389cdaeb11a4a37930b7b51aad6cdede89b0 + name: opencatalogi + type: application + urls: + - opencatalogi-0.9.7.tgz + version: 0.9.7 + - apiVersion: v2 + appVersion: 0.9.0 + created: "2023-08-18T11:15:17.789998741+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/feature-cleanup/api/helm/ + version: 1.2.8 + - alias: gatewayui + condition: gatewayui.enabled + name: skeleton-app + repository: https://raw.githubusercontent.com/ConductionNL/gateway-ui/refinement-demo-branch/helm + version: 0.1.3 + description: A Helm chart for the Skeleton Gatsby Application + digest: 3d905051e4c726576b2c1eb2edd829ae2c3d328a06ae4c833110aa19c7dbfe3b + name: opencatalogi + type: application + urls: + - opencatalogi-0.9.6.tgz + version: 0.9.6 + - apiVersion: v2 + appVersion: 0.9.0 + created: "2023-08-18T11:15:17.707953896+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/feature-cleanup/api/helm/ + version: 1.1.4 + - alias: gatewayui + name: skeleton-app + repository: https://raw.githubusercontent.com/ConductionNL/gateway-ui/refinement-demo-branch/helm + version: 0.1.2 + description: A Helm chart for the Skeleton Gatsby Application + digest: 12b8dc9b2f1c90f6e094d31953a1587444d09bb065b5d43de5f843dfe1b0341b + name: opencatalogi + type: application + urls: + - opencatalogi-0.9.5.tgz + version: 0.9.5 + - apiVersion: v2 + appVersion: 0.9.0 + created: "2023-08-18T11:15:17.635576269+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/feature-cleanup/api/helm/ + version: 1.1.4 + - alias: gatewayui + name: skeleton-app + repository: https://raw.githubusercontent.com/ConductionNL/gateway-ui/demo/helm/ + version: 0.1.1 + description: A Helm chart for the Skeleton Gatsby Application + digest: 6e45554479770f2cb738a6811a71cc24a90634b68f1301e59c3cbf4b45c1a9a2 + name: opencatalogi + type: application + urls: + - opencatalogi-0.9.4.tgz + version: 0.9.4 + - apiVersion: v2 + appVersion: 0.9.0 + created: "2023-08-18T11:15:17.562620021+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/feature-cleanup/api/helm/ + version: 1.1.4 + description: A Helm chart for the Skeleton Gatsby Application + digest: f2a280df5961148f0b09ab9f92eb6a7bb892715fc790f854136daad1ff44a32b + name: opencatalogi + type: application + urls: + - opencatalogi-0.9.3.tgz + version: 0.9.3 + - apiVersion: v2 + appVersion: 0.9.0 + created: "2023-08-18T11:15:17.51792693+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/feature-cleanup/api/helm/ + version: 1.1.1 + description: A Helm chart for the Skeleton Gatsby Application + digest: 0f81fbba6907bef450752601a5c6d7a3e1b324b51d1d49fcc132700d33af42ef + name: opencatalogi + type: application + urls: + - opencatalogi-0.9.2.tgz + version: 0.9.2 + - apiVersion: v2 + appVersion: 0.1.0 + created: "2023-08-18T11:15:17.465947553+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/feature-cleanup/api/helm/ + version: 0.1.12 + description: A Helm chart for the Skeleton Gatsby Application + digest: 481d521f5a2a9ec4611d2ab6eac82e336341138a4607d08118d905b297319f7a + name: opencatalogi + type: application + urls: + - opencatalogi-0.9.0.tgz + version: 0.9.0 + - apiVersion: v2 + appVersion: 0.1.0 + created: "2023-08-18T11:15:17.429513799+02:00" + dependencies: + - alias: gateway + condition: gateway.enabled + name: commonground-gateway + repository: https://raw.githubusercontent.com/ConductionNL/commonground-gateway/feature-cleanup/api/helm/ + version: 0.1.12 + description: A Helm chart for the Skeleton Gatsby Application + digest: 4c7e3d9f32803f610203e6227a40ae3b938dd17adfec738bd74654aaab0b828a + name: opencatalogi + type: application + urls: + - opencatalogi-0.1.0.tgz + version: 0.1.0 +generated: "2023-08-18T11:15:17.387154802+02:00" diff --git a/helm/woo-website/templates/NOTES.txt b/helm/woo-website/templates/NOTES.txt new file mode 100644 index 00000000..4b308b77 --- /dev/null +++ b/helm/woo-website/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/woo-website/templates/_helpers.tpl b/helm/woo-website/templates/_helpers.tpl new file mode 100644 index 00000000..cbc9093e --- /dev/null +++ b/helm/woo-website/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/woo-website/templates/deployment.yaml b/helm/woo-website/templates/deployment.yaml new file mode 100644 index 00000000..d9b467f1 --- /dev/null +++ b/helm/woo-website/templates/deployment.yaml @@ -0,0 +1,74 @@ +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: {} + + 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: + - mountPath: /var/cache/nginx/client_temp + name: tmpfs + - mountPath: /var/run + name: tmpfs2 + ports: + - name: http + containerPort: 8080 + 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/woo-website/templates/hpa.yaml b/helm/woo-website/templates/hpa.yaml new file mode 100644 index 00000000..d2b4f759 --- /dev/null +++ b/helm/woo-website/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "api-platform.fullname" . }} + labels: + {{- include "api-platform.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "api-platform.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/helm/woo-website/templates/ingress.yaml b/helm/woo-website/templates/ingress.yaml new file mode 100644 index 00000000..53bb29c5 --- /dev/null +++ b/helm/woo-website/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/woo-website/templates/pwa-service.yaml b/helm/woo-website/templates/pwa-service.yaml new file mode 100644 index 00000000..d1f65391 --- /dev/null +++ b/helm/woo-website/templates/pwa-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: 8080 + protocol: TCP + name: http + selector: + {{- include "api-platform.selectorLabelsPWA" . | nindent 4 }} diff --git a/helm/woo-website/templates/secrets.yaml b/helm/woo-website/templates/secrets.yaml new file mode 100644 index 00000000..577923f6 --- /dev/null +++ b/helm/woo-website/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/woo-website/templates/serviceaccount.yaml b/helm/woo-website/templates/serviceaccount.yaml new file mode 100644 index 00000000..a0d5bffe --- /dev/null +++ b/helm/woo-website/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/woo-website/templates/tests/test-connection.yaml b/helm/woo-website/templates/tests/test-connection.yaml new file mode 100644 index 00000000..f0156832 --- /dev/null +++ b/helm/woo-website/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "api-platform.fullname" . }}-test-connection" + labels: + {{- include "api-platform.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "api-platform.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/helm/woo-website/values.yaml b/helm/woo-website/values.yaml new file mode 100644 index 00000000..42918b20 --- /dev/null +++ b/helm/woo-website/values.yaml @@ -0,0 +1,105 @@ +# Default values for api-platform. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +pwa: + image: + image: "ghcr.io/conductionnl/woo-website" + pullPolicy: Always + tag: "dev" + # 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" + # These values override the use of the default domain in global.domain + +replicacount: 2 + +global: + domain: woo.commonground.nu + # 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: 10m + # memory: 128Mi + requests: + cpu: 100m + memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {}