feat : initial commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: motivator-config
|
||||
namespace: team1tier-healthsync-motivator-ns
|
||||
data:
|
||||
# Application Settings
|
||||
APP_NAME: "HealthSync Motivator Batch"
|
||||
APP_VERSION: "1.0.0"
|
||||
DEBUG: "false"
|
||||
LOG_LEVEL: "INFO"
|
||||
|
||||
# Database Configuration
|
||||
DB_HOST: "psql-digitalgarage-01.postgres.database.azure.com"
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: "healthsync_db"
|
||||
DB_USERNAME: "team1tier"
|
||||
|
||||
# Claude AI Configuration
|
||||
CLAUDE_MODEL: "claude-3-5-sonnet-20241022"
|
||||
CLAUDE_MAX_TOKENS: "150"
|
||||
CLAUDE_TEMPERATURE: "0.7"
|
||||
CLAUDE_TIMEOUT: "30"
|
||||
|
||||
# Batch Configuration
|
||||
BATCH_SIZE: "100"
|
||||
MAX_RETRIES: "3"
|
||||
|
||||
# Azure Service Bus Configuration
|
||||
AZURE_SERVICEBUS_NAMESPACE: "sb-healthsync.servicebus.windows.net"
|
||||
AZURE_SERVICEBUS_QUEUE_NAME: "healthsync-notifications"
|
||||
@@ -0,0 +1,48 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: healthsync-motivator-batch
|
||||
namespace: team1tier-healthsync-motivator-ns
|
||||
labels:
|
||||
app: healthsync-motivator
|
||||
type: batch
|
||||
spec:
|
||||
# 10분마다 실행
|
||||
schedule: "0 */10 * * *"
|
||||
timeZone: "Asia/Seoul"
|
||||
concurrencyPolicy: Forbid
|
||||
successfulJobsHistoryLimit: 3
|
||||
failedJobsHistoryLimit: 3
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: healthsync-motivator-batch
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: acr-secret
|
||||
restartPolicy: OnFailure
|
||||
containers:
|
||||
- name: motivator-batch
|
||||
image: acrhealthsync01.azurecr.io/team1tier/motivator-service:1.1.1
|
||||
imagePullPolicy: Always
|
||||
command: ["python", "app/batch_runner.py"]
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: motivator-config
|
||||
- secretRef:
|
||||
name: motivator-secret
|
||||
resources:
|
||||
requests:
|
||||
cpu: 256m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
cpu: 1024m
|
||||
memory: 1024Mi
|
||||
# 배치 실행 타임아웃 설정
|
||||
env:
|
||||
- name: PYTHONPATH
|
||||
value: "/app"
|
||||
- name: PYTHONUNBUFFERED
|
||||
value: "1"
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: motivator-secret
|
||||
namespace: team1tier-healthsync-motivator-ns
|
||||
type: Opaque
|
||||
stringData:
|
||||
# Database Password
|
||||
DB_PASSWORD: "Hi5Jessica!"
|
||||
|
||||
# Claude AI API Key (실제 키로 교체 필요)
|
||||
CLAUDE_API_KEY: "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"
|
||||
|
||||
# Azure Service Bus Connection String (실제 연결 문자열로 교체 필요)
|
||||
AZURE_SERVICEBUS_CONNECTION_STRING: "Endpoint=sb://sb-healthsync.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Zur5rLIi8MNQ8sk3T/TvsdVu+i02bbxaE+ASbCAXvZI="
|
||||
@@ -0,0 +1,39 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: healthsync-motivator-manual
|
||||
namespace: team1tier-healthsync-motivator-ns
|
||||
labels:
|
||||
app: healthsync-motivator
|
||||
type: manual
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: healthsync-motivator-manual
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: acr-secret
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: motivator-batch
|
||||
image: acrhealthsync01.azurecr.io/team1tier/motivator-service:1.1.1
|
||||
imagePullPolicy: Always
|
||||
command: ["python", "app/batch_runner.py"]
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: motivator-config
|
||||
- secretRef:
|
||||
name: motivator-secret
|
||||
resources:
|
||||
requests:
|
||||
cpu: 256m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
cpu: 1024m
|
||||
memory: 1024Mi
|
||||
env:
|
||||
- name: PYTHONPATH
|
||||
value: "/app"
|
||||
- name: PYTHONUNBUFFERED
|
||||
value: "1"
|
||||
Reference in New Issue
Block a user