apiVersion: v1 kind: Service metadata: name: phoenix namespace: phoenix labels: app: phoenix annotations: prometheus.io/scrape: "true" prometheus.io/port: "9090" prometheus.io/path: "/metrics" spec: type: ClusterIP ports: - port: 6006 targetPort: 6006 name: http - port: 4317 targetPort: 4317 name: grpc - port: 9090 targetPort: 9090 name: metrics selector: app: phoenix --- apiVersion: apps/v1 kind: StatefulSet metadata: name: phoenix namespace: phoenix labels: app: phoenix spec: serviceName: phoenix replicas: 1 selector: matchLabels: app: phoenix template: metadata: labels: app: phoenix spec: initContainers: - name: wait-for-postgres image: busybox:1.36 command: - sh - -c - | echo "Waiting for PostgreSQL to be ready..." until nc -z postgres 5432; do echo "PostgreSQL is unavailable - sleeping" sleep 2 done echo "PostgreSQL is up - executing command" containers: - name: phoenix image: arizephoenix/phoenix:version-12.31.2 ports: - containerPort: 6006 name: http protocol: TCP - containerPort: 4317 name: grpc protocol: TCP - containerPort: 9090 name: metrics protocol: TCP envFrom: - configMapRef: name: phoenix-config - secretRef: name: phoenix-secret volumeMounts: - name: phoenix-data mountPath: /mnt/data resources: requests: memory: "512Mi" cpu: "500m" limits: memory: "2Gi" cpu: "2000m" readinessProbe: httpGet: path: / port: 6006 initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 5 successThreshold: 1 failureThreshold: 3 livenessProbe: httpGet: path: / port: 6006 initialDelaySeconds: 30 periodSeconds: 30 timeoutSeconds: 5 successThreshold: 1 failureThreshold: 3 startupProbe: httpGet: path: / port: 6006 initialDelaySeconds: 5 periodSeconds: 5 timeoutSeconds: 5 successThreshold: 1 failureThreshold: 30 volumeClaimTemplates: - metadata: name: phoenix-data spec: accessModes: ["ReadWriteOnce"] resources: requests: storage: 10Gi