Compare commits
3 Commits
150251504a
...
52c0211436
| Author | SHA1 | Date | |
|---|---|---|---|
| 52c0211436 | |||
| b9881ea0f2 | |||
| e41ede3d3d |
33
README.md
Normal file
33
README.md
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# Установка
|
||||||
|
|
||||||
|
## Установка первой ноды
|
||||||
|
```
|
||||||
|
curl -sfL https://get.k3s.io | sh -s - --cluster-init --tls-san 10.90.90.99
|
||||||
|
```
|
||||||
|
|
||||||
|
## Добавление серверной ноды
|
||||||
|
```
|
||||||
|
curl -sfL https://get.k3s.io | K3S_TOKEN=<token> K3S_URL=https://10.90.90.99:6443 sh -s - server --server https://10.90.90.99:6443
|
||||||
|
```
|
||||||
|
|
||||||
|
## Добавление агента
|
||||||
|
```
|
||||||
|
curl -sfL https://get.k3s.io | K3S_TOKEN=<token> K3S_URL=https://10.90.90.99:6443 sh -s - agent --server https://10.90.90.99:6443
|
||||||
|
```
|
||||||
|
|
||||||
|
# Секреты
|
||||||
|
|
||||||
|
## JWT secrets
|
||||||
|
```
|
||||||
|
kubectl create secret generic jwt-secrets \
|
||||||
|
--from-literal=JWT_ISSUER="liquid" \
|
||||||
|
--from-literal=JWT_AUDIENCE="audience"\
|
||||||
|
--from-literal=JWT_SINGING_KEY="supersecretkey_supersecretkey_supersecretkey_supersecretkey"
|
||||||
|
```
|
||||||
|
|
||||||
|
## S3 secrets
|
||||||
|
```
|
||||||
|
kubectl create secret generic s3-credentials \
|
||||||
|
--from-literal=ACCESS_KEY_ID="accesskey" \
|
||||||
|
--from-literal=ACCESS_SECRET_KEY="secretkey"
|
||||||
|
```
|
||||||
@@ -15,10 +15,10 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# 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.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 0.1.0
|
version: 1.0.0
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# 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
|
# 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.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
# It is recommended to use it with quotes.
|
# It is recommended to use it with quotes.
|
||||||
appVersion: "1.16.0"
|
appVersion: "1.0.0"
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ spec:
|
|||||||
s3Credentials:
|
s3Credentials:
|
||||||
accessKeyId:
|
accessKeyId:
|
||||||
name: {{ .Values.s3.secretName | quote}}
|
name: {{ .Values.s3.secretName | quote}}
|
||||||
key: {{ .Values.s3.accessKeyKey | quote }}
|
key: {{ .Values.s3.accessKeyRef | quote }}
|
||||||
secretAccessKey:
|
secretAccessKey:
|
||||||
name: {{ .Values.s3.secretName | quote}}
|
name: {{ .Values.s3.secretName | quote}}
|
||||||
key: {{ .Values.s3.secretKeyKey | quote }}
|
key: {{ .Values.s3.secretKeyRef | quote }}
|
||||||
wal:
|
wal:
|
||||||
maxParallel: 8
|
maxParallel: 8
|
||||||
|
|
||||||
@@ -44,10 +44,10 @@ spec:
|
|||||||
s3Credentials:
|
s3Credentials:
|
||||||
accessKeyId:
|
accessKeyId:
|
||||||
name: {{ .Values.s3.secretName | quote}}
|
name: {{ .Values.s3.secretName | quote}}
|
||||||
key: {{ .Values.s3.accessKeyKey | quote }}
|
key: {{ .Values.s3.accessKeyRef | quote }}
|
||||||
secretAccessKey:
|
secretAccessKey:
|
||||||
name: {{ .Values.s3.secretName | quote}}
|
name: {{ .Values.s3.secretName | quote}}
|
||||||
key: {{ .Values.s3.secretKeyKey | quote }}
|
key: {{ .Values.s3.secretKeyRef | quote }}
|
||||||
wal:
|
wal:
|
||||||
compression: bzip2
|
compression: bzip2
|
||||||
maxParallel: 8
|
maxParallel: 8
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
s3:
|
s3:
|
||||||
endpointUrl: https://storage.yandexcloud.net
|
endpointUrl: https://storage.yandexcloud.net
|
||||||
secretName: s3-credentials
|
secretName: s3-credentials
|
||||||
accessKeyKey: ACCESS_KEY_ID
|
accessKeyRef: ACCESS_KEY_ID
|
||||||
secretKeyKey: ACCESS_SECRET_KEY
|
secretKeyRef: ACCESS_SECRET_KEY
|
||||||
cnpg:
|
cnpg:
|
||||||
clusterName: liquid-db
|
clusterName: liquid-db
|
||||||
backup:
|
backup:
|
||||||
enable: true
|
enable: true
|
||||||
schedule: "0 0 0 * * *"
|
schedule: "0 0 0 * * *"
|
||||||
destinationPath: "s3://liquid-code/backup-hexcore"
|
destinationPath: "s3://liquid-code/backup"
|
||||||
recovery:
|
recovery:
|
||||||
enable: true
|
enable: false
|
||||||
oldClusterName: liquid-db
|
oldClusterName: liquid-db
|
||||||
sourcePath: "s3://liquid-code/backup"
|
sourcePath: "s3://liquid-code/backup"
|
||||||
12
help.txt
12
help.txt
@@ -1,12 +0,0 @@
|
|||||||
# For pull private dockerhub
|
|
||||||
```
|
|
||||||
kubectl create secret docker-registry regcred --docker-server=<registry> --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email>
|
|
||||||
```
|
|
||||||
|
|
||||||
# For jwt secrets
|
|
||||||
```
|
|
||||||
kubectl create secret generic jwt-secrets \
|
|
||||||
--from-literal=JWT_ISSUER="liquid" \
|
|
||||||
--from-literal=JWT_AUDIENCE="audience"\
|
|
||||||
--from-literal=JWT_SINGING_KEY="supersecretkey_supersecretkey_supersecretkey_supersecretkey"
|
|
||||||
```
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: Issuer
|
|
||||||
metadata:
|
|
||||||
name: {{ .Release.Name }}-certificate-issuer
|
|
||||||
spec:
|
|
||||||
acme:
|
|
||||||
{{ if .Values.staging }}
|
|
||||||
server: https://acme-staging-v02.api.letsencrypt.org/directory
|
|
||||||
{{ else }}
|
|
||||||
server: https://acme-v02.api.letsencrypt.org/directory
|
|
||||||
{{ end }}
|
|
||||||
# Email address used for ACME registration
|
|
||||||
email: mr.pytkov@gmail.com
|
|
||||||
# Name of a secret used to store the ACME account private key
|
|
||||||
privateKeySecretRef:
|
|
||||||
name: {{ .Release.Name }}-acme-private-key
|
|
||||||
# Enable the HTTP-01 challenge provider
|
|
||||||
solvers:
|
|
||||||
- http01:
|
|
||||||
ingress:
|
|
||||||
ingressClassName: traefik
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
name: liquid-code-chart
|
name: liquid-code
|
||||||
description: A Helm chart for Kubernetes
|
description: A Helm chart for Kubernetes
|
||||||
|
|
||||||
# A chart can be either an 'application' or a 'library' chart.
|
# A chart can be either an 'application' or a 'library' chart.
|
||||||
@@ -15,10 +15,10 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# 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.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 0.1.2
|
version: 1.0.0
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# 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
|
# 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.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
# It is recommended to use it with quotes.
|
# It is recommended to use it with quotes.
|
||||||
appVersion: "1.16.6"
|
appVersion: "1.0.0"
|
||||||
@@ -16,7 +16,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Release.Name }}-backend
|
- name: {{ .Release.Name }}-backend
|
||||||
image: ghcr.io/nullptroma/liquid-backend:latest
|
image: git.nullptr.top/liquidcode/liquidcode:latest
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
@@ -25,18 +25,16 @@ spec:
|
|||||||
value: {{ required "s3 endpoint!" .Values.s3.endpointUrl | quote }}
|
value: {{ required "s3 endpoint!" .Values.s3.endpointUrl | quote }}
|
||||||
- name: S3_PRIVATE_BUCKET
|
- name: S3_PRIVATE_BUCKET
|
||||||
value: {{ required "privateBucket!" .Values.s3.privateBucket | quote }}
|
value: {{ required "privateBucket!" .Values.s3.privateBucket | quote }}
|
||||||
- name: S3_PUBLIC_BUCKET
|
|
||||||
value: {{ required "publicBucket!" .Values.s3.publicBucket | quote }}
|
|
||||||
- name: S3_ACCESS_KEY
|
- name: S3_ACCESS_KEY
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: {{ required "secretname!" .Values.s3.secretName | quote }}
|
name: {{ required "secretname!" .Values.s3.secretName | quote }}
|
||||||
key: {{ required "acces-key-key!" .Values.s3.accessKeyKey | quote }}
|
key: {{ required "acces-key-ref!" .Values.s3.accessKeyRef | quote }}
|
||||||
- name: S3_SECRET_KEY
|
- name: S3_SECRET_KEY
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: {{ .Values.s3.secretName | quote }}
|
name: {{ .Values.s3.secretName | quote }}
|
||||||
key: {{ required "secret-key-key!" .Values.s3.secretKeyKey | quote }}
|
key: {{ required "secret-key-ref!" .Values.s3.secretKeyRef | quote }}
|
||||||
- name: TESTING_MODULE_URL
|
- name: TESTING_MODULE_URL
|
||||||
value: http://{{ .Release.Name }}-queue-service:8080/
|
value: http://{{ .Release.Name }}-queue-service:8080/
|
||||||
- name: PG_URI
|
- name: PG_URI
|
||||||
@@ -47,6 +45,3 @@ spec:
|
|||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: {{ required "" .Values.jwt.secretName }}
|
name: {{ required "" .Values.jwt.secretName }}
|
||||||
|
|
||||||
imagePullSecrets:
|
|
||||||
- name: github-registry
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{ if .Values.frontend.enable }}
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -20,6 +21,4 @@ spec:
|
|||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 8000
|
||||||
|
{{ end }}
|
||||||
imagePullSecrets:
|
|
||||||
- name: github-registry
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{ if .Values.queue.enable }}
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -22,6 +23,4 @@ spec:
|
|||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
|
{{ end }}
|
||||||
imagePullSecrets:
|
|
||||||
- name: github-registry
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{ if .Values.frontend.enable }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
@@ -9,3 +10,5 @@ spec:
|
|||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 80
|
port: 80
|
||||||
targetPort: 8000
|
targetPort: 8000
|
||||||
|
|
||||||
|
{{ end }}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{ if .Values.queue.enable }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
@@ -9,3 +10,4 @@ spec:
|
|||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 8080
|
port: 8080
|
||||||
targetPort: 8080
|
targetPort: 8080
|
||||||
|
{{ end }}
|
||||||
@@ -5,11 +5,6 @@ metadata:
|
|||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/issuer: "{{ .Release.Name }}-certificate-issuer"
|
cert-manager.io/issuer: "{{ .Release.Name }}-certificate-issuer"
|
||||||
spec:
|
spec:
|
||||||
tls:
|
|
||||||
- hosts:
|
|
||||||
- liquidcode.ru
|
|
||||||
- api.liquidcode.ru
|
|
||||||
secretName: {{ .Release.Name }}-tls-secret
|
|
||||||
rules:
|
rules:
|
||||||
- host: api.liquidcode.ru
|
- host: api.liquidcode.ru
|
||||||
http:
|
http:
|
||||||
@@ -24,7 +24,7 @@ spec:
|
|||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Release.Name }}-backend
|
- name: {{ .Release.Name }}-backend
|
||||||
image: ghcr.io/nullptroma/liquid-backend:latest
|
image: git.nullptr.top/liquidcode/liquidcode:latest
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
@@ -36,6 +36,4 @@ spec:
|
|||||||
key: uri
|
key: uri
|
||||||
- name: DROP_DATABASE
|
- name: DROP_DATABASE
|
||||||
value: "1"
|
value: "1"
|
||||||
imagePullSecrets:
|
|
||||||
- name: github-registry
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@@ -23,7 +23,7 @@ spec:
|
|||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Release.Name }}-backend
|
- name: {{ .Release.Name }}-backend
|
||||||
image: ghcr.io/nullptroma/liquid-backend:latest
|
image: git.nullptr.top/liquidcode/liquidcode:latest
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
@@ -35,6 +35,4 @@ spec:
|
|||||||
key: uri
|
key: uri
|
||||||
- name: MIGRATE_ONLY
|
- name: MIGRATE_ONLY
|
||||||
value: "1"
|
value: "1"
|
||||||
imagePullSecrets:
|
|
||||||
- name: github-registry
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
s3:
|
s3:
|
||||||
endpointUrl: https://storage.yandexcloud.net
|
endpointUrl: https://storage.yandexcloud.net
|
||||||
secretName: s3-credentials
|
secretName: s3-credentials
|
||||||
accessKeyKey: ACCESS_KEY_ID
|
accessKeyRef: ACCESS_KEY_ID
|
||||||
secretKeyKey: ACCESS_SECRET_KEY
|
secretKeyRef: ACCESS_SECRET_KEY
|
||||||
privateBucket: liquid-code
|
privateBucket: liquid-code
|
||||||
publicBucket: liquid-code-public
|
|
||||||
jwt:
|
jwt:
|
||||||
secretName: jwt-secrets
|
secretName: jwt-secrets
|
||||||
database:
|
database:
|
||||||
secretName: liquid-db-app
|
secretName: liquid-db-app
|
||||||
migrateDb: true
|
migrateDb: true
|
||||||
dropDb: false
|
dropDb: true
|
||||||
staging: false
|
frontend:
|
||||||
imagePullSecret: github-registry
|
enable: false
|
||||||
|
queue:
|
||||||
|
enable: false
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
kubectl apply --server-side -f \
|
|
||||||
https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.22/releases/cnpg-1.22.1.yaml
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
curl -sfL https://get.k3s.io | sh -s -
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
apiVersion: helm.cattle.io/v1
|
|
||||||
kind: HelmChartConfig
|
|
||||||
metadata:
|
|
||||||
name: traefik-close-secure-port-config
|
|
||||||
namespace: kube-system
|
|
||||||
spec:
|
|
||||||
valuesContent: |-
|
|
||||||
ports:
|
|
||||||
websecure:
|
|
||||||
expose: false
|
|
||||||
Reference in New Issue
Block a user