feat: migrate VK bot to Callback API
This commit is contained in:
1 parent
2794546974
commit
a04498d634
10 files changed
+438
-58
No files matched your search
@@ -118,14 +118,55 @@ spec:
|
||||
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.
|
||||
@@ -194,6 +194,9 @@ spec:
|
||||
image: reg.nyan404.ru/cwshed-clone/belki:6656484
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["python", "-m", "app.belki.vk_bot"]
|
||||
ports:
|
||||
- name: callback
|
||||
containerPort: 8081
|
||||
env:
|
||||
- name: VK_GROUP_TOKEN
|
||||
valueFrom:
|
||||
@@ -210,6 +213,16 @@ spec:
|
||||
secretKeyRef:
|
||||
name: belki-runtime
|
||||
key: VK_API_VERSION
|
||||
- name: VK_CALLBACK_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: belki-runtime
|
||||
key: VK_CALLBACK_SECRET
|
||||
- name: VK_CALLBACK_CONFIRMATION
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: belki-runtime
|
||||
key: VK_CALLBACK_CONFIRMATION
|
||||
- name: BELKI_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
@@ -227,4 +240,33 @@ spec:
|
||||
value: https://cat.nyan404.ru
|
||||
- name: BELKI_S3_SECURE
|
||||
value: "false"
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: callback
|
||||
initialDelaySeconds: 3
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: callback
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 20
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: belki-bot
|
||||
namespace: belki
|
||||
labels:
|
||||
app.kubernetes.io/name: belki-bot
|
||||
app.kubernetes.io/part-of: belki-calculator
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app.kubernetes.io/name: belki-bot
|
||||
ports:
|
||||
- name: callback
|
||||
port: 8081
|
||||
targetPort: callback
|
||||
# production.yaml defines the production production resource; keep namespace and secret references aligned with belki.
|
||||
@@ -8,6 +8,8 @@ stringData:
|
||||
VK_GROUP_TOKEN: replace-out-of-band
|
||||
VK_GROUP_ID: replace-out-of-band
|
||||
VK_API_VERSION: "5.199"
|
||||
VK_CALLBACK_SECRET: replace-out-of-band
|
||||
VK_CALLBACK_CONFIRMATION: replace-out-of-band
|
||||
BELKI_DATABASE_URL: postgresql://belki:replace-out-of-band@postgres:5432/belki
|
||||
POSTGRES_PASSWORD: replace-out-of-band
|
||||
BELKI_ADMIN_PASSWORD: replace-out-of-band
|
||||
|
||||
Reference in new issue
Block a user