Переименовано

This commit is contained in:
2025-10-22 19:16:22 +03:00
parent b9881ea0f2
commit 52c0211436
15 changed files with 35 additions and 43 deletions

23
liquid-code/.helmignore Normal file
View File

@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

24
liquid-code/Chart.yaml Normal file
View File

@@ -0,0 +1,24 @@
apiVersion: v2
name: liquid-code
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.
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: 1.0.0
# 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"

View File

@@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-backend-deployment
labels:
app: {{ .Release.Name }}-backend
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-backend
template:
metadata:
labels:
app: {{ .Release.Name }}-backend
spec:
containers:
- name: {{ .Release.Name }}-backend
image: git.nullptr.top/liquidcode/liquidcode:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: S3_ENDPOINT
value: {{ required "s3 endpoint!" .Values.s3.endpointUrl | quote }}
- name: S3_PRIVATE_BUCKET
value: {{ required "privateBucket!" .Values.s3.privateBucket | quote }}
- name: S3_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ required "secretname!" .Values.s3.secretName | quote }}
key: {{ required "acces-key-ref!" .Values.s3.accessKeyRef | quote }}
- name: S3_SECRET_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.s3.secretName | quote }}
key: {{ required "secret-key-ref!" .Values.s3.secretKeyRef | quote }}
- name: TESTING_MODULE_URL
value: http://{{ .Release.Name }}-queue-service:8080/
- name: PG_URI
valueFrom:
secretKeyRef:
name: {{ required "Cluster creds secret required!" .Values.database.secretName }}
key: uri
envFrom:
- secretRef:
name: {{ required "" .Values.jwt.secretName }}

View File

@@ -0,0 +1,24 @@
{{ if .Values.frontend.enable }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-frontend-deployment
labels:
app: {{ .Release.Name }}-frontend
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-frontend
template:
metadata:
labels:
app: {{ .Release.Name }}-frontend
spec:
containers:
- name: {{ .Release.Name }}-frontend
image: ghcr.io/nullptroma/liquid-frontend:latest
imagePullPolicy: Always
ports:
- containerPort: 8000
{{ end }}

View File

@@ -0,0 +1,26 @@
{{ if .Values.queue.enable }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-queue-deployment
labels:
app: {{ .Release.Name }}-queue
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-queue
template:
metadata:
labels:
app: {{ .Release.Name }}-queue
spec:
containers:
- name: {{ .Release.Name }}-queue
image: ghcr.io/nullptroma/liquid-queue:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
securityContext:
privileged: true
{{ end }}

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-backend-service
spec:
selector:
app: {{ .Release.Name }}-backend
ports:
- protocol: TCP
port: 80
targetPort: 8080

View File

@@ -0,0 +1,14 @@
{{ if .Values.frontend.enable }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-frontend-service
spec:
selector:
app: {{ .Release.Name }}-frontend
ports:
- protocol: TCP
port: 80
targetPort: 8000
{{ end }}

View File

@@ -0,0 +1,13 @@
{{ if .Values.queue.enable }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-queue-service
spec:
selector:
app: {{ .Release.Name }}-queue
ports:
- protocol: TCP
port: 8080
targetPort: 8080
{{ end }}

View File

@@ -0,0 +1,28 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-ingress
annotations:
cert-manager.io/issuer: "{{ .Release.Name }}-certificate-issuer"
spec:
rules:
- host: api.liquidcode.ru
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-backend-service
port:
number: 80
- host: liquidcode.ru
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-frontend-service
port:
number: 80

View File

@@ -0,0 +1,39 @@
{{ if .Values.database.dropDb }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{.Release.Name}}-drop-job
labels:
app.kubernetes.io/managed-by: {{.Release.Service | quote }}
app.kubernetes.io/instance: {{.Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
annotations:
"helm.sh/hook": pre-install
"helm.sh/hook-weight": "-1"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
template:
metadata:
name: {{.Release.Name}}-migration-pod
labels:
app.kubernetes.io/managed-by: {{.Release.Service | quote }}
app.kubernetes.io/instance: {{.Release.Name | quote }}
helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
spec:
restartPolicy: Never
containers:
- name: {{ .Release.Name }}-backend
image: git.nullptr.top/liquidcode/liquidcode:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: PG_URI
valueFrom:
secretKeyRef:
name: {{ required "Cluster creds secret required!" .Values.database.secretName }}
key: uri
- name: DROP_DATABASE
value: "1"
{{ end }}

View File

@@ -0,0 +1,38 @@
{{ if .Values.database.migrateDb }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{.Release.Name}}-migration-job
labels:
app.kubernetes.io/managed-by: {{.Release.Service | quote }}
app.kubernetes.io/instance: {{.Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
annotations:
"helm.sh/hook": pre-install
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
template:
metadata:
name: {{.Release.Name}}-migration-pod
labels:
app.kubernetes.io/managed-by: {{.Release.Service | quote }}
app.kubernetes.io/instance: {{.Release.Name | quote }}
helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}"
spec:
restartPolicy: Never
containers:
- name: {{ .Release.Name }}-backend
image: git.nullptr.top/liquidcode/liquidcode:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: PG_URI
valueFrom:
secretKeyRef:
name: {{ required "Cluster creds secret required!" .Values.database.secretName }}
key: uri
- name: MIGRATE_ONLY
value: "1"
{{ end }}

16
liquid-code/values.yaml Normal file
View File

@@ -0,0 +1,16 @@
s3:
endpointUrl: https://storage.yandexcloud.net
secretName: s3-credentials
accessKeyRef: ACCESS_KEY_ID
secretKeyRef: ACCESS_SECRET_KEY
privateBucket: liquid-code
jwt:
secretName: jwt-secrets
database:
secretName: liquid-db-app
migrateDb: true
dropDb: true
frontend:
enable: false
queue:
enable: false