From 796a938aa3c5e87d359c9a37e82708b754e00e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Mon, 4 May 2026 12:17:09 +0400 Subject: [PATCH] =?UTF-8?q?feat:=20helm=20chart=20=D0=B4=D0=BB=D1=8F=20fis?= =?UTF-8?q?sion-console=20(=D0=B1=D0=B5=D0=B7=20=D1=85=D0=B0=D1=80=D0=B4?= =?UTF-8?q?=D0=BA=D0=BE=D0=B4=D0=BE=D0=B2,=20=D0=BF=D0=B0=D1=80=D0=B0?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D1=80=D0=B8=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm/fission-console/Chart.yaml | 14 +++ helm/fission-console/templates/NOTES.txt | 9 ++ helm/fission-console/templates/_helpers.tpl | 25 ++++++ .../fission-console/templates/deployment.yaml | 61 +++++++++++++ helm/fission-console/templates/ingress.yaml | 37 ++++++++ helm/fission-console/templates/rbac.yaml | 41 +++++++++ helm/fission-console/templates/service.yaml | 14 +++ helm/fission-console/values.yaml | 86 +++++++++++++++++++ 8 files changed, 287 insertions(+) create mode 100644 helm/fission-console/Chart.yaml create mode 100644 helm/fission-console/templates/NOTES.txt create mode 100644 helm/fission-console/templates/_helpers.tpl create mode 100644 helm/fission-console/templates/deployment.yaml create mode 100644 helm/fission-console/templates/ingress.yaml create mode 100644 helm/fission-console/templates/rbac.yaml create mode 100644 helm/fission-console/templates/service.yaml create mode 100644 helm/fission-console/values.yaml diff --git a/helm/fission-console/Chart.yaml b/helm/fission-console/Chart.yaml new file mode 100644 index 0000000..5519985 --- /dev/null +++ b/helm/fission-console/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +name: fission-console +description: Fission Console — web UI and API gateway for Fission serverless platform +type: application +version: 0.1.0 +appVersion: "v1.3.56" +keywords: + - fission + - serverless + - kubernetes + - console +home: https://gitea.services.ngcloud.ru/Nail/fission +maintainers: + - name: naeel diff --git a/helm/fission-console/templates/NOTES.txt b/helm/fission-console/templates/NOTES.txt new file mode 100644 index 0000000..52e9ba1 --- /dev/null +++ b/helm/fission-console/templates/NOTES.txt @@ -0,0 +1,9 @@ +Fission Console успешно установлен! + +Адрес: https://{{ .Values.ingress.host }} + +Для проверки: + kubectl get pods -n {{ .Release.Namespace }} -l app.kubernetes.io/name=fission-console + +Логи: + kubectl logs -n {{ .Release.Namespace }} -l app.kubernetes.io/name=fission-console diff --git a/helm/fission-console/templates/_helpers.tpl b/helm/fission-console/templates/_helpers.tpl new file mode 100644 index 0000000..859ec83 --- /dev/null +++ b/helm/fission-console/templates/_helpers.tpl @@ -0,0 +1,25 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "fission-console.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "fission-console.labels" -}} +helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }} +app.kubernetes.io/name: fission-console +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "fission-console.selectorLabels" -}} +app.kubernetes.io/name: fission-console +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/helm/fission-console/templates/deployment.yaml b/helm/fission-console/templates/deployment.yaml new file mode 100644 index 0000000..4a26634 --- /dev/null +++ b/helm/fission-console/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fission-console + namespace: {{ .Release.Namespace }} + labels: + {{- include "fission-console.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "fission-console.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "fission-console.selectorLabels" . | nindent 8 }} + spec: + serviceAccountName: fission-console + containers: + - name: console + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.service.port }} + env: + - name: FISSION_NAMESPACE + value: {{ .Values.fission.namespace | quote }} + - name: FISSION_ROUTER_URL + value: {{ .Values.fission.routerUrl | quote }} + - name: PORT + value: {{ .Values.service.port | quote }} + - name: FISSION_HTTP_TIMEOUT + value: {{ .Values.fission.httpTimeout | quote }} + - name: FISSION_INVOKE_TIMEOUT + value: {{ .Values.fission.invokeTimeout | quote }} + - name: FISSION_AUTH_USERNAME + valueFrom: + secretKeyRef: + name: {{ .Values.auth.secretName }} + key: {{ .Values.auth.usernameKey }} + - name: FISSION_AUTH_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.auth.secretName }} + key: {{ .Values.auth.passwordKey }} + - name: FISSION_STORAGESVC_URL + value: {{ .Values.fission.storagesvcUrl | quote }} + livenessProbe: + httpGet: + path: {{ .Values.probes.liveness.path }} + port: {{ .Values.service.port }} + initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.probes.liveness.periodSeconds }} + readinessProbe: + httpGet: + path: {{ .Values.probes.readiness.path }} + port: {{ .Values.service.port }} + initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.probes.readiness.periodSeconds }} + resources: + {{- toYaml .Values.resources | nindent 12 }} diff --git a/helm/fission-console/templates/ingress.yaml b/helm/fission-console/templates/ingress.yaml new file mode 100644 index 0000000..6dd0c86 --- /dev/null +++ b/helm/fission-console/templates/ingress.yaml @@ -0,0 +1,37 @@ +{{- if .Values.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: fission-console + namespace: {{ .Release.Namespace }} + labels: + {{- include "fission-console.labels" . | nindent 4 }} + annotations: + {{- range $key, $value := .Values.ingress.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.ingress.tls.certManager.enabled }} + cert-manager.io/cluster-issuer: {{ .Values.ingress.tls.certManager.clusterIssuer | quote }} + {{- end }} +spec: + ingressClassName: {{ .Values.ingress.className | quote }} + rules: + - host: {{ .Values.ingress.host | quote }} + http: + paths: + {{- range .Values.ingress.paths }} + - path: {{ .path }} + pathType: {{ .pathType }} + backend: + service: + name: fission-console + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- if .Values.ingress.tls.enabled }} + tls: + - hosts: + - {{ .Values.ingress.host | quote }} + secretName: {{ .Values.ingress.tls.secretName | quote }} + {{- end }} +{{- end }} diff --git a/helm/fission-console/templates/rbac.yaml b/helm/fission-console/templates/rbac.yaml new file mode 100644 index 0000000..da79667 --- /dev/null +++ b/helm/fission-console/templates/rbac.yaml @@ -0,0 +1,41 @@ +{{- if .Values.rbac.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: fission-console + namespace: {{ .Release.Namespace }} + labels: + {{- include "fission-console.labels" . | nindent 4 }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ .Release.Namespace }}-fission-console + labels: + {{- include "fission-console.labels" . | nindent 4 }} +rules: + - apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list"] + - apiGroups: ["apps"] + resources: ["deployments"] + verbs: ["get", "list", "update", "patch"] + - apiGroups: ["fission.io"] + resources: ["environments", "packages", "functions", "httptriggers", "timetriggers"] + verbs: ["get", "list", "create", "update", "patch", "delete"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ .Release.Namespace }}-fission-console + labels: + {{- include "fission-console.labels" . | nindent 4 }} +subjects: + - kind: ServiceAccount + name: fission-console + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: {{ .Release.Namespace }}-fission-console + apiGroup: rbac.authorization.k8s.io +{{- end }} diff --git a/helm/fission-console/templates/service.yaml b/helm/fission-console/templates/service.yaml new file mode 100644 index 0000000..079371c --- /dev/null +++ b/helm/fission-console/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: fission-console + namespace: {{ .Release.Namespace }} + labels: + {{- include "fission-console.labels" . | nindent 4 }} +spec: + selector: + {{- include "fission-console.selectorLabels" . | nindent 4 }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.port }} + protocol: TCP diff --git a/helm/fission-console/values.yaml b/helm/fission-console/values.yaml new file mode 100644 index 0000000..5ef918f --- /dev/null +++ b/helm/fission-console/values.yaml @@ -0,0 +1,86 @@ +# ───────────────────────────────────────────── +# Fission Console — values.yaml +# Все секреты и домен задаются при установке: +# helm install ... --set ingress.host=... --set auth.username=... --set auth.password=... +# ───────────────────────────────────────────── + +# Образ консоли +image: + repository: naeel/fission-console + tag: "v1.3.56" + pullPolicy: Always + +# Количество реплик +replicaCount: 1 + +# Namespace, в котором работает Fission (не namespace самой консоли) +fission: + namespace: "default" + routerUrl: "http://router.fission.svc.cluster.local" + storagesvcUrl: "http://storagesvc.fission.svc.cluster.local" + httpTimeout: "30s" + invokeTimeout: "60s" + +# Порт контейнера +service: + port: 8090 + +# Аутентификация (секрет router в кластере) +# Значения передаются через --set или отдельный values-secrets.yaml (не коммитить!) +auth: + # Имя Kubernetes Secret, из которого берутся username/password + secretName: "router" + usernameKey: "username" + passwordKey: "password" + +# Ingress +ingress: + enabled: true + className: "nginx" + host: "" # ОБЯЗАТЕЛЬНО указать: --set ingress.host=fission.mycompany.ru + tls: + enabled: true + certManager: + enabled: true + clusterIssuer: "letsencrypt-prod" + secretName: "fission-console-tls" # имя TLS-секрета (cert-manager создаст сам) + annotations: + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + # Пути, проксируемые через Ingress + # По умолчанию: /, /fn, /console, /cron, /default + # Переопределять не нужно в большинстве случаев + paths: + - path: / + pathType: Exact + - path: /fn + pathType: Prefix + - path: /console + pathType: Prefix + - path: /cron + pathType: Prefix + - path: /default + pathType: Prefix + +# Ресурсы контейнера +resources: + requests: + cpu: 20m + memory: 32Mi + limits: + cpu: 200m + memory: 128Mi + +# Liveness/Readiness пробы +probes: + liveness: + path: /health + initialDelaySeconds: 5 + periodSeconds: 20 + readiness: + path: /health + initialDelaySeconds: 3 + periodSeconds: 10 + +# RBAC +rbac: + create: true