Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dist/helm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Subchart tarballs are pulled by `helm dependency update`; not committed.
# Chart.lock pins the version and IS committed.
charts/
*.tgz
6 changes: 6 additions & 0 deletions dist/helm/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 20.13.4
digest: sha256:7057fcbbe1c53c3ce689c21a9bd39da646fe8b463bba060eb986040d34bd79ef
generated: "2026-05-02T12:14:24.025459+08:00"
46 changes: 27 additions & 19 deletions dist/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
apiVersion: v2
name: frontier
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
description: Frontier — All-in-one cloud-native gateway for microservices and edge nodes. Deploys both the data plane (frontier) and the control plane (frontlas) with an optional Redis backend.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# Chart version. Bump on every non-trivial change to templates / defaults.
version: 1.2.5

# App version. Tracks the frontier / frontlas binary version this chart was tested against.
appVersion: "1.2.5"

home: https://github.com/singchia/frontier
sources:
- https://github.com/singchia/frontier
keywords:
- gateway
- edge
- iot
- microservices
- frontier
- frontlas
maintainers:
- name: singchia
url: https://github.com/singchia

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
# Bundled Redis subchart powers the Frontlas control plane.
# Set redis.enabled=false in values.yaml to bring your own external Redis.
dependencies:
- name: redis
version: "20.x.x"
repository: https://charts.bitnami.com/bitnami
condition: redis.enabled
19 changes: 14 additions & 5 deletions dist/helm/configs/frontier/frontier.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
daemon:
frontier_id: frontier01
frontier_id: ""
rlimit:
enable: false
nofile: 102400
Expand All @@ -10,20 +10,29 @@ daemon:
servicebound:
listen:
network: tcp
addr: 0.0.0.0:30011
addr: 0.0.0.0:{{ .Values.frontier.service.servicebound.port }}
edgebound:
listen:
network: tcp
addr: 0.0.0.0:30012
addr: 0.0.0.0:{{ .Values.frontier.service.edgebound.port }}
edgeid_alloc_when_no_idservice_on: true
dao:
debug: false
{{- if .Values.frontlas.enabled }}
frontlas:
enable: false
enable: true
dial:
network: tcp
addr: 127.0.0.1:40012
addrs:
- {{ include "frontier.frontlas.serviceFQDN" . }}:{{ .Values.frontlas.service.frontierplane.port }}
metrics:
enable: false
interval: 0
{{- else }}
frontlas:
enable: false
{{- end }}
observability:
enable: {{ .Values.observability.frontier.enabled }}
addr: 0.0.0.0:{{ .Values.observability.frontier.port }}
mqm: {}
26 changes: 26 additions & 0 deletions dist/helm/configs/frontlas/frontlas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
daemon:
rlimit:
enable: false
nofile: 102400
pprof:
enable: true
addr: 0.0.0.0:6061
cpu_profile_rate: 0
control_plane:
listen:
network: tcp
addr: 0.0.0.0:{{ .Values.frontlas.service.controlplane.port }}
frontier_plane:
listen:
network: tcp
addr: 0.0.0.0:{{ .Values.frontlas.service.frontierplane.port }}
expiration:
edge_meta: 30
service_meta: 30
# Redis 实际地址 / 模式 / 用户名 / 密码 都通过环境变量注入
# (FRONTLAS_REDIS_ADDRS / REDIS_TYPE / REDIS_USER / REDIS_PASSWORD ...).
redis:
mode: standalone
observability:
enable: {{ .Values.observability.frontlas.enabled }}
addr: 0.0.0.0:{{ .Values.observability.frontlas.port }}
113 changes: 92 additions & 21 deletions dist/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Expand the name of the chart.

{{/*
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 "frontier.fullname" -}}
{{- if .Values.fullnameOverride }}
Expand All @@ -23,40 +21,113 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{/* Per-component fullnames. */}}
{{- define "frontier.frontier.fullname" -}}
{{- printf "%s-frontier" (include "frontier.fullname" .) | trunc 63 | trimSuffix "-" }}
{{- end }}

{{- define "frontier.frontlas.fullname" -}}
{{- printf "%s-frontlas" (include "frontier.fullname" .) | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/* Chart label. */}}
{{- define "frontier.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "frontier.labels" -}}
{{/* Common labels (shared by both components). */}}
{{- define "frontier.commonLabels" -}}
helm.sh/chart: {{ include "frontier.chart" . }}
{{ include "frontier.selectorLabels" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "frontier.name" . }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "frontier.selectorLabels" -}}
{{/* Frontier labels + selector. */}}
{{- define "frontier.frontier.labels" -}}
{{ include "frontier.commonLabels" . }}
app.kubernetes.io/name: {{ include "frontier.name" . }}
app.kubernetes.io/component: frontier
{{- end }}

{{- define "frontier.frontier.selectorLabels" -}}
app.kubernetes.io/name: {{ include "frontier.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: frontier
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "frontier.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "frontier.fullname" .) .Values.serviceAccount.name }}
{{/* Frontlas labels + selector. */}}
{{- define "frontier.frontlas.labels" -}}
{{ include "frontier.commonLabels" . }}
app.kubernetes.io/name: {{ include "frontier.name" . }}
app.kubernetes.io/component: frontlas
{{- end }}

{{- define "frontier.frontlas.selectorLabels" -}}
app.kubernetes.io/name: {{ include "frontier.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: frontlas
{{- end }}

{{/* Service account names. */}}
{{- define "frontier.frontier.serviceAccountName" -}}
{{- if .Values.frontier.serviceAccount.create }}
{{- default (include "frontier.frontier.fullname" .) .Values.frontier.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.frontier.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "frontier.frontlas.serviceAccountName" -}}
{{- if .Values.frontlas.serviceAccount.create }}
{{- default (include "frontier.frontlas.fullname" .) .Values.frontlas.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- default "default" .Values.frontlas.serviceAccount.name }}
{{- end }}
{{- end }}

{{/* Resolve image pull policy (per-component override > global default). */}}
{{- define "frontier.pullPolicy" -}}
{{- if .comp.image.pullPolicy }}{{ .comp.image.pullPolicy }}{{ else }}{{ .global.imagePullPolicy }}{{ end }}
{{- end }}

{{/* Resolve image tag (per-component override > Chart.AppVersion). */}}
{{- define "frontier.imageTag" -}}
{{- if .comp.image.tag }}{{ .comp.image.tag }}{{ else }}{{ .root.Chart.AppVersion }}{{ end }}
{{- end }}

{{/* Frontlas Service FQDN — used by frontier to dial the frontier-plane port. */}}
{{- define "frontier.frontlas.serviceFQDN" -}}
{{ include "frontier.frontlas.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
{{- end }}

{{/*
Resolve Redis connection details for Frontlas. Returns a YAML dict that
deployment_frontlas.yaml fromYaml-decodes to build env vars.

When redis.enabled is true, target the bundled `<release>-redis-master`
service and the auto-generated `<release>-redis` Secret.
Otherwise read from .Values.frontlas.externalRedis.
*/}}
{{- define "frontier.frontlas.redis" -}}
{{- if .Values.redis.enabled -}}
addrs: "{{ .Release.Name }}-redis-master.{{ .Release.Namespace }}.svc.cluster.local:6379"
user: ""
redisType: standalone
masterName: ""
db: 0
passwordSecretName: "{{ .Release.Name }}-redis"
passwordSecretKey: "redis-password"
{{- else -}}
addrs: "{{ join "," .Values.frontlas.externalRedis.addrs }}"
user: "{{ .Values.frontlas.externalRedis.user }}"
redisType: {{ .Values.frontlas.externalRedis.redisType }}
masterName: "{{ .Values.frontlas.externalRedis.masterName }}"
db: {{ .Values.frontlas.externalRedis.db }}
passwordSecretName: "{{ .Values.frontlas.externalRedis.passwordSecret.name }}"
passwordSecretKey: "{{ .Values.frontlas.externalRedis.passwordSecret.key }}"
{{- end -}}
{{- end }}
8 changes: 5 additions & 3 deletions dist/helm/templates/configmap_frontier.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{{- if .Values.frontier.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "frontier.fullname" . }}
name: {{ include "frontier.frontier.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "frontier.labels" . | nindent 4 }}
{{- include "frontier.frontier.labels" . | nindent 4 }}
data:
frontier.yaml: |
{{ .Files.Get "configs/frontier/frontier.yaml" | indent 4 }}
{{ tpl (.Files.Get "configs/frontier/frontier.yaml") . | indent 4 }}
{{- end }}
12 changes: 12 additions & 0 deletions dist/helm/templates/configmap_frontlas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.frontlas.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "frontier.frontlas.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "frontier.frontlas.labels" . | nindent 4 }}
data:
frontlas.yaml: |
{{ tpl (.Files.Get "configs/frontlas/frontlas.yaml") . | indent 4 }}
{{- end }}
Loading