Files

175 lines
4.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: belki-web
namespace: belki
labels:
app.kubernetes.io/name: belki-web
app.kubernetes.io/part-of: belki-calculator
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: belki-web
template:
metadata:
labels:
app.kubernetes.io/name: belki-web
app.kubernetes.io/part-of: belki-calculator
spec:
nodeSelector:
kubernetes.io/arch: amd64
containers:
- name: web
image: reg.nyan404.ru/cwshed-clone/belki:latest
imagePullPolicy: Always
command: ["python", "-m", "app.main"]
ports:
- name: http
containerPort: 8080
env:
- name: BELKI_PORT
value: "8080"
- name: BELKI_DATABASE_URL
valueFrom:
secretKeyRef:
name: belki-vk
key: BELKI_DATABASE_URL
- name: BELKI_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: belki-vk
key: BELKI_ADMIN_PASSWORD
- name: BELKI_ADMIN_RATE_LIMIT_EXEMPT_PROXY_CIDRS
value: "10.42.0.0/21"
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 2
periodSeconds: 10
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 20
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10001
---
apiVersion: v1
kind: Service
metadata:
name: belki-web
namespace: belki
labels:
app.kubernetes.io/part-of: belki-calculator
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: belki-web
ports:
- name: http
port: 8080
targetPort: http
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: belki-bot
namespace: belki
labels:
app.kubernetes.io/name: belki-bot
app.kubernetes.io/part-of: belki-calculator
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: belki-bot
template:
metadata:
labels:
app.kubernetes.io/name: belki-bot
app.kubernetes.io/part-of: belki-calculator
qos.dscp: cs1
spec:
nodeSelector:
kubernetes.io/arch: amd64
containers:
- name: bot
image: reg.nyan404.ru/cwshed-clone/belki:latest
imagePullPolicy: Always
command: ["python", "-m", "app.belki.vk_bot"]
env:
- name: VK_GROUP_TOKEN
valueFrom:
secretKeyRef:
name: belki-vk
key: VK_GROUP_TOKEN
- name: VK_GROUP_ID
valueFrom:
secretKeyRef:
name: belki-vk
key: VK_GROUP_ID
- name: VK_API_VERSION
valueFrom:
secretKeyRef:
name: belki-vk
key: VK_API_VERSION
optional: true
- name: VK_CALLBACK_SECRET
valueFrom:
secretKeyRef:
name: belki-vk
key: VK_CALLBACK_SECRET
- name: VK_CALLBACK_CONFIRMATION
valueFrom:
secretKeyRef:
name: belki-vk
key: VK_CALLBACK_CONFIRMATION
- name: BELKI_DATABASE_URL
valueFrom:
secretKeyRef:
name: belki-vk
key: BELKI_DATABASE_URL
ports:
- name: callback
containerPort: 8081
readinessProbe:
httpGet:
path: /health
port: callback
initialDelaySeconds: 3
periodSeconds: 10
livenessProbe:
httpGet:
path: /health
port: callback
initialDelaySeconds: 10
periodSeconds: 20
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10001
---
apiVersion: v1
kind: Service
metadata:
name: belki-bot
namespace: belki
labels:
app.kubernetes.io/part-of: belki-calculator
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: belki-bot
ports:
- name: callback
port: 8081
targetPort: callback
# app.yaml defines the app production resource; keep namespace and secret references aligned with belki.