REFACTOR(k8s): reorganize to base/overlays pattern
- Add k8s/base/ with deployment and service - Add k8s/overlays/prod/ with environment config
This commit is contained in:
75
deploy/k8s/base/deployment.yaml
Normal file
75
deploy/k8s/base/deployment.yaml
Normal file
@@ -0,0 +1,75 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mas
|
||||
namespace: mas
|
||||
labels:
|
||||
app: mas
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mas
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mas
|
||||
spec:
|
||||
containers:
|
||||
- name: mas
|
||||
image: harbor.mayne.vcn/mas/platform:latest
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
name: http
|
||||
env:
|
||||
- name: ANTHROPIC_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mas-api-keys
|
||||
key: anthropic-api-key
|
||||
- name: OPENAI_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mas-api-keys
|
||||
key: openai-api-key
|
||||
- name: GOOGLE_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mas-api-keys
|
||||
key: google-api-key
|
||||
- name: GROQ_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mas-api-keys
|
||||
key: groq-api-key
|
||||
- name: GROQ_API_BASE
|
||||
value: "https://api.groq.com/openai/v1"
|
||||
- name: DATABASE_URL
|
||||
value: "postgresql+asyncpg://mas_user:$(POSTGRES_PASSWORD)@postgresql.postgresql.svc.cluster.local:5432/mas"
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: mas-postgres
|
||||
key: password
|
||||
- name: REDIS_URL
|
||||
value: "redis://redis:6379/0"
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
limits:
|
||||
memory: "2Gi"
|
||||
cpu: "2000m"
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
|
||||
15
deploy/k8s/base/kustomization.yaml
Normal file
15
deploy/k8s/base/kustomization.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
|
||||
commonLabels:
|
||||
app.kubernetes.io/name: mas
|
||||
app.kubernetes.io/component: platform
|
||||
|
||||
images:
|
||||
- name: harbor.mayne.vcn/mas/platform
|
||||
newTag: latest
|
||||
|
||||
17
deploy/k8s/base/service.yaml
Normal file
17
deploy/k8s/base/service.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mas
|
||||
namespace: mas
|
||||
labels:
|
||||
app: mas
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 8000
|
||||
targetPort: 8000
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: mas
|
||||
|
||||
Reference in New Issue
Block a user