Initial AI service skeleton
This commit is contained in:
9
k8s/configmap.yaml
Normal file
9
k8s/configmap.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: ai-service-config
|
||||
namespace: ai-service
|
||||
data:
|
||||
HTTP_HOST: "0.0.0.0"
|
||||
HTTP_PORT: "8080"
|
||||
MIGRATE_ON_START: "true"
|
||||
11
k8s/kustomization.yaml
Normal file
11
k8s/kustomization.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
namespace: ai-service
|
||||
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- configmap.yaml
|
||||
- secrets.yaml
|
||||
- server-deployment.yaml
|
||||
- server-service.yaml
|
||||
4
k8s/namespace.yaml
Normal file
4
k8s/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: ai-service
|
||||
8
k8s/secrets.yaml
Normal file
8
k8s/secrets.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: ai-service-secrets
|
||||
namespace: ai-service
|
||||
type: Opaque
|
||||
stringData:
|
||||
DATABASE_URL: "postgres://ai_service:CHANGE_ME@postgres:5432/ai_service?sslmode=disable"
|
||||
49
k8s/server-deployment.yaml
Normal file
49
k8s/server-deployment.yaml
Normal file
@@ -0,0 +1,49 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: ai-service
|
||||
namespace: ai-service
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: ai-service
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: ai-service
|
||||
spec:
|
||||
terminationGracePeriodSeconds: 20
|
||||
containers:
|
||||
- name: server
|
||||
image: localhost:30300/admin/ai-service:latest
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: ai-service-config
|
||||
- secretRef:
|
||||
name: ai-service-secrets
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /readyz
|
||||
port: 8080
|
||||
periodSeconds: 5
|
||||
failureThreshold: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /readyz
|
||||
port: 8080
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 8080
|
||||
periodSeconds: 10
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 96Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 384Mi
|
||||
12
k8s/server-service.yaml
Normal file
12
k8s/server-service.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ai-service
|
||||
namespace: ai-service
|
||||
spec:
|
||||
selector:
|
||||
app: ai-service
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
Reference in New Issue
Block a user