117 lines
2.8 KiB
YAML
117 lines
2.8 KiB
YAML
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: litellm-postgres
|
|
namespace: llama
|
|
type: Opaque
|
|
stringData:
|
|
POSTGRES_DB: litellm
|
|
POSTGRES_USER: litellm
|
|
POSTGRES_PASSWORD: 7792e47efbc7348155f54a15ed34dc1d06716b2b1848711d0ee90e3461883c0d
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: litellm-postgres
|
|
namespace: llama
|
|
labels:
|
|
app.kubernetes.io/name: litellm-postgres
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 10Gi
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: litellm-postgres
|
|
namespace: llama
|
|
labels:
|
|
app.kubernetes.io/name: litellm-postgres
|
|
app.kubernetes.io/component: database
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: litellm-postgres
|
|
app.kubernetes.io/component: database
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: litellm-postgres
|
|
app.kubernetes.io/component: database
|
|
spec:
|
|
containers:
|
|
- name: postgres
|
|
image: postgres:16
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- name: postgres
|
|
containerPort: 5432
|
|
env:
|
|
- name: POSTGRES_DB
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: litellm-postgres
|
|
key: POSTGRES_DB
|
|
- name: POSTGRES_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: litellm-postgres
|
|
key: POSTGRES_USER
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: litellm-postgres
|
|
key: POSTGRES_PASSWORD
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /var/lib/postgresql
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- pg_isready -U "$POSTGRES_USER" -d "$POSTGRES_DB"
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- pg_isready -U "$POSTGRES_USER" -d "$POSTGRES_DB"
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 20
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: 500m
|
|
memory: 256Mi
|
|
volumes:
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: litellm-postgres
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: litellm-postgres
|
|
namespace: llama
|
|
labels:
|
|
app.kubernetes.io/name: litellm-postgres
|
|
app.kubernetes.io/component: database
|
|
spec:
|
|
selector:
|
|
app.kubernetes.io/name: litellm-postgres
|
|
app.kubernetes.io/component: database
|
|
ports:
|
|
- name: postgres
|
|
port: 5432
|
|
targetPort: postgres
|
|
type: ClusterIP
|