diff --git a/Makefile b/Makefile index 1d265fb..298ebc8 100644 --- a/Makefile +++ b/Makefile @@ -32,8 +32,9 @@ docs: schema: PWD=$(pwd) schema: #helm-schema -n -c charts/namespace - helm-schema -n -c charts/keel-server - helm-schema -n -c charts/keel-cronjob + helm-schema -n -c charts/squadron-keel-server + helm-schema -n -c charts/squadron-keel-cronjob + helm-schema -n -c charts/squadron-nextjs-server helm schema-gen charts/namespace/values.yaml > charts/namespace/values.schema.json helm schema-gen charts/beam/values.yaml > charts/beam/values.schema.json helm schema-gen charts/contentserver/values.yaml > charts/contentserver/values.schema.json diff --git a/charts/keel-cronjob/.helmignore b/charts/squadron-keel-cronjob/.helmignore similarity index 100% rename from charts/keel-cronjob/.helmignore rename to charts/squadron-keel-cronjob/.helmignore diff --git a/charts/squadron-keel-cronjob/Chart.yaml b/charts/squadron-keel-cronjob/Chart.yaml new file mode 100644 index 0000000..0cf560e --- /dev/null +++ b/charts/squadron-keel-cronjob/Chart.yaml @@ -0,0 +1,19 @@ +apiVersion: v2 +type: application +name: squadron-keel-cronjob +description: Squadron Keel CronJob Chart +icon: https://avatars.githubusercontent.com/u/889755?s=200&v=4 +home: https://www.foomo.org +keywords: + - foomo + - foomo-keel + - foomo-squadron +sources: + - https://github.com/foomo/helm-charts +annotations: + "artifacthub.io/links": | + - name: Chart Source + url: https://github.com/foomo/helm-charts + +version: 0.1.1 +appVersion: 0.1.1 diff --git a/charts/keel-cronjob/README.md b/charts/squadron-keel-cronjob/README.md similarity index 95% rename from charts/keel-cronjob/README.md rename to charts/squadron-keel-cronjob/README.md index 7004e01..d4e252b 100644 --- a/charts/keel-cronjob/README.md +++ b/charts/squadron-keel-cronjob/README.md @@ -1,8 +1,8 @@ -# keel-cronjob +# squadron-keel-cronjob -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) +![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.1](https://img.shields.io/badge/AppVersion-0.1.1-informational?style=flat-square) -Keel CronJob Chart +Squadron Keel CronJob Chart **Homepage:** @@ -30,7 +30,7 @@ Keel CronJob Chart | cronjob.livenessProbe | object | `{"httpGet":{"path":"/healthz/liveness","port":"healthz"}}` | Liveness probe settings | | cronjob.podAnnotations | object | `{}` | Pod annotations | | cronjob.readinessProbe | object | `{"httpGet":{"path":"/healthz/readiness","port":"healthz"}}` | Readiness probe settings | -| cronjob.resources | object | `{}` | See: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ | +| cronjob.resources | object | `{}` | Resource settings | | cronjob.restart | string | `"Never"` | Restart policy | | cronjob.startupProbe | object | `{"httpGet":{"path":"/healthz/startup","port":"healthz"}}` | Startup probe settings | | env | object | `{}` | FOO: bar | diff --git a/charts/keel-cronjob/README.md.gotmpl b/charts/squadron-keel-cronjob/README.md.gotmpl similarity index 100% rename from charts/keel-cronjob/README.md.gotmpl rename to charts/squadron-keel-cronjob/README.md.gotmpl diff --git a/charts/keel-cronjob/templates/_helpers.tpl b/charts/squadron-keel-cronjob/templates/_helpers.tpl similarity index 100% rename from charts/keel-cronjob/templates/_helpers.tpl rename to charts/squadron-keel-cronjob/templates/_helpers.tpl diff --git a/charts/keel-cronjob/templates/cronjob.yaml b/charts/squadron-keel-cronjob/templates/cronjob.yaml similarity index 100% rename from charts/keel-cronjob/templates/cronjob.yaml rename to charts/squadron-keel-cronjob/templates/cronjob.yaml diff --git a/charts/keel-cronjob/templates/networkpolicy.yaml b/charts/squadron-keel-cronjob/templates/networkpolicy.yaml similarity index 100% rename from charts/keel-cronjob/templates/networkpolicy.yaml rename to charts/squadron-keel-cronjob/templates/networkpolicy.yaml diff --git a/charts/keel-cronjob/templates/persistentvolumeclaim.yaml b/charts/squadron-keel-cronjob/templates/persistentvolumeclaim.yaml similarity index 92% rename from charts/keel-cronjob/templates/persistentvolumeclaim.yaml rename to charts/squadron-keel-cronjob/templates/persistentvolumeclaim.yaml index c0a3503..d183da6 100644 --- a/charts/keel-cronjob/templates/persistentvolumeclaim.yaml +++ b/charts/squadron-keel-cronjob/templates/persistentvolumeclaim.yaml @@ -23,7 +23,6 @@ metadata: labels: {{- include "keel.cronjob.labels" $ | nindent 4 }} namespace: {{ include "keel.cronjob.namespace" $ }} spec: - # https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes {{- if $value.name }} volumeName: {{ $value.name }} {{- end }} diff --git a/charts/keel-cronjob/templates/secret.yaml b/charts/squadron-keel-cronjob/templates/secret.yaml similarity index 100% rename from charts/keel-cronjob/templates/secret.yaml rename to charts/squadron-keel-cronjob/templates/secret.yaml diff --git a/charts/keel-cronjob/templates/serviceaccount.yaml b/charts/squadron-keel-cronjob/templates/serviceaccount.yaml similarity index 100% rename from charts/keel-cronjob/templates/serviceaccount.yaml rename to charts/squadron-keel-cronjob/templates/serviceaccount.yaml diff --git a/charts/keel-cronjob/templates/validate.yaml b/charts/squadron-keel-cronjob/templates/validate.yaml similarity index 100% rename from charts/keel-cronjob/templates/validate.yaml rename to charts/squadron-keel-cronjob/templates/validate.yaml diff --git a/charts/keel-cronjob/values.schema.json b/charts/squadron-keel-cronjob/values.schema.json similarity index 99% rename from charts/keel-cronjob/values.schema.json rename to charts/squadron-keel-cronjob/values.schema.json index b0c60ff..b338f06 100644 --- a/charts/keel-cronjob/values.schema.json +++ b/charts/squadron-keel-cronjob/values.schema.json @@ -216,7 +216,7 @@ }, "resources": { "additionalProperties": true, - "description": "Resouce settings\nSee: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", + "description": "Resource settings", "required": [], "title": "resources", "type": [ diff --git a/charts/keel-cronjob/values.yaml b/charts/squadron-keel-cronjob/values.yaml similarity index 98% rename from charts/keel-cronjob/values.yaml rename to charts/squadron-keel-cronjob/values.yaml index f0e9017..95717e1 100644 --- a/charts/keel-cronjob/values.yaml +++ b/charts/squadron-keel-cronjob/values.yaml @@ -361,8 +361,7 @@ cronjob: # type: [object, null] # additionalProperties: true # @schema - # -- Resouce settings - # -- See: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + # -- Resource settings resources: {} # @schema # type: [object, null] diff --git a/charts/keel-server/.helmignore b/charts/squadron-keel-server/.helmignore similarity index 100% rename from charts/keel-server/.helmignore rename to charts/squadron-keel-server/.helmignore diff --git a/charts/keel-server/Chart.yaml b/charts/squadron-keel-server/Chart.yaml similarity index 73% rename from charts/keel-server/Chart.yaml rename to charts/squadron-keel-server/Chart.yaml index c43344c..b6b2d2d 100644 --- a/charts/keel-server/Chart.yaml +++ b/charts/squadron-keel-server/Chart.yaml @@ -1,12 +1,13 @@ apiVersion: v2 type: application -name: keel-server -description: Keel Server Chart +name: squadron-keel-server +description: Squadron Keel Server Chart icon: https://avatars.githubusercontent.com/u/889755?s=200&v=4 home: https://www.foomo.org keywords: - foomo - foomo-keel + - foomo-squadron sources: - https://github.com/foomo/helm-charts annotations: @@ -14,5 +15,5 @@ annotations: - name: Chart Source url: https://github.com/foomo/helm-charts -version: 0.1.4 -appVersion: 0.1.4 +version: 0.1.5 +appVersion: 0.1.5 diff --git a/charts/keel-server/README.md b/charts/squadron-keel-server/README.md similarity index 93% rename from charts/keel-server/README.md rename to charts/squadron-keel-server/README.md index 3355da3..42c0018 100644 --- a/charts/keel-server/README.md +++ b/charts/squadron-keel-server/README.md @@ -1,8 +1,8 @@ -# keel-server +# squadron-keel-server -![Version: 0.1.4](https://img.shields.io/badge/Version-0.1.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.4](https://img.shields.io/badge/AppVersion-0.1.4-informational?style=flat-square) +![Version: 0.1.5](https://img.shields.io/badge/Version-0.1.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.5](https://img.shields.io/badge/AppVersion-0.1.5-informational?style=flat-square) -Keel Server Chart +Squadron Keel Server Chart **Homepage:** @@ -14,11 +14,11 @@ Keel Server Chart | Key | Type | Default | Description | |-----|------|---------|-------------| -| autoscaling | object | `{"additionalMetrics":{},"behavior":{},"enabled":false,"maxReplicas":5,"minReplicas":1,"targetCPU":75,"targetMemory":null}` | Autoscaling settings | +| autoscaling | object | `{"additionalMetrics":{},"behavior":{},"enabled":false,"maxReplicas":9,"maxUnavailable":1,"minAvailable":"","minReplicas":1,"targetCPU":75,"targetMemory":null}` | Autoscaling settings | | autoscaling.additionalMetrics | object | `{}` | Additional scaling metrics | | autoscaling.behavior | object | `{}` | Autoscaling behavior settings | | autoscaling.enabled | bool | `false` | Specifies whether a auto scaling should be enabled | -| autoscaling.maxReplicas | int | `5` | Maximum replication number | +| autoscaling.maxReplicas | int | `9` | Maximum replication number | | autoscaling.minReplicas | int | `1` | Minimum replication number | | autoscaling.targetCPU | int | `75` | Target CPU utilization | | autoscaling.targetMemory | string | `nil` | Target Memory utilization | @@ -78,8 +78,6 @@ Keel Server Chart | persistence.mountPath | string | `"/var/lib/server/data"` | Storage mount path | | persistence.size | string | `"1Gi"` | Storage size | | persistence.storageClass | string | `""` | Storage class name | -| podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":"","minAvailable":""}` | Pod disruption budget settings | -| podDisruptionBudget.enabled | bool | `false` | Indicates wether the pod disruption budget is enabled | | ports | object | `{}` | http: 8080 | | rbac | object | `{"enabled":false}` | RBAC configuration | | rbac.enabled | bool | `false` | Create PodSecurityPolicy. | @@ -109,7 +107,7 @@ Keel Server Chart | server.livenessProbe | object | `{"httpGet":{"path":"/healthz/liveness","port":"healthz"}}` | Liveness probe settings | | server.podAnnotations | object | `{}` | Pod annotations | | server.readinessProbe | object | `{"httpGet":{"path":"/healthz/readiness","port":"healthz"}}` | Readiness probe settings | -| server.resources | object | `{}` | See: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ | +| server.resources | object | `{}` | Resource settings | | server.startupProbe | object | `{"httpGet":{"path":"/healthz/startup","port":"healthz"}}` | Startup probe settings | | service | object | `{"additionalLabels":{},"annotations":{},"type":"ClusterIP"}` | Service settings | | service.additionalLabels | object | `{}` | Additional Service labels | diff --git a/charts/keel-server/README.md.gotmpl b/charts/squadron-keel-server/README.md.gotmpl similarity index 100% rename from charts/keel-server/README.md.gotmpl rename to charts/squadron-keel-server/README.md.gotmpl diff --git a/charts/keel-server/templates/_helpers.tpl b/charts/squadron-keel-server/templates/_helpers.tpl similarity index 100% rename from charts/keel-server/templates/_helpers.tpl rename to charts/squadron-keel-server/templates/_helpers.tpl diff --git a/charts/keel-server/templates/deployment.yaml b/charts/squadron-keel-server/templates/deployment.yaml similarity index 100% rename from charts/keel-server/templates/deployment.yaml rename to charts/squadron-keel-server/templates/deployment.yaml diff --git a/charts/keel-server/templates/horizontalpodautoscaler.yaml b/charts/squadron-keel-server/templates/horizontalpodautoscaler.yaml similarity index 100% rename from charts/keel-server/templates/horizontalpodautoscaler.yaml rename to charts/squadron-keel-server/templates/horizontalpodautoscaler.yaml diff --git a/charts/keel-server/templates/ingress.yaml b/charts/squadron-keel-server/templates/ingress.yaml similarity index 92% rename from charts/keel-server/templates/ingress.yaml rename to charts/squadron-keel-server/templates/ingress.yaml index e16a4f6..4b9f6bf 100644 --- a/charts/keel-server/templates/ingress.yaml +++ b/charts/squadron-keel-server/templates/ingress.yaml @@ -13,7 +13,9 @@ metadata: {{- end }} namespace: {{ include "keel.server.namespace" . }} spec: - ingressClassName: {{ .Values.ingress.className }} + {{- with .Values.ingress.className }} + ingressClassName: {{ . }} + {{- end }} rules: {{- range .Values.ingress.hosts }} - host: {{ tpl . $ | quote }} diff --git a/charts/keel-server/templates/networkpolicy.yaml b/charts/squadron-keel-server/templates/networkpolicy.yaml similarity index 100% rename from charts/keel-server/templates/networkpolicy.yaml rename to charts/squadron-keel-server/templates/networkpolicy.yaml diff --git a/charts/keel-server/templates/persistentvolumeclaim.yaml b/charts/squadron-keel-server/templates/persistentvolumeclaim.yaml similarity index 92% rename from charts/keel-server/templates/persistentvolumeclaim.yaml rename to charts/squadron-keel-server/templates/persistentvolumeclaim.yaml index f5bc545..3246126 100644 --- a/charts/keel-server/templates/persistentvolumeclaim.yaml +++ b/charts/squadron-keel-server/templates/persistentvolumeclaim.yaml @@ -23,7 +23,6 @@ metadata: labels: {{- include "keel.server.labels" $ | nindent 4 }} namespace: {{ include "keel.server.namespace" $ }} spec: - # https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes {{- if $value.name }} volumeName: {{ $value.name }} {{- end }} diff --git a/charts/keel-server/templates/poddisruptionbudget.yaml b/charts/squadron-keel-server/templates/poddisruptionbudget.yaml similarity index 71% rename from charts/keel-server/templates/poddisruptionbudget.yaml rename to charts/squadron-keel-server/templates/poddisruptionbudget.yaml index 764f105..fb35c8a 100644 --- a/charts/keel-server/templates/poddisruptionbudget.yaml +++ b/charts/squadron-keel-server/templates/poddisruptionbudget.yaml @@ -1,4 +1,4 @@ -{{- if .Values.podDisruptionBudget.enabled }} +{{- if .Values.autoscaling.enabled }} apiVersion: policy/v1 kind: PodDisruptionBudget metadata: @@ -8,10 +8,10 @@ metadata: spec: selector: matchLabels: {{- include "keel.server.selectorLabels" . | nindent 6 }} - {{- with .Values.podDisruptionBudget.minAvailable }} + {{- with .Values.autoscaling.minAvailable }} minAvailable: {{ . }} {{- end }} - {{- with .Values.podDisruptionBudget.maxUnavailable }} + {{- with .Values.autoscaling.maxUnavailable }} maxUnavailable: {{ . }} {{- end }} {{- end }} diff --git a/charts/keel-server/templates/secret.yaml b/charts/squadron-keel-server/templates/secret.yaml similarity index 100% rename from charts/keel-server/templates/secret.yaml rename to charts/squadron-keel-server/templates/secret.yaml diff --git a/charts/keel-server/templates/service.yaml b/charts/squadron-keel-server/templates/service.yaml similarity index 100% rename from charts/keel-server/templates/service.yaml rename to charts/squadron-keel-server/templates/service.yaml diff --git a/charts/keel-server/templates/serviceaccount.yaml b/charts/squadron-keel-server/templates/serviceaccount.yaml similarity index 100% rename from charts/keel-server/templates/serviceaccount.yaml rename to charts/squadron-keel-server/templates/serviceaccount.yaml diff --git a/charts/keel-server/templates/servicemonitor.yaml b/charts/squadron-keel-server/templates/servicemonitor.yaml similarity index 100% rename from charts/keel-server/templates/servicemonitor.yaml rename to charts/squadron-keel-server/templates/servicemonitor.yaml diff --git a/charts/keel-server/templates/validate.yaml b/charts/squadron-keel-server/templates/validate.yaml similarity index 100% rename from charts/keel-server/templates/validate.yaml rename to charts/squadron-keel-server/templates/validate.yaml diff --git a/charts/keel-server/values.schema.json b/charts/squadron-keel-server/values.schema.json similarity index 97% rename from charts/keel-server/values.schema.json rename to charts/squadron-keel-server/values.schema.json index a6015cc..831048d 100644 --- a/charts/keel-server/values.schema.json +++ b/charts/squadron-keel-server/values.schema.json @@ -28,12 +28,32 @@ "type": "boolean" }, "maxReplicas": { - "default": 5, + "default": 9, "description": "Maximum replication number", "required": [], "title": "maxReplicas", "type": "integer" }, + "maxUnavailable": { + "default": 1, + "description": "Maximum unavailablity", + "required": [], + "title": "maxUnavailable", + "type": [ + "integer", + "string" + ] + }, + "minAvailable": { + "default": "", + "description": "Minimum availablity", + "required": [], + "title": "minAvailable", + "type": [ + "integer", + "string" + ] + }, "minReplicas": { "default": 1, "description": "Minimum replication number", @@ -563,42 +583,6 @@ "title": "persistence", "type": "object" }, - "podDisruptionBudget": { - "additionalProperties": false, - "description": "Pod disruption budget settings", - "properties": { - "enabled": { - "default": false, - "description": "Indicates wether the pod disruption budget is enabled", - "required": [], - "title": "enabled", - "type": "boolean" - }, - "maxUnavailable": { - "default": "", - "description": "Maximum unavailablity", - "required": [], - "title": "maxUnavailable", - "type": [ - "integer", - "string" - ] - }, - "minAvailable": { - "default": "", - "description": "Minimum availablity", - "required": [], - "title": "minAvailable", - "type": [ - "integer", - "string" - ] - } - }, - "required": [], - "title": "podDisruptionBudget", - "type": "object" - }, "ports": { "additionalProperties": true, "description": "Map of ports to expose\nports:\n http: 8080", @@ -930,7 +914,7 @@ }, "resources": { "additionalProperties": true, - "description": "Resouce settings\nSee: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", + "description": "Resource settings", "required": [], "title": "resources", "type": [ @@ -940,7 +924,7 @@ }, "startupProbe": { "additionalProperties": true, - "description": "Startup probe settings", + "description": "resources:\n limits:\n memory: 256Mi\n requests:\n cpu: 1\n memory: 256Mi\nStartup probe settings", "properties": { "httpGet": { "additionalProperties": false, diff --git a/charts/keel-server/values.yaml b/charts/squadron-keel-server/values.yaml similarity index 97% rename from charts/keel-server/values.yaml rename to charts/squadron-keel-server/values.yaml index 66e25c9..ff9b6db 100644 --- a/charts/keel-server/values.yaml +++ b/charts/squadron-keel-server/values.yaml @@ -440,9 +440,14 @@ server: # type: [object, null] # additionalProperties: true # @schema - # -- Resouce settings - # -- See: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + # -- Resource settings resources: {} + # resources: + # limits: + # memory: 256Mi + # requests: + # cpu: 1 + # memory: 256Mi # @schema # type: [object, null] # additionalProperties: true @@ -471,27 +476,6 @@ server: port: healthz path: /healthz/liveness -# @schema -# type: object -# @schema -# -- Pod disruption budget settings -podDisruptionBudget: - # @schema - # type: boolean - # @schema - # -- Indicates wether the pod disruption budget is enabled - enabled: false - # @schema - # type: [integer, string] - # @schema - # Minimum availablity - minAvailable: '' - # @schema - # type: [integer, string] - # @schema - # Maximum unavailablity - maxUnavailable: '' - # @schema # type: object # @schema @@ -511,7 +495,17 @@ autoscaling: # type: integer # @schema # -- Maximum replication number - maxReplicas: 5 + maxReplicas: 9 + # @schema + # type: [integer, string] + # @schema + # Minimum availablity + minAvailable: '' + # @schema + # type: [integer, string] + # @schema + # Maximum unavailablity + maxUnavailable: 1 # @schema # type: [integer, null] # @schema diff --git a/charts/squadron-nextjs-server/.helmignore b/charts/squadron-nextjs-server/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/squadron-nextjs-server/.helmignore @@ -0,0 +1,23 @@ +# 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/ diff --git a/charts/keel-cronjob/Chart.yaml b/charts/squadron-nextjs-server/Chart.yaml similarity index 79% rename from charts/keel-cronjob/Chart.yaml rename to charts/squadron-nextjs-server/Chart.yaml index dc76083..fad49b0 100644 --- a/charts/keel-cronjob/Chart.yaml +++ b/charts/squadron-nextjs-server/Chart.yaml @@ -1,12 +1,12 @@ apiVersion: v2 type: application -name: keel-cronjob -description: Keel CronJob Chart +name: squadron-nextjs-server +description: Squadron NextJS Server Chart icon: https://avatars.githubusercontent.com/u/889755?s=200&v=4 home: https://www.foomo.org keywords: - foomo - - foomo-keel + - foomo-squadron sources: - https://github.com/foomo/helm-charts annotations: diff --git a/charts/squadron-nextjs-server/README.md b/charts/squadron-nextjs-server/README.md new file mode 100644 index 0000000..806f2cd --- /dev/null +++ b/charts/squadron-nextjs-server/README.md @@ -0,0 +1,135 @@ +# squadron-nextjs-server + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) + +Squadron NextJS Server Chart + +**Homepage:** + +## Source Code + +* + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| autoscaling | object | `{"additionalMetrics":{},"behavior":{},"enabled":false,"maxReplicas":9,"maxUnavailable":1,"minAvailable":"","minReplicas":1,"targetCPU":75,"targetMemory":null}` | Autoscaling settings | +| autoscaling.additionalMetrics | object | `{}` | Additional scaling metrics | +| autoscaling.behavior | object | `{}` | Autoscaling behavior settings | +| autoscaling.enabled | bool | `false` | Specifies whether a auto scaling should be enabled | +| autoscaling.maxReplicas | int | `9` | Maximum replication number | +| autoscaling.minReplicas | int | `1` | Minimum replication number | +| autoscaling.targetCPU | int | `75` | Target CPU utilization | +| autoscaling.targetMemory | string | `nil` | Target Memory utilization | +| env | object | `{}` | FOO: bar | +| fleet | string | `""` | Squadron fleet name | +| fullnameOverride | string | `""` | Overrides the chart's computed fullname | +| gateway | object | `{"addToRobots":"","enabled":false,"expose":[],"sitemap":""}` | Foomo gateway settings | +| gateway.addToRobots | string | `""` | Robots.txt | +| gateway.enabled | bool | `false` | Indicates wether the gateway is enabled or not | +| gateway.expose | list | `[]` | Expose settings | +| gateway.sitemap | string | `""` | Sitemap | +| graceful | object | `{"delaySeconds":15,"enabled":false,"periodSeconds":45}` | Graceful shutdown settings | +| graceful.delaySeconds | int | `15` | Seconds to wait for kubernetes to deregister | +| graceful.enabled | bool | `false` | Indicates wether graceful shutdown is enabled | +| graceful.periodSeconds | int | `45` | Total seconds for the grace period | +| image | object | `{"pullPolicy":"IfNotPresent","pullSecrets":[],"recreate":false,"repository":"","tag":""}` | Image settings | +| image.pullPolicy | string | `"IfNotPresent"` | Image tag | +| image.pullSecrets | list | `[]` | Image pull secrets | +| image.recreate | bool | `false` | Force recreation | +| image.repository | string | `""` | Image repository | +| image.tag | string | `""` | Image tag | +| ingress | object | `{"additionalLabels":{},"annotations":{"nginx.ingress.kubernetes.io/rewrite-target":"/$1","nginx.ingress.kubernetes.io/use-regex":"true"},"className":"","enabled":false,"hosts":[],"paths":[],"tls":[]}` | Ingress settings | +| ingress.additionalLabels | object | `{}` | Additional labels | +| ingress.annotations | object | `{"nginx.ingress.kubernetes.io/rewrite-target":"/$1","nginx.ingress.kubernetes.io/use-regex":"true"}` | Ingress annotations | +| ingress.className | string | `""` | Ingress class name | +| ingress.enabled | bool | `false` | Indicates wether the ingress is enabled or not | +| ingress.hosts | list | `[]` | List of hosts | +| ingress.paths | list | `[]` | List of hosts | +| ingress.tls | list | `[]` | TLS settings | +| log | object | `{"level":"info","mode":"prod"}` | Log settings | +| log.level | string | `"info"` | Log level | +| log.mode | string | `"prod"` | Log mode | +| nameOverride | string | `""` | Overrides the chart's name | +| namespaceOverride | string | `""` | If not set, `.Release.Namespace` is used | +| networkPolicy.egress | object | `{"additionalRules":[],"allowExternal":true,"enabled":true}` | Egress settings | +| networkPolicy.egress.additionalRules | list | `[]` | Additional egress rules | +| networkPolicy.egress.allowExternal | bool | `true` | Allow ingress through labels | +| networkPolicy.egress.enabled | bool | `true` | Specifies whether egress should be enabled | +| networkPolicy.enabled | bool | `false` | Specifies whether Network Policies should be created | +| networkPolicy.ingress | object | `{"additionalRules":[],"allowExternal":true,"enabled":true}` | Ingress settings | +| networkPolicy.ingress.additionalRules | list | `[]` | Additional ingress rules | +| networkPolicy.ingress.allowExternal | bool | `true` | Allow ingress through labels | +| networkPolicy.ingress.enabled | bool | `true` | Specifies whether ingress should be enabled | +| networkPolicy.rules | list | `[]` | | +| otel | object | `{"enabled":false,"gorm":{"enabled":true,"sqlParametersDisabled":true},"gotsrpc":{"enabled":true,"payloadAttributeDisabled":true},"mongo":{"commandAttributeDisabled":true,"enabled":true},"otlp":{"endpoint":"alloy:4317","insecure":true},"ratio":1}` | OpenTelemetry settings | +| otel.enabled | bool | `false` | Indicates wether to enable it or not | +| otel.gorm | object | `{"enabled":true,"sqlParametersDisabled":true}` | GORM settings | +| otel.gorm.sqlParametersDisabled | bool | `true` | Indicates wether to trace sql attributes | +| otel.gotsrpc | object | `{"enabled":true,"payloadAttributeDisabled":true}` | GOTSRPC settings | +| otel.gotsrpc.enabled | bool | `true` | Indicates wether to enable it or not | +| otel.gotsrpc.payloadAttributeDisabled | bool | `true` | Indicates wether to trace payload attributes | +| otel.mongo | object | `{"commandAttributeDisabled":true,"enabled":true}` | Mongo settings | +| otel.mongo.commandAttributeDisabled | bool | `true` | Indicates wether to trace command attributes | +| otel.mongo.enabled | bool | `true` | Indicates wether to enable it or not | +| otel.otlp | object | `{"endpoint":"alloy:4317","insecure":true}` | OTLP exporter settings | +| otel.otlp.endpoint | string | `"alloy:4317"` | Enpoint uri | +| otel.otlp.insecure | bool | `true` | Indicates wether to use insecure connection | +| otel.ratio | int | `1` | Trace ratio | +| persistence | object | `{"accessMode":"ReadWriteOnce","enabled":false,"mountPath":"/var/lib/server/data","size":"1Gi","storageClass":""}` | Persistence settings | +| persistence.accessMode | string | `"ReadWriteOnce"` | Access mode | +| persistence.enabled | bool | `false` | Indicates wether a pv should be attached or not | +| persistence.mountPath | string | `"/var/lib/server/data"` | Storage mount path | +| persistence.size | string | `"1Gi"` | Storage size | +| persistence.storageClass | string | `""` | Storage class name | +| rbac | object | `{"enabled":false}` | RBAC configuration | +| rbac.enabled | bool | `false` | Create PodSecurityPolicy. | +| replicas | int | `1` | Number of replications | +| revisionHistoryLimit | int | `10` | Number of revisions to keep | +| scheduling | object | `{"affinity":{},"enabled":false,"nodeSelector":{},"priorityClass":null,"tolerations":[]}` | Scheduling settings | +| scheduling.affinity | object | `{}` | Affinity for pod assignment | +| scheduling.enabled | bool | `false` | Indicates wether scheduling is enabled or not | +| scheduling.nodeSelector | object | `{}` | Node labels for pod assignment | +| scheduling.tolerations | list | `[]` | Tolerations for pod assignment | +| secretEnv | object | `{}` | Map of environment variables to add as a secret | +| secretMounts | list | `[]` | | +| securityContext | object | `{"fsGroup":10001,"runAsGroup":10001,"runAsNonRoot":true,"runAsUser":10001}` | Security context | +| securityContext.fsGroup | int | `10001` | File system group id | +| securityContext.runAsGroup | int | `10001` | Run as group id | +| securityContext.runAsNonRoot | bool | `true` | Indicates wether to run as non root user | +| securityContext.runAsUser | int | `10001` | Run as user id | +| server | object | `{"additionalEnv":[],"additionalEnvFrom":[],"additionalLabels":{},"additionalPorts":[],"additionalVolumeMounts":[],"additionalVolumes":[],"annotations":{},"hostAliases":[],"livenessProbe":{"tcpSocket":{"port":3000}},"podAnnotations":{},"readinessProbe":{"tcpSocket":{"port":3000}},"resources":{},"startupProbe":{"tcpSocket":{"port":3000}}}` | Server settings | +| server.additionalEnv | list | `[]` | Additional environment variables | +| server.additionalEnvFrom | list | `[]` | Additional env from | +| server.additionalLabels | object | `{}` | Additional labels | +| server.additionalPorts | list | `[]` | Additional ports | +| server.additionalVolumeMounts | list | `[]` | Additional volume mounts | +| server.additionalVolumes | list | `[]` | Additional volumes | +| server.annotations | object | `{}` | Deployment annotations | +| server.hostAliases | list | `[]` | Host aliases | +| server.livenessProbe | object | `{"tcpSocket":{"port":3000}}` | Liveness probe settings | +| server.podAnnotations | object | `{}` | Pod annotations | +| server.readinessProbe | object | `{"tcpSocket":{"port":3000}}` | Readiness probe settings | +| server.resources | object | `{}` | Resource settings | +| server.startupProbe | object | `{"tcpSocket":{"port":3000}}` | Startup probe settings | +| service | object | `{"additionalLabels":{},"annotations":{},"type":"ClusterIP"}` | Service settings | +| service.additionalLabels | object | `{}` | Additional Service labels | +| service.annotations | object | `{}` | Service annotations | +| service.type | string | `"ClusterIP"` | Service type | +| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | +| serviceAccount.automount | bool | `true` | Automatically mount a ServiceAccount's API credentials? | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template | +| serviceMonitor | object | `{"additionalLabels":{},"annotations":{},"enabled":false,"interval":"","metricRelabelings":[],"relabelings":[],"scrapeTimeout":"","targetLabels":[]}` | ServiceMonitor configuration | +| serviceMonitor.additionalLabels | object | `{}` | Additional ServiceMonitor labels | +| serviceMonitor.annotations | object | `{}` | ServiceMonitor annotations | +| serviceMonitor.enabled | bool | `false` | If enabled, ServiceMonitor resources for Prometheus Operator are created | +| serviceMonitor.interval | string | `""` | ServiceMonitor scrape interval | +| serviceMonitor.metricRelabelings | list | `[]` | ServiceMonitor metric relabel configs to apply to samples before ingestion | +| serviceMonitor.relabelings | list | `[]` | ServiceMonitor relabel configs to apply to samples before scraping. | +| serviceMonitor.scrapeTimeout | string | `""` | ServiceMonitor scrape timeout in Go duration format (e.g. 15s) | +| serviceMonitor.targetLabels | list | `[]` | ServiceMonitor will add labels from the service to the Prometheus metric | +| squadron | string | `""` | Squadron name | +| unit | string | `""` | Squadron unit name | +| updateStrategy | string | `"RollingUpdate"` | Deployment update strategy | diff --git a/charts/squadron-nextjs-server/README.md.gotmpl b/charts/squadron-nextjs-server/README.md.gotmpl new file mode 100644 index 0000000..9174c35 --- /dev/null +++ b/charts/squadron-nextjs-server/README.md.gotmpl @@ -0,0 +1,16 @@ +{{ template "chart.header" . }} +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.badgesSection" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +{{ template "chart.maintainersSection" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} diff --git a/charts/squadron-nextjs-server/templates/_helpers.tpl b/charts/squadron-nextjs-server/templates/_helpers.tpl new file mode 100644 index 0000000..c923580 --- /dev/null +++ b/charts/squadron-nextjs-server/templates/_helpers.tpl @@ -0,0 +1,167 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "nextjs.server.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 "nextjs.server.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- tpl .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 "nextjs.server.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "nextjs.server.chart-revision" -}} +{{- printf "%s-%s-%d" .Chart.Name .Chart.Version .Release.Revision | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "nextjs.server.labels" -}} +helm.sh/chart: {{ include "nextjs.server.chart" . }} +{{ include "nextjs.server.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "nextjs.server.selectorLabels" -}} +app.kubernetes.io/name: {{ include "nextjs.server.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Networking labels +*/}} +{{- define "nextjs.server.networkingLabels" -}} +{{- if .Values.networkPolicy.enabled }} +{{- range .Values.networkPolicy.rules }} +networking/{{ . }}: "true" +{{- end}} +{{- if .Values.networkPolicy.ingress.enabled }} +{{- if .Values.networkPolicy.ingress.allowExternal }} +kubernetes.io/networking.name: {{ include "nextjs.server.fullname" . }} +{{- end}} +{{- end}} +{{- end }} +{{- end }} + +{{/* +Create the name of the namespace +*/}} +{{- define "nextjs.server.namespace" -}} +{{- default .Release.Namespace .Values.namespaceOverride }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "nextjs.server.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "nextjs.server.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Keel standard envs +{{- include "nextjs.server.env.log" . | nindent 12 }} +*/}} +{{- define "nextjs.server.env.log" -}} +- name: LOG_MODE + value: "{{ .Values.log.mode }}" +- name: LOG_LEVEL + value: "{{ .Values.log.level }}" +{{- if eq .Values.log.mode "dev" }} +- name: LOG_DISABLE_CALLER + value: "false" +- name: LOG_DISABLE_STACKTRACE + value: "true" +{{- end }} +{{- end -}} + +{{/* +Squadron standard envs +{{- include "nextjs.server.env.squadron" . | nindent 12 }} +*/}} +{{- define "nextjs.server.env.squadron" -}} +{{- if .Values.fleet }} +- name: FLEET + value: {{ .Values.fleet | quote }} +{{- end }} +{{- if .Values.squadron }} +- name: SQUADRON + value: {{ .Values.squadron | quote }} +{{- end }} +{{- if .Values.unit }} +- name: UNIT + value: {{ .Values.unit | quote }} +{{- end }} +{{- end -}} + +{{/* +OpenTelemetry standard envs +{{- include "nextjs.server.env.opentelemetry" . | nindent 12 }} +*/}} +{{- define "nextjs.server.env.opentelemetry" -}} +- name: OTEL_ENABLED + value: "{{ .Values.otel.enabled }}" +- name: OTEL_SERVICE_NAME + value: {{ include "nextjs.server.fullname" . | quote }} +- name: OTEL_TRACE_RATIO + value: "{{ .Values.otel.ratio }}" +- name: OTEL_GORM_ENABLED + value: "{{ .Values.otel.gorm.enabled }}" +- name: OTEL_GORM_SQL_PARAMETERS_ENABLED + value: "{{ not .Values.otel.gorm.sqlParametersDisabled }}" +- name: OTEL_MONGO_ENABLED + value: "{{ .Values.otel.mongo.enabled }}" +- name: OTEL_MONGO_COMMAND_ATTRIBUTE_DISABLED + value: "{{ .Values.otel.mongo.commandAttributeDisabled }}" +- name: OTEL_GOTSRPC_ENABLED + value: "{{ .Values.otel.gotsrpc.enabled }}" +- name: OTEL_GOTSRPC_PAYLOAD_ATTRIBUTE_DISABLED + value: "{{ .Values.otel.gotsrpc.payloadAttributeDisabled }}" +- name: OTEL_EXPORTER_OTLP_INSECURE + value: "{{ .Values.otel.otlp.insecure }}" +- name: OTEL_EXPORTER_OTLP_ENDPOINT + value: "{{ .Values.otel.otlp.endpoint }}" +{{- end -}} + +{{/* +Deployment force recreate annotions +{{- include "nextjs.server.annotations.recreatePod" . | nindent 8 }} +*/}} +{{- define "nextjs.server.annotations.recreatePod" -}} +{{- if .Values.image.recreate }} +helm.sh/chart: {{ include "nextjs.server.chart-revision" . }} +{{- end }} +{{- end -}} diff --git a/charts/squadron-nextjs-server/templates/deployment.yaml b/charts/squadron-nextjs-server/templates/deployment.yaml new file mode 100644 index 0000000..bf7f7f7 --- /dev/null +++ b/charts/squadron-nextjs-server/templates/deployment.yaml @@ -0,0 +1,140 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "nextjs.server.fullname" . }} + labels: + {{- include "nextjs.server.labels" . | nindent 4 }} + {{- with .Values.server.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.server.annotations }} + annotations: {{- toYaml . | nindent 4 }} + {{- end }} + namespace: {{ include "nextjs.server.namespace" . }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicas }} + {{- end }} + revisionHistoryLimit: {{ .Values.revisionHistoryLimit }} + strategy: + type: {{ .Values.updateStrategy }} + selector: + matchLabels: {{- include "nextjs.server.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "nextjs.server.selectorLabels" . | nindent 8 }} + {{- include "nextjs.server.networkingLabels" . | nindent 8 }} + annotations: + {{- include "nextjs.server.annotations.recreatePod" . | nindent 8 }} + {{- with .Values.server.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + serviceAccountName: {{ include "nextjs.server.serviceAccountName" . }} + automountServiceAccountToken: {{ .Values.serviceAccount.automount }} + {{- if .Values.graceful.enabled }} + terminationGracePeriodSeconds: {{ .Values.graceful.periodSeconds }} + {{- end }} + {{- with .Values.image.pullSecrets }} + imagePullSecrets: {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.server.hostAliases }} + hostAliases: {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: server + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 3000 + - name: prometheus + containerPort: 9200 + {{- with .Values.server.additionalPorts }} + {{- toYaml . | nindent 12 }} + {{- end }} + env: + {{- include "nextjs.server.env.squadron" . | nindent 12 }} + {{- include "nextjs.server.env.opentelemetry" . | nindent 12 }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ tpl $value $ | quote }} + {{- end }} + {{- with .Values.server.additionalEnv }} + {{- toYaml . | nindent 12 }} + {{- end }} + envFrom: + {{- with .Values.secretEnv }} + - secretRef: + name: {{ include "nextjs.server.fullname" $ }}-env + {{- end }} + {{- with .Values.server.additionalEnvFrom }} + {{- toYaml . | nindent 12 }} + {{- end }} + volumeMounts: + {{- if .Values.persistence.enabled }} + - name: {{ include "nextjs.server.fullname" . }}-data + mountPath: {{ .Values.persistence.mountPath }} + {{- end }} + {{- with .Values.server.additionalVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- range .Values.secretMounts }} + - name: {{ . }} + readOnly: true + mountPath: /run/secrets/{{ . }} + {{- end }} + {{- with .Values.server.resources }} + resources: {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.server.startupProbe }} + startupProbe: {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.server.livenessProbe }} + livenessProbe: {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.server.readinessProbe }} + readinessProbe: {{- toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.graceful.enabled }} + lifecycle: + preStop: + exec: + command: [ 'sh', '-c', 'sleep {{ .Values.graceful.delaySeconds }}' ] + {{- end }} + {{- if .Values.scheduling.enabled }} + {{- with .Values.scheduling.priorityClass }} + priorityClassName: {{ . }} + {{- end }} + {{- with .Values.scheduling.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.scheduling.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.scheduling.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} + volumes: + {{- if .Values.persistence.enabled }} + - name: {{ include "nextjs.server.fullname" . }}-data + persistentVolumeClaim: + claimName: {{ include "nextjs.server.fullname" . }}-data + {{- end }} + {{- range .Values.secretMounts }} + - name: {{ . }} + secret: + secretName: {{ . }} + {{- end }} + {{- with .Values.server.additionalVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/squadron-nextjs-server/templates/gateway.yaml b/charts/squadron-nextjs-server/templates/gateway.yaml new file mode 100644 index 0000000..5461467 --- /dev/null +++ b/charts/squadron-nextjs-server/templates/gateway.yaml @@ -0,0 +1,19 @@ +{{- if and (.Capabilities.APIVersions.Has "foomo.org/v1") .Values.gateway.enabled }} +apiVersion: foomo.org/v1 +kind: Gateway +metadata: + name: {{ include "nextjs.server.fullname" . }} + labels: {{- include "nextjs.server.labels" . | nindent 4 }} + namespace: {{ include "nextjs.server.namespace" . }} +spec: + service: http://{{ include "nextjs.server.fullname" . }}.{{ include "nextjs.server.namespace" . }} + {{- with .Values.gateway.addToRobots }} + addToRobots: {{ . }} + {{- end }} + {{- with .Values.gateway.sitemap }} + sitemap: {{ . }} + {{- end }} + {{- with .Values.gateway.expose }} + expose: {{- toYaml . | nindent 4 }} + {{ end }} +{{- end }} diff --git a/charts/squadron-nextjs-server/templates/horizontalpodautoscaler.yaml b/charts/squadron-nextjs-server/templates/horizontalpodautoscaler.yaml new file mode 100644 index 0000000..85417fc --- /dev/null +++ b/charts/squadron-nextjs-server/templates/horizontalpodautoscaler.yaml @@ -0,0 +1,45 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "nextjs.server.fullname" . }} + labels: {{- include "nextjs.server.labels" . | nindent 4 }} + namespace: {{ include "nextjs.server.namespace" . }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "nextjs.server.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + behavior: + scaleDown: + stabilizationWindowSeconds: 60 + policies: + - type: Percent + periodSeconds: 120 + value: 35 + metrics: + {{- if .Values.autoscaling.targetCPU }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPU }} + {{- end }} + {{- if .Values.autoscaling.targetMemory }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemory }} + {{- end }} + {{- with .Values.autoscaling.additionalMetrics }} + {{- toYaml . | nindent 6 }} + {{- end}} + {{- with .Values.autoscaling.behavior }} + behavior: {{ toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/squadron-nextjs-server/templates/ingress.yaml b/charts/squadron-nextjs-server/templates/ingress.yaml new file mode 100644 index 0000000..5d55117 --- /dev/null +++ b/charts/squadron-nextjs-server/templates/ingress.yaml @@ -0,0 +1,50 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "nextjs.server.fullname" . }} + labels: + {{- include "nextjs.server.labels" . | nindent 4 }} + {{- with .Values.ingress.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.ingress.annotations }} + annotations: {{- toYaml . | nindent 4 }} + {{- end }} + namespace: {{ include "nextjs.server.namespace" . }} +spec: + {{- with .Values.ingress.className }} + ingressClassName: {{ . }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ tpl . $ | quote }} + http: + paths: + - pathType: ImplementationSpecific + path: /static/{{ $.Values.squadron }}-{{ $.Values.unit }}/public/(.*) + backend: + service: + name: {{ include "nextjs.server.fullname" $ }} + port: + number: 3000 + - pathType: ImplementationSpecific + path: /static/{{ $.Values.squadron }}-{{ $.Values.unit }}/(_next/static/.*) + backend: + service: + name: {{ include "nextjs.server.fullname" $ }} + port: + number: 3000 + {{- range $.Values.ingress.paths }} + - pathType: {{ default .pathType "ImplementationSpecific" }} + path: {{ .path }} + backend: + service: + name: {{ include "nextjs.server.fullname" $ }} + port: + number: {{ .port }} + {{- end }} + {{- end }} + {{- with .Values.ingress.tls }} + tls: + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} diff --git a/charts/squadron-nextjs-server/templates/networkpolicy.yaml b/charts/squadron-nextjs-server/templates/networkpolicy.yaml new file mode 100644 index 0000000..234cc7f --- /dev/null +++ b/charts/squadron-nextjs-server/templates/networkpolicy.yaml @@ -0,0 +1,43 @@ +{{- if .Values.networkPolicy.enabled }} +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: {{ include "nextjs.server.fullname" . }} + labels: {{- include "nextjs.server.labels" . | nindent 4 }} + namespace: {{ include "nextjs.server.namespace" . }} +spec: + policyTypes: + {{- if .Values.networkPolicy.ingress.enabled }} + - Ingress + {{- end }} + {{- if .Values.networkPolicy.egress.enabled }} + - Egress + {{- end }} + podSelector: + matchLabels: {{- include "nextjs.server.selectorLabels" . | nindent 6 }} + {{- if .Values.networkPolicy.ingress.enabled }} + ingress: + {{- if .Values.networkPolicy.ingress.allowExternal }} + - from: + - podSelector: + matchLabels: + networking/allow-{{- include "nextjs.server.fullname" . }}-access: "true" + {{- end }} + {{ with .Values.networkPolicy.ingress.additionalRules }} + {{ toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- if .Values.networkPolicy.egress.enabled }} + egress: + {{ if .Values.networkPolicy.egress.allowExternal }} + - to: + - podSelector: + matchLabels: + networking/allow-{{- include "nextjs.server.fullname" . }}-access: "true" + {{- end }} + {{ with .Values.networkPolicy.egress.additionalRules }} + {{ toYaml . | nindent 4 }} + {{- end }} + {{- end }} +{{- end }} + diff --git a/charts/squadron-nextjs-server/templates/persistentvolumeclaim.yaml b/charts/squadron-nextjs-server/templates/persistentvolumeclaim.yaml new file mode 100644 index 0000000..166bb7d --- /dev/null +++ b/charts/squadron-nextjs-server/templates/persistentvolumeclaim.yaml @@ -0,0 +1,39 @@ +{{- if .Values.persistence.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "nextjs.server.fullname" . }}-data + labels: {{- include "nextjs.server.labels" . | nindent 4 }} + namespace: {{ include "nextjs.server.namespace" . }} +spec: + accessModes: [{{ .Values.persistence.accessMode }}] + {{- with .Values.persistence.storageClass }} + storageClassName: {{ . }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.size }} +--- +{{- end }} +{{- range $key, $value := .Values.server.additionalVolumes }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ $key }} + labels: {{- include "nextjs.server.labels" $ | nindent 4 }} + namespace: {{ include "nextjs.server.namespace" $ }} +spec: + {{- if $value.name }} + volumeName: {{ $value.name }} + {{- end }} + accessModes: [ {{ default $value.accessMode "ReadWriteOnce" }} ] + {{- with $value.storageClass }} + storageClassName: {{ . }} + {{- end }} + {{- with $value.size }} + resources: + requests: + storage: {{ . }} + {{- end }} +--- +{{- end }} diff --git a/charts/squadron-nextjs-server/templates/poddisruptionbudget.yaml b/charts/squadron-nextjs-server/templates/poddisruptionbudget.yaml new file mode 100644 index 0000000..958123e --- /dev/null +++ b/charts/squadron-nextjs-server/templates/poddisruptionbudget.yaml @@ -0,0 +1,17 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "nextjs.server.fullname" . }} + labels: {{- include "nextjs.server.labels" . | nindent 4 }} + namespace: {{ include "nextjs.server.namespace" . }} +spec: + selector: + matchLabels: {{- include "nextjs.server.selectorLabels" . | nindent 6 }} + {{- with .Values.autoscaling.minAvailable }} + minAvailable: {{ . }} + {{- end }} + {{- with .Values.autoscaling.maxUnavailable }} + maxUnavailable: {{ . }} + {{- end }} +{{- end }} diff --git a/charts/squadron-nextjs-server/templates/secret.yaml b/charts/squadron-nextjs-server/templates/secret.yaml new file mode 100644 index 0000000..321b695 --- /dev/null +++ b/charts/squadron-nextjs-server/templates/secret.yaml @@ -0,0 +1,11 @@ +{{- if .Values.secretEnv }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "nextjs.server.fullname" . }}-env + labels: {{- include "nextjs.server.labels" . | nindent 4 }} + namespace: {{ include "nextjs.server.namespace" . }} +type: Opaque +stringData: {{ toYaml .Values.secretEnv | nindent 2 }} +--- +{{- end }} diff --git a/charts/squadron-nextjs-server/templates/service.yaml b/charts/squadron-nextjs-server/templates/service.yaml new file mode 100644 index 0000000..69c8a12 --- /dev/null +++ b/charts/squadron-nextjs-server/templates/service.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "nextjs.server.fullname" . }} + labels: + {{- include "nextjs.server.labels" . | nindent 4 }} + {{- with .Values.service.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.service.annotations }} + annotations: {{- toYaml . | nindent 4 }} + {{- end }} + namespace: {{ include "nextjs.server.namespace" . }} +spec: + type: {{ .Values.service.type }} + selector: {{- include "nextjs.server.selectorLabels" . | nindent 4 }} + ports: + - name: http + port: 3000 + targetPort: 3000 + - name: prometheus + port: 9200 + targetPort: 9200 + {{- range $key, $value := .Values.ports }} + - name: {{ $key }} + port: {{ $value }} + targetPort: {{ $key }} + {{- end }} diff --git a/charts/squadron-nextjs-server/templates/serviceaccount.yaml b/charts/squadron-nextjs-server/templates/serviceaccount.yaml new file mode 100644 index 0000000..e66daec --- /dev/null +++ b/charts/squadron-nextjs-server/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "nextjs.server.serviceAccountName" . }} + labels: {{- include "nextjs.server.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: {{- toYaml . | nindent 4 }} + {{- end }} + namespace: {{ include "nextjs.server.namespace" . }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/charts/squadron-nextjs-server/templates/servicemonitor.yaml b/charts/squadron-nextjs-server/templates/servicemonitor.yaml new file mode 100644 index 0000000..3edd92b --- /dev/null +++ b/charts/squadron-nextjs-server/templates/servicemonitor.yaml @@ -0,0 +1,40 @@ +{{ if and .Values.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "nextjs.server.fullname" . }} + labels: + {{- include "nextjs.server.labels" . | nindent 4 }} + {{- with .Values.serviceMonitor.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.serviceMonitor.annotations }} + annotations: {{- toYaml . | nindent 4 }} + {{- end }} + namespace: {{ include "nextjs.server.namespace" . }} +spec: + selector: + matchLabels: + {{- include "nextjs.server.selectorLabels" . | nindent 6 }} + namespaceSelector: + matchNames: + - {{ include "nextjs.server.namespace" . }} + endpoints: + - port: prometheus + path: /metrics + {{- if .Values.serviceMonitor.interval }} + interval: {{ .Values.serviceMonitor.interval }} + {{- end }} + {{- if .Values.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }} + {{- end }} + {{- with .Values.serviceMonitor.targetLabels }} + targetLabels: {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.serviceMonitor.relabelings }} + relabelings: {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.serviceMonitor.metricRelabelings }} + metricRelabelings: {{- toYaml . | nindent 8 }} + {{- end }} +{{ end }} diff --git a/charts/squadron-nextjs-server/templates/validate.yaml b/charts/squadron-nextjs-server/templates/validate.yaml new file mode 100644 index 0000000..847658c --- /dev/null +++ b/charts/squadron-nextjs-server/templates/validate.yaml @@ -0,0 +1,7 @@ +{{- if not .Values.image.repository }} +{{- fail "Required `.Values.image.repository` not set" -}} +{{- end }} + +{{- if not .Values.image.tag }} +{{- fail "Required `.Values.image.tag` not set" -}} +{{- end }} diff --git a/charts/squadron-nextjs-server/values.schema.json b/charts/squadron-nextjs-server/values.schema.json new file mode 100644 index 0000000..497681b --- /dev/null +++ b/charts/squadron-nextjs-server/values.schema.json @@ -0,0 +1,1169 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "additionalProperties": false, + "properties": { + "autoscaling": { + "additionalProperties": false, + "description": "Autoscaling settings", + "properties": { + "additionalMetrics": { + "additionalProperties": true, + "description": "Additional scaling metrics", + "required": [], + "title": "additionalMetrics", + "type": "object" + }, + "behavior": { + "additionalProperties": true, + "description": "Autoscaling behavior settings", + "required": [], + "title": "behavior", + "type": "object" + }, + "enabled": { + "default": false, + "description": "Specifies whether a auto scaling should be enabled", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "maxReplicas": { + "default": 9, + "description": "Maximum replication number", + "required": [], + "title": "maxReplicas", + "type": "integer" + }, + "maxUnavailable": { + "default": 1, + "description": "Maximum unavailablity", + "required": [], + "title": "maxUnavailable", + "type": [ + "integer", + "string" + ] + }, + "minAvailable": { + "default": "", + "description": "Minimum availablity", + "required": [], + "title": "minAvailable", + "type": [ + "integer", + "string" + ] + }, + "minReplicas": { + "default": 1, + "description": "Minimum replication number", + "required": [], + "title": "minReplicas", + "type": "integer" + }, + "targetCPU": { + "default": 75, + "description": "Target CPU utilization", + "required": [], + "title": "targetCPU", + "type": [ + "integer", + "null" + ] + }, + "targetMemory": { + "default": "null", + "description": "Target Memory utilization", + "required": [], + "title": "targetMemory", + "type": [ + "integer", + "null" + ] + } + }, + "required": [], + "title": "autoscaling", + "type": "object" + }, + "env": { + "additionalProperties": true, + "description": "Map of environment variables to add\nenv:\n FOO: bar", + "required": [], + "title": "env", + "type": "object" + }, + "fleet": { + "default": "", + "description": "Squadron fleet name", + "required": [], + "title": "fleet", + "type": "string" + }, + "fullnameOverride": { + "default": "", + "description": "Overrides the chart's computed fullname", + "required": [], + "title": "fullnameOverride", + "type": "string" + }, + "gateway": { + "additionalProperties": false, + "description": "Foomo gateway settings", + "properties": { + "addToRobots": { + "default": "", + "description": "Robots.txt", + "required": [], + "title": "addToRobots", + "type": "string" + }, + "enabled": { + "default": false, + "description": "Indicates wether the gateway is enabled or not", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "expose": { + "description": "Expose settings", + "items": { + "required": [], + "type": "object" + }, + "required": [], + "title": "expose", + "type": "array" + }, + "sitemap": { + "default": "", + "description": "Sitemap", + "required": [], + "title": "sitemap", + "type": "string" + } + }, + "required": [], + "title": "gateway", + "type": "object" + }, + "global": { + "description": "Global values are values that can be accessed from any chart or subchart by exactly the same name.", + "required": [], + "title": "global", + "type": "object" + }, + "graceful": { + "additionalProperties": false, + "description": "Graceful shutdown settings", + "properties": { + "delaySeconds": { + "default": 15, + "description": "Seconds to wait for kubernetes to deregister", + "required": [], + "title": "delaySeconds", + "type": "integer" + }, + "enabled": { + "default": false, + "description": "Indicates wether graceful shutdown is enabled", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "periodSeconds": { + "default": 45, + "description": "Total seconds for the grace period", + "required": [], + "title": "periodSeconds", + "type": "integer" + } + }, + "required": [], + "title": "graceful", + "type": "object" + }, + "image": { + "additionalProperties": false, + "description": "Image settings", + "properties": { + "pullPolicy": { + "default": "IfNotPresent", + "description": "Image tag", + "enum": [ + "IfNotPresent", + "Always" + ], + "required": [], + "title": "pullPolicy" + }, + "pullSecrets": { + "description": "Image pull secrets", + "items": { + "required": [], + "type": "string" + }, + "required": [], + "title": "pullSecrets", + "type": "array" + }, + "recreate": { + "default": false, + "description": "Force recreation", + "required": [], + "title": "recreate", + "type": "boolean" + }, + "repository": { + "default": "", + "description": "Image repository", + "required": [], + "title": "repository", + "type": "string" + }, + "tag": { + "default": "", + "description": "Image tag", + "required": [], + "title": "tag", + "type": "string" + } + }, + "required": [ + "repository", + "tag" + ], + "title": "image", + "type": "object" + }, + "ingress": { + "additionalProperties": false, + "description": "Ingress settings", + "properties": { + "additionalLabels": { + "additionalProperties": true, + "description": "Additional labels", + "required": [], + "title": "additionalLabels", + "type": "object" + }, + "annotations": { + "additionalProperties": true, + "description": "Ingress annotations", + "properties": { + "nginx.ingress.kubernetes.io/rewrite-target": { + "default": "/$1", + "required": [], + "title": "nginx.ingress.kubernetes.io/rewrite-target", + "type": "string" + }, + "nginx.ingress.kubernetes.io/use-regex": { + "default": "true", + "required": [], + "title": "nginx.ingress.kubernetes.io/use-regex", + "type": "string" + } + }, + "required": [ + "nginx.ingress.kubernetes.io/use-regex", + "nginx.ingress.kubernetes.io/rewrite-target" + ], + "title": "annotations", + "type": "object" + }, + "className": { + "default": "", + "description": "Ingress class name", + "required": [], + "title": "className", + "type": "string" + }, + "enabled": { + "default": false, + "description": "Indicates wether the ingress is enabled or not", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "hosts": { + "description": "List of hosts", + "items": { + "required": [], + "type": "string" + }, + "required": [], + "title": "hosts", + "type": "array" + }, + "paths": { + "description": "List of hosts", + "items": { + "properties": { + "path": { + "required": [], + "type": "string" + }, + "pathType": { + "enum": [ + "ImplementationSpecific", + "Exact", + "Prefix" + ], + "required": [] + }, + "port": { + "required": [], + "type": "integer" + } + }, + "required": [], + "type": "object" + }, + "required": [], + "title": "paths", + "type": "array" + }, + "tls": { + "description": "paths:\n - path: /foo\n port: 8080\nTLS settings", + "items": { + "additionalProperties": true, + "required": [], + "type": "object" + }, + "required": [], + "title": "tls", + "type": "array" + } + }, + "required": [], + "title": "ingress", + "type": "object" + }, + "log": { + "additionalProperties": false, + "description": "Log settings", + "properties": { + "level": { + "default": "info", + "description": "Log level", + "enum": [ + "error", + "warn", + "info", + "debug" + ], + "required": [], + "title": "level" + }, + "mode": { + "default": "prod", + "description": "Log mode", + "enum": [ + "prod", + "dev" + ], + "required": [], + "title": "mode" + } + }, + "required": [], + "title": "log", + "type": "object" + }, + "nameOverride": { + "default": "", + "description": "Overrides the chart's name", + "required": [], + "title": "nameOverride", + "type": "string" + }, + "namespaceOverride": { + "default": "", + "description": "The name of the Namespace to deploy\nIf not set, `.Release.Namespace` is used", + "required": [], + "title": "namespaceOverride", + "type": "string" + }, + "networkPolicy": { + "additionalProperties": false, + "description": "NetworkPolicy configuration", + "properties": { + "egress": { + "additionalProperties": false, + "description": "Egress settings", + "properties": { + "additionalRules": { + "description": "Additional egress rules", + "items": { + "required": [], + "type": "string" + }, + "required": [], + "title": "additionalRules", + "type": "array" + }, + "allowExternal": { + "default": true, + "description": "Allow ingress through labels", + "required": [], + "title": "allowExternal", + "type": "boolean" + }, + "enabled": { + "default": true, + "description": "Specifies whether egress should be enabled", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [], + "title": "egress", + "type": "object" + }, + "enabled": { + "default": false, + "description": "Specifies whether Network Policies should be created", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "ingress": { + "additionalProperties": false, + "description": "rules:\n - allow-nginx-ingress\n - allow-internet-egress\n - allow-my-service-access\nIngress settings", + "properties": { + "additionalRules": { + "description": "Additional ingress rules", + "items": { + "additionalProperties": true, + "required": [], + "type": "string" + }, + "required": [], + "title": "additionalRules", + "type": "array" + }, + "allowExternal": { + "default": true, + "description": "Allow ingress through labels", + "required": [], + "title": "allowExternal", + "type": "boolean" + }, + "enabled": { + "default": true, + "description": "Specifies whether ingress should be enabled", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [], + "title": "ingress", + "type": "object" + }, + "rules": { + "items": { + "required": [], + "type": "string" + }, + "required": [], + "title": "rules", + "type": "array" + } + }, + "required": [], + "title": "networkPolicy", + "type": "object" + }, + "otel": { + "additionalProperties": false, + "description": "OpenTelemetry settings", + "properties": { + "enabled": { + "default": false, + "description": "Indicates wether to enable it or not", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "gorm": { + "additionalProperties": false, + "description": "GORM settings", + "properties": { + "enabled": { + "default": true, + "required": [], + "title": "enabled", + "type": "boolean" + }, + "sqlParametersDisabled": { + "default": true, + "description": "Indicates wether to trace sql attributes", + "required": [], + "title": "sqlParametersDisabled", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "gorm", + "type": "object" + }, + "gotsrpc": { + "additionalProperties": false, + "description": "GOTSRPC settings", + "properties": { + "enabled": { + "default": true, + "description": "Indicates wether to enable it or not", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "payloadAttributeDisabled": { + "default": true, + "description": "Indicates wether to trace payload attributes", + "required": [], + "title": "payloadAttributeDisabled", + "type": "boolean" + } + }, + "required": [], + "title": "gotsrpc", + "type": "object" + }, + "mongo": { + "additionalProperties": false, + "description": "Mongo settings", + "properties": { + "commandAttributeDisabled": { + "default": true, + "description": "Indicates wether to trace command attributes", + "required": [], + "title": "commandAttributeDisabled", + "type": "boolean" + }, + "enabled": { + "default": true, + "description": "Indicates wether to enable it or not", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [], + "title": "mongo", + "type": "object" + }, + "otlp": { + "additionalProperties": false, + "description": "OTLP exporter settings", + "properties": { + "endpoint": { + "default": "alloy:4317", + "description": "Enpoint uri", + "required": [], + "title": "endpoint", + "type": "string" + }, + "insecure": { + "default": true, + "description": "Indicates wether to use insecure connection", + "required": [], + "title": "insecure", + "type": "boolean" + } + }, + "required": [], + "title": "otlp", + "type": "object" + }, + "ratio": { + "default": 1, + "description": "Trace ratio", + "required": [], + "title": "ratio", + "type": "integer" + } + }, + "required": [], + "title": "otel", + "type": "object" + }, + "persistence": { + "additionalProperties": false, + "description": "Persistence settings", + "properties": { + "accessMode": { + "default": "ReadWriteOnce", + "description": "Access mode", + "enum": [ + "ReadWriteOnce", + "ReadOnlyMany", + "ReadWriteMany" + ], + "required": [], + "title": "accessMode" + }, + "enabled": { + "default": false, + "description": "Indicates wether a pv should be attached or not", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "mountPath": { + "default": "/var/lib/server/data", + "description": "Storage mount path", + "required": [], + "title": "mountPath", + "type": "string" + }, + "size": { + "default": "1Gi", + "description": "Storage size", + "required": [], + "title": "size", + "type": "string" + }, + "storageClass": { + "default": "", + "description": "Storage class name", + "required": [], + "title": "storageClass", + "type": "string" + } + }, + "required": [], + "title": "persistence", + "type": "object" + }, + "rbac": { + "additionalProperties": false, + "description": "RBAC configuration", + "properties": { + "enabled": { + "default": false, + "description": "Create PodSecurityPolicy.", + "required": [], + "title": "enabled", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "rbac", + "type": "object" + }, + "replicas": { + "default": 1, + "description": "Number of replications", + "required": [], + "title": "replicas", + "type": "number" + }, + "revisionHistoryLimit": { + "default": 10, + "description": "Number of revisions to keep", + "required": [], + "title": "revisionHistoryLimit", + "type": "integer" + }, + "scheduling": { + "additionalProperties": false, + "description": "Scheduling settings", + "properties": { + "affinity": { + "additionalProperties": true, + "description": "Affinity for pod assignment", + "required": [], + "title": "affinity", + "type": "object" + }, + "enabled": { + "default": false, + "description": "Indicates wether scheduling is enabled or not", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "nodeSelector": { + "additionalProperties": true, + "description": "Node labels for pod assignment", + "required": [], + "title": "nodeSelector", + "type": "object" + }, + "priorityClass": { + "additionalProperties": true, + "default": "null", + "required": [], + "title": "priorityClass", + "type": [ + "string", + "null" + ] + }, + "tolerations": { + "description": "Tolerations for pod assignment", + "items": { + "additionalProperties": true, + "required": [], + "type": "object" + }, + "required": [], + "title": "tolerations", + "type": "array" + } + }, + "required": [], + "title": "scheduling", + "type": "object" + }, + "secretEnv": { + "additionalProperties": true, + "description": "Map of environment variables to add as a secret", + "required": [], + "title": "secretEnv", + "type": "object" + }, + "secretMounts": { + "description": "secretEnv:\n FOO: bar", + "items": { + "required": [], + "type": "string" + }, + "required": [], + "title": "secretMounts", + "type": "array" + }, + "securityContext": { + "additionalProperties": false, + "description": "Security context", + "properties": { + "fsGroup": { + "default": 10001, + "description": "File system group id", + "required": [], + "title": "fsGroup", + "type": "integer" + }, + "runAsGroup": { + "default": 10001, + "description": "Run as group id", + "required": [], + "title": "runAsGroup", + "type": "integer" + }, + "runAsNonRoot": { + "default": true, + "description": "Indicates wether to run as non root user", + "required": [], + "title": "runAsNonRoot", + "type": "boolean" + }, + "runAsUser": { + "default": 10001, + "description": "Run as user id", + "required": [], + "title": "runAsUser", + "type": "integer" + } + }, + "required": [], + "title": "securityContext", + "type": "object" + }, + "server": { + "additionalProperties": false, + "description": "Server settings", + "properties": { + "additionalEnv": { + "description": "Additional environment variables", + "items": { + "additionalProperties": true, + "properties": { + "name": { + "required": [], + "type": "string" + }, + "value": { + "required": [], + "type": "string" + } + }, + "required": [], + "type": "object" + }, + "required": [], + "title": "additionalEnv", + "type": "array" + }, + "additionalEnvFrom": { + "description": "Additional env from", + "items": { + "additionalProperties": true, + "required": [], + "type": "object" + }, + "required": [], + "title": "additionalEnvFrom", + "type": "array" + }, + "additionalLabels": { + "additionalProperties": true, + "description": "Additional labels", + "required": [], + "title": "additionalLabels", + "type": "object" + }, + "additionalPorts": { + "description": "Additional ports", + "items": { + "additionalProperties": true, + "required": [], + "type": "object" + }, + "required": [], + "title": "additionalPorts", + "type": "array" + }, + "additionalVolumeMounts": { + "description": "Additional volume mounts", + "items": { + "additionalProperties": true, + "properties": { + "mountPath": { + "required": [], + "type": "string" + }, + "name": { + "required": [], + "type": "string" + } + }, + "required": [], + "type": "object" + }, + "required": [], + "title": "additionalVolumeMounts", + "type": "array" + }, + "additionalVolumes": { + "description": "Additional volumes", + "items": { + "additionalProperties": true, + "required": [], + "type": "object" + }, + "required": [], + "title": "additionalVolumes", + "type": "array" + }, + "annotations": { + "additionalProperties": true, + "description": "Deployment annotations", + "required": [], + "title": "annotations", + "type": "object" + }, + "hostAliases": { + "description": "additionalVolumes:\n my-volume:\n name: my-existing-volume-name\n storageClass: local-path\nHost aliases", + "items": { + "additionalProperties": true, + "required": [], + "type": "object" + }, + "required": [], + "title": "hostAliases", + "type": "array" + }, + "livenessProbe": { + "additionalProperties": true, + "description": "Liveness probe settings", + "properties": { + "tcpSocket": { + "additionalProperties": false, + "properties": { + "port": { + "default": 3000, + "required": [], + "title": "port", + "type": "integer" + } + }, + "required": [ + "port" + ], + "title": "tcpSocket", + "type": "object" + } + }, + "required": [ + "tcpSocket" + ], + "title": "livenessProbe", + "type": [ + "object", + "null" + ] + }, + "podAnnotations": { + "additionalProperties": true, + "description": "Pod annotations", + "required": [], + "title": "podAnnotations", + "type": "object" + }, + "readinessProbe": { + "additionalProperties": true, + "description": "Readiness probe settings", + "properties": { + "tcpSocket": { + "additionalProperties": false, + "properties": { + "port": { + "default": 3000, + "required": [], + "title": "port", + "type": "integer" + } + }, + "required": [ + "port" + ], + "title": "tcpSocket", + "type": "object" + } + }, + "required": [ + "tcpSocket" + ], + "title": "readinessProbe", + "type": [ + "object", + "null" + ] + }, + "resources": { + "additionalProperties": true, + "description": "Resource settings", + "required": [], + "title": "resources", + "type": [ + "object", + "null" + ] + }, + "startupProbe": { + "additionalProperties": true, + "description": "Startup probe settings", + "properties": { + "tcpSocket": { + "additionalProperties": false, + "properties": { + "port": { + "default": 3000, + "required": [], + "title": "port", + "type": "integer" + } + }, + "required": [ + "port" + ], + "title": "tcpSocket", + "type": "object" + } + }, + "required": [ + "tcpSocket" + ], + "title": "startupProbe", + "type": [ + "object", + "null" + ] + } + }, + "required": [], + "title": "server", + "type": "object" + }, + "service": { + "additionalProperties": false, + "description": "Service settings", + "properties": { + "additionalLabels": { + "additionalProperties": true, + "description": "Additional Service labels", + "required": [], + "title": "additionalLabels", + "type": "object" + }, + "annotations": { + "additionalProperties": true, + "description": "Service annotations", + "required": [], + "title": "annotations", + "type": "object" + }, + "type": { + "default": "ClusterIP", + "description": "Service type", + "required": [], + "title": "type", + "type": "string" + } + }, + "required": [], + "title": "service", + "type": "object" + }, + "serviceAccount": { + "additionalProperties": false, + "description": "ServiceAccount configuration", + "properties": { + "annotations": { + "additionalProperties": true, + "description": "Annotations to add to the service account", + "required": [], + "title": "annotations", + "type": "object" + }, + "automount": { + "default": true, + "description": "Automatically mount a ServiceAccount's API credentials?", + "required": [], + "title": "automount", + "type": "boolean" + }, + "create": { + "default": true, + "description": "Specifies whether a service account should be created", + "required": [], + "title": "create", + "type": "boolean" + }, + "name": { + "default": "", + "description": "The name of the service account to use.\nIf not set and create is true, a name is generated using the fullname template", + "required": [], + "title": "name", + "type": "string" + } + }, + "required": [], + "title": "serviceAccount", + "type": "object" + }, + "serviceMonitor": { + "additionalProperties": false, + "description": "ServiceMonitor configuration", + "properties": { + "additionalLabels": { + "additionalProperties": true, + "description": "Additional ServiceMonitor labels", + "required": [], + "title": "additionalLabels", + "type": "object" + }, + "annotations": { + "additionalProperties": true, + "description": "ServiceMonitor annotations", + "required": [], + "title": "annotations", + "type": "object" + }, + "enabled": { + "default": false, + "description": "If enabled, ServiceMonitor resources for Prometheus Operator are created", + "required": [], + "title": "enabled", + "type": "boolean" + }, + "interval": { + "default": "", + "description": "ServiceMonitor scrape interval", + "required": [], + "title": "interval", + "type": "string" + }, + "metricRelabelings": { + "description": "ServiceMonitor metric relabel configs to apply to samples before ingestion", + "items": { + "additionalProperties": true, + "required": [], + "type": "object" + }, + "required": [], + "title": "metricRelabelings", + "type": "array" + }, + "relabelings": { + "description": "ServiceMonitor relabel configs to apply to samples before scraping.", + "items": { + "additionalProperties": true, + "required": [], + "type": "object" + }, + "required": [], + "title": "relabelings", + "type": "array" + }, + "scrapeTimeout": { + "default": "", + "description": "ServiceMonitor scrape timeout in Go duration format (e.g. 15s)", + "required": [], + "title": "scrapeTimeout", + "type": "string" + }, + "targetLabels": { + "description": "ServiceMonitor will add labels from the service to the Prometheus metric", + "items": { + "additionalProperties": true, + "required": [], + "type": "object" + }, + "required": [], + "title": "targetLabels", + "type": "array" + } + }, + "required": [], + "title": "serviceMonitor", + "type": "object" + }, + "squadron": { + "default": "", + "description": "Squadron name", + "required": [], + "title": "squadron", + "type": "string" + }, + "unit": { + "default": "", + "description": "Squadron unit name", + "required": [], + "title": "unit", + "type": "string" + }, + "updateStrategy": { + "default": "RollingUpdate", + "description": "Deployment update strategy", + "enum": [ + "RollingUpdate", + "Recreate" + ], + "required": [], + "title": "updateStrategy" + } + }, + "required": [ + "networkPolicy" + ], + "type": "object" +} \ No newline at end of file diff --git a/charts/squadron-nextjs-server/values.yaml b/charts/squadron-nextjs-server/values.yaml new file mode 100644 index 0000000..3ae40e8 --- /dev/null +++ b/charts/squadron-nextjs-server/values.yaml @@ -0,0 +1,762 @@ +# yaml-language-server: $schema=values.schema.json + +# @schema +# type: string +# @schema +# -- Overrides the chart's name +nameOverride: '' +# @schema +# type: string +# @schema +# -- Overrides the chart's computed fullname +fullnameOverride: '' +# @schema +# type: string +# @schema +# -- The name of the Namespace to deploy +# -- If not set, `.Release.Namespace` is used +namespaceOverride: '' +# @schema +# type: integer +# @schema +# -- Number of revisions to keep +revisionHistoryLimit: 10 + +# @schema +# type: string +# @schema +# -- Squadron fleet name +fleet: '' +# @schema +# type: string +# @schema +# -- Squadron name +squadron: '' +# @schema +# type: string +# @schema +# -- Squadron unit name +unit: '' + +# @schema +# type: object +# @schema +# -- Log settings +log: + # @schema + # enum: [prod, dev] + # @schema + # -- Log mode + mode: prod + # @schema + # enum: [error, warn, info, debug] + # @schema + # -- Log level + level: info + +# @schema +# type: object +# @schema +# -- OpenTelemetry settings +otel: + # @schema + # type: boolean + # @schema + # -- Indicates wether to enable it or not + enabled: false + # @schema + # type: integer + # @schema + # -- Trace ratio + ratio: 1 + # @schema + # type: object + # @schema + # -- OTLP exporter settings + otlp: + # @schema + # type: boolean + # @schema + # -- Indicates wether to use insecure connection + insecure: true + # @schema + # type: string + # @schema + # -- Enpoint uri + endpoint: 'alloy:4317' + # @schema + # type: object + # @schema + # -- GORM settings + gorm: + enabled: true + # @schema + # type: boolean + # @schema + # -- Indicates wether to trace sql attributes + sqlParametersDisabled: true + # @schema + # type: object + # @schema + # -- Mongo settings + mongo: + # @schema + # type: boolean + # @schema + # -- Indicates wether to enable it or not + enabled: true + # @schema + # type: boolean + # @schema + # -- Indicates wether to trace command attributes + commandAttributeDisabled: true + # @schema + # type: object + # @schema + # -- GOTSRPC settings + gotsrpc: + # @schema + # type: boolean + # @schema + # -- Indicates wether to enable it or not + enabled: true + # @schema + # type: boolean + # @schema + # -- Indicates wether to trace payload attributes + payloadAttributeDisabled: true + +# @schema +# type: object +# @schema +# -- Image settings +image: + # @schema + # type: boolean + # @schema + # -- Force recreation + recreate: false + # @schema + # enum: [IfNotPresent, Always] + # @schema + # -- Image tag + pullPolicy: IfNotPresent + # @schema + # type: array + # items: + # type: string + # @schema + # -- Image pull secrets + pullSecrets: [ ] + # @schema + # type: string + # required: true + # @schema + # -- Image repository + repository: '' + # @schema + # type: string + # required: true + # @schema + # -- Image tag + tag: '' + +# @schema +# type: object +# additionalProperties: true +# @schema +# -- Map of environment variables to add +# -- env: +# -- FOO: bar +env: { } +# @schema +# type: object +# additionalProperties: true +# @schema +# -- Map of environment variables to add as a secret +secretEnv: { } +# secretEnv: +# FOO: bar +# @schema +# type: array +# items: +# type: string +# @schema +secretMounts: [] +# secretMounts: +# - my-secret + +# @schema +# type: object +# @schema +# -- Ingress settings +ingress: + # @schema + # type: boolean + # @schema + # -- Indicates wether the ingress is enabled or not + enabled: false + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Additional labels + additionalLabels: { } + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Ingress annotations + annotations: + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: /$1 + # @schema + # type: string + # @schema + # -- Ingress class name + className: '' + # @schema + # type: array + # items: + # type: string + # @schema + # -- List of hosts + hosts: [ ] + # @schema + # type: array + # items: + # type: object + # properties: + # path: + # type: string + # port: + # type: integer + # pathType: + # enum: [ImplementationSpecific, Exact, Prefix] + # @schema + # -- List of hosts + paths: [ ] + # paths: + # - path: /foo + # port: 8080 + # @schema + # type: array + # items: + # type: object + # additionalProperties: true + # @schema + # -- TLS settings + tls: [ ] + # tls: + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +# @schema +# type: object +# @schema +# -- Persistence settings +persistence: + # @schema + # type: boolean + # @schema + # -- Indicates wether a pv should be attached or not + enabled: false + # @schema + # type: string + # @schema + # -- Storage mount path + mountPath: /var/lib/server/data + # @schema + # enum: [ReadWriteOnce, ReadOnlyMany, ReadWriteMany] + # @schema + # -- Access mode + accessMode: ReadWriteOnce + # @schema + # type: string + # @schema + # -- Storage size + size: 1Gi + # @schema + # type: string + # @schema + # -- Storage class name + storageClass: '' + +# @schema +# type: object +# @schema +# -- Service settings +service: + # @schema + # type: string + # @schema + # -- Service type + type: ClusterIP + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Additional Service labels + additionalLabels: { } + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Service annotations + annotations: { } + +# @schema +# type: object +# @schema +# -- Security context +securityContext: + # @schema + # type: integer + # @schema + # -- Run as user id + runAsUser: 10001 + # @schema + # type: integer + # @schema + # -- Run as group id + runAsGroup: 10001 + # @schema + # type: integer + # @schema + # -- File system group id + fsGroup: 10001 + # @schema + # type: boolean + # @schema + # -- Indicates wether to run as non root user + runAsNonRoot: true + +# @schema +# enum: [RollingUpdate, Recreate] +# @schema +# -- Deployment update strategy +updateStrategy: RollingUpdate + +# @schema +# type: number +# @schema +# -- Number of replications +replicas: 1 + +# @schema +# type: object +# @schema +# -- Server settings +server: + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Additional labels + additionalLabels: { } + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Deployment annotations + annotations: { } + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Pod annotations + podAnnotations: { } + # @schema + # type: array + # items: + # type: object + # properties: + # name: + # type: string + # value: + # type: string + # additionalProperties: true + # @schema + # -- Additional environment variables + additionalEnv: [ ] + # @schema + # type: array + # items: + # type: object + # additionalProperties: true + # @schema + # -- Additional env from + additionalEnvFrom: [ ] + # @schema + # type: array + # items: + # type: object + # properties: + # name: + # type: string + # mountPath: + # type: string + # additionalProperties: true + # @schema + # -- Additional volume mounts + additionalVolumeMounts: [ ] + # @schema + # type: array + # items: + # type: object + # additionalProperties: true + # @schema + # -- Additional volumes + additionalVolumes: [ ] + # additionalVolumes: + # my-volume: + # name: my-existing-volume-name + # storageClass: local-path + # @schema + # type: array + # items: + # type: object + # additionalProperties: true + # @schema + # -- Host aliases + hostAliases: [ ] + # @schema + # type: array + # items: + # type: object + # additionalProperties: true + # @schema + # -- Additional ports + additionalPorts: [ ] + # @schema + # type: [object, null] + # additionalProperties: true + # @schema + # -- Resource settings + resources: {} + # @schema + # type: [object, null] + # additionalProperties: true + # @schema + # -- Startup probe settings + startupProbe: + tcpSocket: + port: 3000 + # @schema + # type: [object, null] + # additionalProperties: true + # @schema + # -- Readiness probe settings + readinessProbe: + tcpSocket: + port: 3000 + # @schema + # type: [object, null] + # additionalProperties: true + # @schema + # -- Liveness probe settings + livenessProbe: + tcpSocket: + port: 3000 + +# @schema +# type: object +# @schema +# -- Autoscaling settings +autoscaling: + # @schema + # type: boolean + # @schema + # -- Specifies whether a auto scaling should be enabled + enabled: false + # @schema + # type: integer + # @schema + # -- Minimum replication number + minReplicas: 1 + # @schema + # type: integer + # @schema + # -- Maximum replication number + maxReplicas: 9 + # @schema + # type: [integer, string] + # @schema + # Minimum availablity + minAvailable: '' + # @schema + # type: [integer, string] + # @schema + # Maximum unavailablity + maxUnavailable: 1 + # @schema + # type: [integer, null] + # @schema + # -- Target CPU utilization + targetCPU: 75 + # @schema + # type: [integer, null] + # @schema + # -- Target Memory utilization + targetMemory: null + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Additional scaling metrics + additionalMetrics: { } + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Autoscaling behavior settings + behavior: { } + +# @schema +# type: object +# @schema +# ServiceAccount configuration +serviceAccount: + # @schema + # type: string + # @schema + # -- The name of the service account to use. + # -- If not set and create is true, a name is generated using the fullname template + name: "" + # @schema + # type: boolean + # @schema + # -- Specifies whether a service account should be created + create: true + # @schema + # type: boolean + # @schema + # -- Automatically mount a ServiceAccount's API credentials? + automount: true + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Annotations to add to the service account + annotations: { } + +# @schema +# type: object +# @schema +# -- ServiceMonitor configuration +serviceMonitor: + # @schema + # type: boolean + # @schema + # -- If enabled, ServiceMonitor resources for Prometheus Operator are created + enabled: false + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Additional ServiceMonitor labels + additionalLabels: { } + # @schema + # type: object + # additionalProperties: true + # @schema + # -- ServiceMonitor annotations + annotations: { } + # @schema + # type: string + # @schema + # -- ServiceMonitor scrape interval + interval: '' + # @schema + # type: string + # @schema + # -- ServiceMonitor scrape timeout in Go duration format (e.g. 15s) + scrapeTimeout: '' + # @schema + # type: array + # items: + # type: object + # additionalProperties: true + # @schema + # -- ServiceMonitor will add labels from the service to the Prometheus metric + targetLabels: [ ] + # @schema + # type: array + # items: + # type: object + # additionalProperties: true + # @schema + # -- ServiceMonitor relabel configs to apply to samples before scraping. + relabelings: [ ] + # @schema + # type: array + # items: + # type: object + # additionalProperties: true + # @schema + # -- ServiceMonitor metric relabel configs to apply to samples before ingestion + metricRelabelings: [ ] + +# NetworkPolicy configuration +networkPolicy: + # @schema + # type: boolean + # @schema + # -- Specifies whether Network Policies should be created + enabled: false + # @schema + # type: array + # items: + # type: string + # @schema + rules: [] + # rules: + # - allow-nginx-ingress + # - allow-internet-egress + # - allow-my-service-access + # @schema + # type: object + # @schema + # -- Ingress settings + ingress: + # @schema + # type: boolean + # @schema + # -- Specifies whether ingress should be enabled + enabled: true + # @schema + # type: boolean + # @schema + # -- Allow ingress through labels + allowExternal: true + # @schema + # type: array + # items: + # type: string + # additionalProperties: true + # @schema + # -- Additional ingress rules + additionalRules: [] + # @schema + # type: object + # @schema + # -- Egress settings + egress: + # @schema + # type: boolean + # @schema + # -- Specifies whether egress should be enabled + enabled: true + # @schema + # type: boolean + # @schema + # -- Allow ingress through labels + allowExternal: true + # @schema + # type: array + # items: + # type: string + # @schema + # -- Additional egress rules + additionalRules: [] + +# @schema +# type: object +# @schema +# -- Graceful shutdown settings +graceful: + # @schema + # type: boolean + # @schema + # -- Indicates wether graceful shutdown is enabled + enabled: false + # @schema + # type: integer + # @schema + # -- Seconds to wait for kubernetes to deregister + delaySeconds: 15 + # @schema + # type: integer + # @schema + # -- Total seconds for the grace period + periodSeconds: 45 + +# @schema +# type: object +# @schema +# -- Scheduling settings +scheduling: + # @schema + # type: boolean + # @schema + # -- Indicates wether scheduling is enabled or not + enabled: false + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Affinity for pod assignment + affinity: {} + # @schema + # type: object + # additionalProperties: true + # @schema + # -- Node labels for pod assignment + nodeSelector: {} + # @schema + # type: array + # items: + # type: object + # additionalProperties: true + # @schema + # -- Tolerations for pod assignment + tolerations: [] + # @schema + # type: [string, null] + # additionalProperties: true + # @schema + priorityClass: null + +# @schema +# type: object +# @schema +# -- Foomo gateway settings +gateway: + # @schema + # type: boolean + # @schema + # -- Indicates wether the gateway is enabled or not + enabled: false + # @schema + # type: string + # @schema + # -- Sitemap + sitemap: '' + # @schema + # type: string + # @schema + # -- Robots.txt + addToRobots: '' + # @schema + # type: array + # items: + # type: object + # additionProperties: true + # @schema + # -- Expose settings + expose: [] + # expose: + # - stripBasePath: true + # cmsMimetypes: + # - application/x-page + # - application/x-folder + # - application/x-shortcut + +# @schema +# type: object +# @schema +# -- RBAC configuration +rbac: + # -- Create PodSecurityPolicy. + enabled: false