This commit is contained in:
Дмитрий Соловьев
2026-05-25 14:23:52 +03:00
parent b3a6012ebb
commit d48ddd2657
1066 changed files with 104601 additions and 3 deletions
+6
View File
@@ -0,0 +1,6 @@
apiVersion: v2
name: pcp-slots-service
description: Helm chart for deploying pcp-slots-service from GitLab CI/CD.
type: application
version: 0.1.0
appVersion: "1.0.0"
+43
View File
@@ -0,0 +1,43 @@
{{- define "slots-service.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "slots-service.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- include "slots-service.name" . | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- define "slots-service.labels" -}}
app.kubernetes.io/name: {{ include "slots-service.name" . }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{- define "slots-service.serviceBaseUrl" -}}
{{- if .Values.app.serviceBaseUrl -}}
{{- .Values.app.serviceBaseUrl -}}
{{- else if and .Values.ingress.enabled .Values.ingress.host -}}
{{- $scheme := .Values.app.serviceBaseUrlScheme | default (ternary "https" "http" (gt (len .Values.ingress.tls) 0)) -}}
{{- printf "%s://%s" $scheme .Values.ingress.host -}}
{{- end -}}
{{- end -}}
{{- define "slots-service.managementBaseUrl" -}}
{{- if .Values.app.managementBaseUrl -}}
{{- .Values.app.managementBaseUrl -}}
{{- else -}}
{{- printf "http://%s:%v" (include "slots-service.fullname" .) .Values.service.port -}}
{{- end -}}
{{- end -}}
{{- define "slots-service.healthUrl" -}}
{{- if .Values.app.healthUrl -}}
{{- .Values.app.healthUrl -}}
{{- else -}}
{{- printf "%s/actuator/health" (include "slots-service.managementBaseUrl" .) -}}
{{- end -}}
{{- end -}}
@@ -0,0 +1,100 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "slots-service.fullname" . }}
labels:
{{- include "slots-service.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
progressDeadlineSeconds: {{ .Values.progressDeadlineSeconds }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "slots-service.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
{{- include "slots-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 "slots-service.name" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
env:
- name: SPRING_PROFILES_ACTIVE
value: {{ .Values.app.profile | quote }}
- name: CONFIG_SERVER_URI
value: {{ .Values.app.configServerUri | quote }}
- name: SPRING_CLOUD_CONFIG_LABEL
value: {{ .Values.app.configLabel | quote }}
- name: CONFIG_SERVER_FAIL_FAST
value: {{ .Values.app.configServerFailFast | quote }}
{{- if .Values.app.adminClientUrl }}
- name: SPRING_BOOT_ADMIN_CLIENT_URL
value: {{ .Values.app.adminClientUrl | quote }}
{{- end }}
{{- $serviceBaseUrl := include "slots-service.serviceBaseUrl" . }}
{{- if $serviceBaseUrl }}
- name: SPRING_BOOT_ADMIN_CLIENT_INSTANCE_SERVICE_BASE_URL
value: {{ $serviceBaseUrl | quote }}
{{- end }}
{{- if .Values.app.servicePath }}
- name: SPRING_BOOT_ADMIN_CLIENT_INSTANCE_SERVICE_PATH
value: {{ .Values.app.servicePath | quote }}
{{- end }}
{{- $managementBaseUrl := include "slots-service.managementBaseUrl" . }}
{{- if $managementBaseUrl }}
- name: SPRING_BOOT_ADMIN_CLIENT_INSTANCE_MANAGEMENT_BASE_URL
value: {{ $managementBaseUrl | quote }}
{{- end }}
{{- $healthUrl := include "slots-service.healthUrl" . }}
{{- if $healthUrl }}
- name: SPRING_BOOT_ADMIN_CLIENT_INSTANCE_HEALTH_URL
value: {{ $healthUrl | quote }}
{{- end }}
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.startupProbe.enabled }}
startupProbe:
httpGet:
path: /actuator/health
port: http
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
{{- end }}
readinessProbe:
httpGet:
path: /actuator/health
port: http
initialDelaySeconds: 20
periodSeconds: 15
timeoutSeconds: 5
livenessProbe:
httpGet:
path: /actuator/health
port: http
initialDelaySeconds: 40
periodSeconds: 20
timeoutSeconds: 5
resources:
{{- toYaml .Values.resources | nindent 12 }}
+31
View File
@@ -0,0 +1,31 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "slots-service.fullname" . }}
labels:
{{- include "slots-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 "slots-service.fullname" . }}
port:
number: {{ .Values.service.port }}
{{- end }}
+16
View File
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "slots-service.fullname" . }}
labels:
{{- include "slots-service.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
selector:
app.kubernetes.io/name: {{ include "slots-service.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
ports:
- name: http
port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
+25
View File
@@ -0,0 +1,25 @@
app:
profile: dev
configLabel: dev
adminClientUrl: "http://pcp-spring-boot-admin-server:38889"
service:
port: 8080
ingress:
enabled: true
host: pcp-slots-service.dev.k8s.264.nstart.cloud
extraEnv:
- name: SERVER_PORT
value: "8080"
- name: SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE
value: "20"
- name: SPRING_DATASOURCE_HIKARI_MINIMUM_IDLE
value: "0"
- name: SPRING_DATASOURCE_HIKARI_CONNECTION_TIMEOUT
value: "10000"
- name: SPRING_FLYWAY_CONNECT_RETRIES
value: "10"
- name: SPRING_FLYWAY_CONNECT_RETRIES_INTERVAL
value: "5s"
+24
View File
@@ -0,0 +1,24 @@
app:
profile: master
configLabel: master
service:
port: 8080
ingress:
enabled: true
host: pcp-slots-service.master.k8s.264.nstart.cloud
extraEnv:
- name: SERVER_PORT
value: "8080"
- name: SPRING_DATASOURCE_HIKARI_MAXIMUM_POOL_SIZE
value: "20"
- name: SPRING_DATASOURCE_HIKARI_MINIMUM_IDLE
value: "0"
- name: SPRING_DATASOURCE_HIKARI_CONNECTION_TIMEOUT
value: "10000"
- name: SPRING_FLYWAY_CONNECT_RETRIES
value: "10"
- name: SPRING_FLYWAY_CONNECT_RETRIES_INTERVAL
value: "5s"
+56
View File
@@ -0,0 +1,56 @@
replicaCount: 1
progressDeadlineSeconds: 1800
image:
repository: registry.example.com/pcp/slots-service
tag: latest
pullPolicy: IfNotPresent
pullSecrets: []
service:
type: ClusterIP
port: 8080
app:
profile: master
configServerUri: "http://spring-cloud-config-server:38888"
configServerFailFast: "true"
configLabel: master
adminClientUrl: ""
serviceBaseUrl: ""
serviceBaseUrlScheme: ""
servicePath: "/swagger/ui"
managementBaseUrl: ""
healthUrl: ""
ingress:
enabled: false
className: ""
annotations: {}
host: ""
path: /
pathType: Prefix
tls: []
extraEnv: []
startupProbe:
enabled: true
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 180
resources:
requests:
cpu: "1"
memory: "2Gi"
limits:
cpu: "16"
memory: "8Gi"
podAnnotations: {}
podLabels: {}
nameOverride: "pcp-slots-service"
fullnameOverride: "pcp-slots-service"