68 lines
1.4 KiB
YAML
68 lines
1.4 KiB
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: citus-loadbalancer
|
|
spec:
|
|
type: LoadBalancer
|
|
selector:
|
|
app: citus
|
|
ports:
|
|
- protocol: TCP
|
|
port: 5432
|
|
targetPort: 5432
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: citus-headless
|
|
spec:
|
|
selector:
|
|
app: citus
|
|
ports:
|
|
- protocol: TCP
|
|
port: 5432
|
|
targetPort: 5432
|
|
clusterIP: None # Headless service for direct pod access
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: citus
|
|
spec:
|
|
serviceName: citus-headless
|
|
replicas: 3 # Set the desired number of replicas
|
|
selector:
|
|
matchLabels:
|
|
app: citus
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: citus
|
|
spec:
|
|
containers:
|
|
- name: citus
|
|
image: citusdata/citus:latest
|
|
env:
|
|
- name: POSTGRES_DB
|
|
value: "payphone"
|
|
- name: POSTGRES_USER
|
|
value: "payphone"
|
|
- name: POSTGRES_PASSWORD
|
|
value: "payphone"
|
|
ports:
|
|
- containerPort: 5432
|
|
volumeMounts:
|
|
- name: citus-storage
|
|
mountPath: /var/lib/postgresql/data
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: citus-storage
|
|
spec:
|
|
accessModes: [ "ReadWriteOnce" ]
|
|
storageClassName: "standard" # Update based on your storage class
|
|
resources:
|
|
requests:
|
|
storage: 5Gi # Size for each pod's storage
|