feat: OCI deployment — Terraform VM + OKE stacks, OCIR, K8s manifests
- terraform-vm/: ARM VM (A1.Flex Free Tier), Docker Compose, Block Volume, LB+WAF+SSL - terraform-oke/: OKE cluster (3 nodes Intel), NodePort, LB+WAF+SSL - k8s/: namespace, deployments, services, PVC, secrets, configmap - Dockerfile.frontend: self-contained nginx+dist image - push-images.sh: multi-arch build (amd64+arm64) + push to OCIR - dns.tf: conditional OCI DNS Zone + A record (when domain available) - Both stacks 100% independent, no shared modules - .gitignore: terraform state, .terraform/, *.tfvars
This commit is contained in:
111
deploy/k8s/deployment.yaml
Normal file
111
deploy/k8s/deployment.yaml
Normal file
@@ -0,0 +1,111 @@
|
||||
##
|
||||
## Backend — FastAPI (port 8000)
|
||||
##
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: backend
|
||||
namespace: oci-cis-agent
|
||||
labels:
|
||||
app: oci-cis-agent-backend
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: oci-cis-agent-backend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: oci-cis-agent-backend
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: ocir-credentials
|
||||
containers:
|
||||
- name: backend
|
||||
image: OCIR_REGION.ocir.io/OCIR_NAMESPACE/oci-cis-agent-backend:latest
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: oci-cis-agent-config
|
||||
env:
|
||||
- name: APP_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: app-secret
|
||||
key: APP_SECRET
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
resources:
|
||||
requests:
|
||||
memory: "2Gi"
|
||||
cpu: "500m"
|
||||
limits:
|
||||
memory: "4Gi"
|
||||
cpu: "2000m"
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /api/health
|
||||
port: 8000
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /api/health
|
||||
port: 8000
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 30
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: oci-cis-agent-data
|
||||
|
||||
---
|
||||
|
||||
##
|
||||
## Frontend — nginx (port 80)
|
||||
##
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: frontend
|
||||
namespace: oci-cis-agent
|
||||
labels:
|
||||
app: oci-cis-agent-frontend
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: oci-cis-agent-frontend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: oci-cis-agent-frontend
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: ocir-credentials
|
||||
containers:
|
||||
- name: frontend
|
||||
image: OCIR_REGION.ocir.io/OCIR_NAMESPACE/oci-cis-agent-frontend:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
env:
|
||||
- name: TZ
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: oci-cis-agent-config
|
||||
key: TZ
|
||||
resources:
|
||||
requests:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
Reference in New Issue
Block a user