This commit is contained in:
2025-11-17 18:45:35 +01:00
parent 0f58e3bdff
commit 14d6f9aa73
7607 changed files with 1969407 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "lowcoder.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 "lowcoder.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts.
*/}}
{{- define "lowcoder.namespace" -}}
{{- if .Values.global -}}
{{- if .Values.global.namespaceOverride }}
{{- .Values.global.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end }}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "lowcoder.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "lowcoder.labels" -}}
helm.sh/chart: {{ include "lowcoder.chart" . }}
{{ include "lowcoder.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "lowcoder.selectorLabels" -}}
{{- $name := include "lowcoder.name" . -}}
{{- $componentName := .component | default "" -}}
{{- if ne $componentName "" -}}
app.kubernetes.io/name: {{ $name }}-{{ $componentName }}
{{- else -}}
app.kubernetes.io/name: {{ $name }}
{{- end }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "lowcoder.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "lowcoder.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,66 @@
{{- $nameSpace := include "lowcoder.namespace" . -}}
{{- $name := include "lowcoder.fullname" . -}}
{{- $lowcoderDatabase := first .Values.mongodb.auth.databases -}}
{{- $redisSecret := lookup "v1" "Secret" $nameSpace .Values.redis.auth.existingSecret | default dict -}}
{{- $redisPassword := (index ($redisSecret.data|default dict) .Values.redis.auth.existingSecretPasswordKey | default "" | b64dec) -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "lowcoder.fullname" . }}-api-service
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
{{- if .Values.redis.enabled }}
{{- if .Values.redis.auth.enabled }}
LOWCODER_REDIS_URL: "redis://{{ $redisPassword }}@{{ $name }}-redis-master.{{ $nameSpace }}.svc.cluster.local:6379"
{{- else }}
LOWCODER_REDIS_URL: "redis://{{ $name }}-redis-master.{{ $nameSpace }}.svc.cluster.local:6379"
{{- end }}
{{- else }}
{{- if .Values.redis.auth.enabled }}
LOWCODER_REDIS_URL: "redis://{{ $redisPassword }}@{{ .Values.redis.externalUrl }}"
{{- else }}
LOWCODER_REDIS_URL: "redis://{{ .Values.redis.externalUrl }}"
{{- end }}
{{- end }}
{{- if .Values.global.config.nodeServiceUrl }}
LOWCODER_NODE_SERVICE_URL: {{ .Values.global.config.nodeServiceUrl | quote }}
{{- else }}
LOWCODER_NODE_SERVICE_URL: "http://{{ $name }}-node-service:{{ .Values.nodeService.service.port }}"
{{- end }}
LOWCODER_PUID: {{ .Values.global.config.userId | default "9001" | quote }}
LOWCODER_PGID: {{ .Values.global.config.groupId | default "9001" | quote }}
LOWCODER_CORS_DOMAINS: {{ .Values.global.config.corsAllowedDomains | default "*" | quote }}
LOWCODER_EMAIL_AUTH_ENABLED: {{ .Values.global.config.enableEmailAuth | default "true" | quote }}
LOWCODER_EMAIL_SIGNUP_ENABLED: {{ .Values.global.config.enableUserSignUp | default "true" | quote }}
LOWCODER_EMAIL_NOTIFICATIONS_SENDER: {{ .Values.global.config.emailNotificationSender | default "info@localhost" | quote }}
LOWCODER_MAX_QUERY_TIMEOUT: {{ .Values.global.config.maxQueryTimeout | default "120" | quote }}
LOWCODER_MAX_REQUEST_SIZE: {{ .Values.global.config.maxRequestSize | default "20m" | quote }}
LOWCODER_MAX_ORGS_PER_USER: {{ .Values.global.defaults.maxOrgsPerUser | default "100" | quote }}
LOWCODER_MAX_MEMBERS_PER_ORG: {{ .Values.global.defaults.maxMembersPerOrg | default "1000" | quote }}
LOWCODER_MAX_GROUPS_PER_ORG: {{ .Values.global.defaults.maxGroupsPerOrg | default "100" | quote }}
LOWCODER_MAX_APPS_PER_ORG: {{ .Values.global.defaults.maxAppsPerOrg | default "1000" | quote }}
LOWCODER_MAX_DEVELOPERS: {{ .Values.global.defaults.maxDevelopers | default "50" | quote }}
LOWCODER_DEFAULT_QUERY_TIMEOUT: {{ .Values.global.defaults.queryTimeout | default "10" | quote }}
LOWCODER_WORKSPACE_MODE: {{ .Values.global.config.workspaceMode | default "SAAS" | quote }}
LOWCODER_CREATE_WORKSPACE_ON_SIGNUP: {{ .Values.global.config.createWorkspaceOnSignup | default "true" | quote }}
LOWCODER_ADMIN_SMTP_HOST: {{ .Values.global.mailServer.host | default "localhost" | quote }}
LOWCODER_ADMIN_SMTP_PORT: {{ .Values.global.mailServer.port | default "578" | quote }}
LOWCODER_ADMIN_SMTP_AUTH: {{ .Values.global.mailServer.smtpAuth | default "false" | quote }}
LOWCODER_ADMIN_SMTP_USERNAME: {{ .Values.global.mailServer.authUsername | default "" | quote }}
LOWCODER_ADMIN_SMTP_PASSWORD: {{ .Values.global.mailServer.authPassword | default "" | quote }}
LOWCODER_ADMIN_SMTP_SSL_ENABLED: {{ .Values.global.mailServer.useSSL | default "false" | quote }}
LOWCODER_ADMIN_SMTP_STARTTLS_ENABLED: {{ .Values.global.mailServer.useStartTLS | default "true" | quote }}
LOWCODER_ADMIN_SMTP_STARTTLS_REQUIRED: {{ .Values.global.mailServer.requireStartTLS | default "true" | quote }}
LOWCODER_API_RATE_LIMIT: {{ .Values.global.defaults.apiRateLimit | default "100" | quote }}
LOWCODER_APP_SNAPSHOT_RETENTIONTIME: {{ .Values.global.config.snapshotRetentionTime | default "30" | quote }}
LOWCODER_COOKIE_NAME: {{ .Values.global.cookie.name | default "LOWCODER_CE_SELFHOST_TOKEN" | quote }}
LOWCODER_COOKIE_MAX_AGE: {{ .Values.global.cookie.maxAge | default "24" | quote }}
LOWCODER_MARKETPLACE_PRIVATE_MODE: {{ .Values.global.config.marketplacePrivateMode | default "true" | quote }}
LOWCODER_PLUGINS_DIR: {{ .Values.global.plugins.folder | default "/plugins" | quote }}
LOWCODER_PUBLIC_URL: {{ .Values.global.config.publicUrl | default "https://somedomain.com/" | quote }}

View File

@@ -0,0 +1,84 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "lowcoder.fullname" . }}-api-service
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
spec:
{{- if not .Values.apiService.autoscaling.enabled }}
replicas: {{ .Values.apiService.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "lowcoder.selectorLabels" (dict "component" "api-service" "Values" .Values "Release" .Release "Chart" .Chart) | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "lowcoder.selectorLabels" (dict "component" "api-service" "Values" .Values "Release" .Release "Chart" .Chart) | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "lowcoder.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.mongodb.enabled }}
initContainers:
- name: {{ .Chart.Name }}-wait-for-mongo
image: curlimages/curl:7.87.0
command:
- /bin/sh
args:
- -ec
- |
echo "Wait for mongo database to be ready"
while [[ $(curl --connect-timeout 2 -sw '%{http_code}' 'http://{{ .Values.mongodb.service.nameOverride }}:27017' -o /dev/null) -ne 200 ]]; do
sleep 1;
echo ' still waiting...';
done;
echo 'Connection with MongoDB established.'
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.apiService.image.repository }}:{{ .Values.apiService.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.apiService.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ include "lowcoder.fullname" . }}-api-service
- secretRef:
name: {{ include "lowcoder.fullname" . }}-api-service
ports:
- name: lowcoder-api
containerPort: 8080
protocol: TCP
livenessProbe:
initialDelaySeconds: 30
httpGet:
path: /api/status/health
port: lowcoder-api
readinessProbe:
initialDelaySeconds: 30
httpGet:
path: /api/status/health
port: lowcoder-api
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,32 @@
{{- if .Values.apiService.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "lowcoder.fullname" . }}-api-service
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "lowcoder.fullname" . }}-api-service
minReplicas: {{ .Values.apiService.autoscaling.minReplicas }}
maxReplicas: {{ .Values.apiService.autoscaling.maxReplicas }}
metrics:
{{- if .Values.apiService.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.apiService.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.apiService.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.apiService.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,36 @@
{{- $nameSpace := include "lowcoder.namespace" . -}}
{{- $mongoUser := (and .Values.mongodb.auth.usernames (first .Values.mongodb.auth.usernames)) | default "" -}}
{{- $mongoPassword := (and .Values.mongodb.auth.passwords (first .Values.mongodb.auth.passwords)) | default "" -}}
{{- $mongoProtocol := ternary "mongodb+srv" "mongodb" .Values.mongodb.useSrv -}}
{{- $mongoSSL := ternary "true" "false" .Values.mongodb.useSSL -}}
{{- $lowcoderDatabase := first .Values.mongodb.auth.databases -}}
{{- $mongoSecret := lookup "v1" "Secret" $nameSpace .Values.mongodb.auth.existingSecret | default dict -}}
{{- $mongoSecretPassword := (index ($mongoSecret.data | default dict) "password" | default "" | b64dec) -}}
{{- $mongoServicename := .Values.mongodb.service.nameOverride | default "" -}}
{{- $externalUrl := .Values.mongodb.service.externalUrl -}}
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ include "lowcoder.fullname" . }}-api-service
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
stringData:
{{- if .Values.mongodb.enabled }}
LOWCODER_MONGODB_URL: "{{ $mongoProtocol }}://{{ $mongoUser }}:{{ $mongoPassword }}@{{ $mongoServicename }}.{{ $nameSpace }}.svc.cluster.local/{{ $lowcoderDatabase }}?retryWrites=true&ssl=false"
{{- else }}
LOWCODER_MONGODB_URL: "{{ $mongoProtocol }}://{{ $mongoUser }}:{{ $mongoSecretPassword }}@{{ $externalUrl }}/{{ $lowcoderDatabase }}?retryWrites=true&ssl={{ $mongoSSL }}"
{{- end }}
LOWCODER_DB_ENCRYPTION_PASSWORD: {{ .Values.global.config.encryption.password | default "lowcoder.org" | quote }}
LOWCODER_DB_ENCRYPTION_SALT: {{ .Values.global.config.encryption.salt | default "lowcoder.org" | quote }}
LOWCODER_API_KEY_SECRET: "{{ .Values.global.config.apiKeySecret }}"
LOWCODER_SUPERUSER_USERNAME: {{ .Values.global.config.superuser.username | default "admin@localhost" | quote }}
LOWCODER_SUPERUSER_PASSWORD: {{ .Values.global.config.superuser.password | default "" | quote }}
LOWCODER_NODE_SERVICE_SECRET: {{ .values.global.config.nodeServiceSecret | default "62e348319ab9f5c43c3b5a380b4d82525cdb68740f21140e767989b509ab0aa2" | quote }}
LOWCODER_NODE_SERVICE_SECRET_SALT: {{ .values.global.config.nodeServiceSalt | default "lowcoder.org" | quote }}

View File

@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "lowcoder.fullname" . }}-api-service
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
spec:
type: {{ .Values.apiService.service.type }}
ports:
- port: {{ .Values.apiService.service.port }}
targetPort: lowcoder-api
protocol: TCP
name: lowcoder-api
{{- if .Values.apiService.service.nodePort }}
{{- if or (eq .Values.apiService.service.type "NodePort") (eq .Values.apiService.service.type "LoadBalancer") }}
nodePort: {{ .Values.apiService.service.nodePort }}
{{- end }}
{{- end }}
selector:
{{- include "lowcoder.selectorLabels" (dict "component" "api-service" "Values" .Values "Release" .Release "Chart" .Chart) | nindent 4 }}

View File

@@ -0,0 +1,28 @@
{{- $nameSpace := include "lowcoder.namespace" . -}}
{{- $name := include "lowcoder.fullname" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "lowcoder.fullname" . }}-frontend
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
LOWCODER_PUID: {{ .Values.global.config.userId | default "9001" | quote }}
LOWCODER_PGID: {{ .Values.global.config.groupId | default "9001" | quote }}
{{- if .Values.global.config.apiServiceUrl }}
LOWCODER_API_SERVICE_URL: {{ .Values.global.config.apiServiceUrl | trimSuffix "/" | quote }}
{{- else }}
LOWCODER_API_SERVICE_URL: "http://{{ $name }}-api-service:{{ .Values.apiService.service.port }}"
{{- end }}
{{- if .Values.global.config.nodeServiceUrl }}
LOWCODER_NODE_SERVICE_URL: {{ .Values.global.config.nodeServiceUrl | trimSuffix "/" | quote }}
{{- else }}
LOWCODER_NODE_SERVICE_URL: "http://{{ $name }}-node-service:{{ .Values.nodeService.service.port }}"
{{- end }}
LOWCODER_MAX_REQUEST_SIZE: {{ .Values.global.config.maxRequestSize | default "20m" | quote }}
LOWCODER_MAX_QUERY_TIMEOUT: {{ .Values.global.config.maxQueryTimeout | default "120" | quote }}

View File

@@ -0,0 +1,64 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "lowcoder.fullname" . }}-frontend
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
spec:
{{- if not .Values.frontend.autoscaling.enabled }}
replicas: {{ .Values.frontend.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "lowcoder.selectorLabels" (dict "component" "frontend" "Values" .Values "Release" .Release "Chart" .Chart) | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "lowcoder.selectorLabels" (dict "component" "frontend" "Values" .Values "Release" .Release "Chart" .Chart) | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "lowcoder.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ include "lowcoder.fullname" . }}-frontend
ports:
- name: lowcoder
containerPort: 3000
protocol: TCP
livenessProbe:
httpGet:
path: {{ .Values.ingress.contextPath | default "" | trimSuffix "/" }}/apps
port: lowcoder
readinessProbe:
httpGet:
path: {{ .Values.ingress.contextPath | default "" | trimSuffix "/" }}/apps
port: lowcoder
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,32 @@
{{- if .Values.frontend.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "lowcoder.fullname" . }}-frontend
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "lowcoder.fullname" . }}-frontend
minReplicas: {{ .Values.frontend.autoscaling.minReplicas }}
maxReplicas: {{ .Values.frontend.autoscaling.maxReplicas }}
metrics:
{{- if .Values.frontend.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.frontend.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.frontend.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.frontend.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "lowcoder.fullname" . }}-frontend
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
spec:
type: {{ .Values.frontend.service.type }}
ports:
- port: {{ .Values.frontend.service.port }}
targetPort: lowcoder
protocol: TCP
name: lowcoder
{{- if .Values.frontend.service.nodePort }}
{{- if or (eq .Values.frontend.service.type "NodePort") (eq .Values.frontend.service.type "LoadBalancer") }}
nodePort: {{ .Values.frontend.service.nodePort }}
{{- end }}
{{- end }}
selector:
{{- include "lowcoder.selectorLabels" (dict "component" "frontend" "Values" .Values "Release" .Release "Chart" .Chart) | nindent 4 }}

View File

@@ -0,0 +1,61 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "lowcoder.fullname" . -}}
{{- $svcPort := .Values.frontend.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}-frontend
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}-frontend
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,21 @@
{{- $nameSpace := include "lowcoder.namespace" . -}}
{{- $name := include "lowcoder.fullname" . -}}
{{- $lowcoderDatabase := first .Values.mongodb.auth.databases -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "lowcoder.fullname" . }}-node-service
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
LOWCODER_PUID: {{ .Values.global.config.userId | default "9001" | quote }}
LOWCODER_PGID: {{ .Values.global.config.groupId | default "9001" | quote }}
{{- if .Values.global.config.apiServiceUrl }}
LOWCODER_API_SERVICE_URL: {{ .Values.global.config.apiServiceUrl | quote }}
{{- else }}
LOWCODER_API_SERVICE_URL: "http://{{ $name }}-api-service:{{ .Values.apiService.service.port }}"
{{- end }}

View File

@@ -0,0 +1,69 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "lowcoder.fullname" . }}-node-service
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
spec:
{{- if not .Values.nodeService.autoscaling.enabled }}
replicas: {{ .Values.nodeService.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "lowcoder.selectorLabels" (dict "component" "node-service" "Values" .Values "Release" .Release "Chart" .Chart) | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "lowcoder.selectorLabels" (dict "component" "node-service" "Values" .Values "Release" .Release "Chart" .Chart) | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "lowcoder.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.nodeService.image.repository }}:{{ .Values.nodeService.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.nodeService.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ include "lowcoder.fullname" . }}-node-service
- secretRef:
name: {{ include "lowcoder.fullname" . }}-node-service
ports:
- name: lowcoder-node
containerPort: 6060
protocol: TCP
# Uncomment when /status endpoint is implemented
# livenessProbe:
# initialDelaySeconds: 15
# httpGet:
# path: /plugins
# port: lowcoder-node
# readinessProbe:
# initialDelaySeconds: 15
# httpGet:
# path: /plugins
# port: lowcoder-node
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,32 @@
{{- if .Values.nodeService.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "lowcoder.fullname" . }}-node-service
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "lowcoder.fullname" . }}-node-service
minReplicas: {{ .Values.nodeService.autoscaling.minReplicas }}
maxReplicas: {{ .Values.nodeService.autoscaling.maxReplicas }}
metrics:
{{- if .Values.nodeService.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.nodeService.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.nodeService.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.nodeService.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: {{ include "lowcoder.fullname" . }}-node-service
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
stringData:
LOWCODER_NODE_SERVICE_SECRET: {{ .values.global.config.nodeServiceSecret | default "62e348319ab9f5c43c3b5a380b4d82525cdb68740f21140e767989b509ab0aa2" | quote }}
LOWCODER_NODE_SERVICE_SECRET_SALT: {{ .values.global.config.nodeServiceSalt | default "lowcoder.org" | quote }}

View File

@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "lowcoder.fullname" . }}-node-service
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
spec:
type: {{ .Values.nodeService.service.type }}
ports:
- port: {{ .Values.nodeService.service.port }}
targetPort: lowcoder-node
protocol: TCP
name: lowcoder-node
{{- if .Values.nodeService.service.nodePort }}
{{- if or (eq .Values.nodeService.service.type "NodePort") (eq .Values.nodeService.service.type "LoadBalancer") }}
nodePort: {{ .Values.nodeService.service.nodePort }}
{{- end }}
{{- end }}
selector:
{{- include "lowcoder.selectorLabels" (dict "component" "node-service" "Values" .Values "Release" .Release "Chart" .Chart) | nindent 4 }}

View File

@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "lowcoder.serviceAccountName" . }}
labels:
{{- include "lowcoder.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}