pcp-tgu-ui-service в группе сервисов pcp: регистрация в CI + per-service Node-пайплайн + helm-чарт

This commit is contained in:
Дмитрий Соловьев
2026-06-09 13:43:47 +03:00
parent f292291e04
commit cb439319c5
10 changed files with 400 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
apiVersion: v2
name: pcp-tgu-ui-service
description: Helm chart for deploying pcp-tgu-ui-service (статический фронт на nginx) from GitLab CI/CD.
type: application
version: 0.1.0
appVersion: "1.0.0"
@@ -0,0 +1,18 @@
{{- define "pcp-tgu-ui-service.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "pcp-tgu-ui-service.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- include "pcp-tgu-ui-service.name" . | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- define "pcp-tgu-ui-service.labels" -}}
app.kubernetes.io/name: {{ include "pcp-tgu-ui-service.name" . }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
@@ -0,0 +1,75 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "pcp-tgu-ui-service.fullname" . }}
labels:
{{- include "pcp-tgu-ui-service.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "pcp-tgu-ui-service.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
{{- include "pcp-tgu-ui-service.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.image.pullSecrets }}
imagePullSecrets:
{{- range . }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- name: {{ include "pcp-tgu-ui-service.name" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
# APP_* читаются entrypoint'ом и попадают в /config.js → window.__NSTART_APP_ENV__.
env:
- name: APP_API_URL
value: {{ .Values.app.apiUrl | quote }}
- name: APP_AUTH_MODE
value: {{ .Values.app.authMode | quote }}
{{- if .Values.app.newStartIdUrl }}
- name: APP_NEW_START_ID_URL
value: {{ .Values.app.newStartIdUrl | quote }}
{{- end }}
{{- if .Values.app.newStartIdRealm }}
- name: APP_NEW_START_ID_REALM
value: {{ .Values.app.newStartIdRealm | quote }}
{{- end }}
{{- if .Values.app.newStartIdClientId }}
- name: APP_NEW_START_ID_CLIENT_ID
value: {{ .Values.app.newStartIdClientId | quote }}
{{- end }}
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 10
periodSeconds: 20
timeoutSeconds: 5
resources:
{{- toYaml .Values.resources | nindent 12 }}
@@ -0,0 +1,31 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "pcp-tgu-ui-service.fullname" . }}
labels:
{{- include "pcp-tgu-ui-service.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className | quote }}
{{- end }}
{{- with .Values.ingress.tls }}
tls:
{{- toYaml . | nindent 4 }}
{{- end }}
rules:
- host: {{ .Values.ingress.host | quote }}
http:
paths:
- path: {{ .Values.ingress.path | quote }}
pathType: {{ .Values.ingress.pathType }}
backend:
service:
name: {{ include "pcp-tgu-ui-service.fullname" . }}
port:
number: {{ .Values.service.port }}
{{- end }}
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "pcp-tgu-ui-service.fullname" . }}
labels:
{{- include "pcp-tgu-ui-service.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
selector:
app.kubernetes.io/name: {{ include "pcp-tgu-ui-service.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
ports:
- name: http
port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
+10
View File
@@ -0,0 +1,10 @@
app:
apiUrl: "/api"
authMode: "anonymous"
service:
port: 8081
ingress:
enabled: true
host: pcp-tgu-ui-service.dev.k8s.264.nstart.cloud
@@ -0,0 +1,10 @@
app:
apiUrl: "/api"
authMode: "anonymous"
service:
port: 8081
ingress:
enabled: true
host: pcp-tgu-ui-service.master.k8s.264.nstart.cloud
+40
View File
@@ -0,0 +1,40 @@
replicaCount: 1
image:
repository: registry.example.com/pcp/pcp-tgu-ui-service
tag: latest
pullPolicy: IfNotPresent
pullSecrets: []
service:
type: ClusterIP
# Порт nginx из Dockerfile (EXPOSE 8081, non-root).
port: 8081
# Runtime-конфиг фронта: docker-entrypoint.d/20-nstart-runtime-config.sh генерит
# /config.js из этих APP_*-переменных (см. src/config/env.ts). Темы нет намеренно.
app:
apiUrl: "/api"
authMode: "anonymous"
newStartIdUrl: ""
newStartIdRealm: ""
newStartIdClientId: "pcp-tgu-ui-service"
ingress:
enabled: false
className: ""
annotations: {}
host: ""
path: /
pathType: Prefix
tls: []
extraEnv: []
resources: {}
podAnnotations: {}
podLabels: {}
nameOverride: ""
fullnameOverride: ""