Skip to content

Instantly share code, notes, and snippets.

@haroonb
Created June 15, 2020 14:09
Show Gist options
  • Save haroonb/5a955dc7ddd414cf0cafa62fb6738aed to your computer and use it in GitHub Desktop.
Save haroonb/5a955dc7ddd414cf0cafa62fb6738aed to your computer and use it in GitHub Desktop.
pgpool-2 k8s
kubectl logs pgpool-846569b89c-kp9zr pgpool
2020-06-15 14:05:25: pid 10: FATAL: 0 is outside the valid range for parameter "backend_port0" (1024 .. 65535)
apiVersion: apps/v1
kind: Deployment
metadata:
name: pgpool
spec:
replicas: 1
selector:
matchLabels:
app: pgpool
template:
metadata:
labels:
app: pgpool
spec:
containers:
- name: pgpool
image: pgpool/pgpool:4.1
env:
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: postgres.acid-postgres-cluster.credentials
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres.acid-postgres-cluster.credentials
key: password
- name: PGPOOL_PARAMS_BACKEND_HOSTNAME0
value: "acid-postgres-cluster.default.svc.cluster.local"
- name: PGPOOL_PARAMS_BACKEND_HOSTNAME1
value: "acid-postgres-cluster-repl.default.svc.cluster.local"
- name: PGPOOL_PARAMS_BACKEND_APPLICATION_NAME0
value: "acid-postgres-cluster"
- name: PGPOOL_PARAMS_BACKEND_APPLICATION_NAME1
value: "acid-postgres-cluster-repl"
- name: backend_port0
value: "5432"
- name: backend_port1
value: "5432"
- name: pgpool-stats
image: pgpool/pgpool2_exporter:1.0
env:
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: postgres.acid-postgres-cluster.credentials
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgres.acid-postgres-cluster.credentials
key: password
- name: PGPOOL_SERVICE
value: "localhost"
---
apiVersion: v1
kind: Service
metadata:
name: pgpool
spec:
selector:
app: pgpool
ports:
- name: pgpool-port
protocol: TCP
port: 9999
targetPort: 9999
---
apiVersion: v1
kind: Service
metadata:
name: pgpool-stats
labels:
app: pgpool-stats
annotations:
prometheus.io/path: /metrics
prometheus.io/port: "9719"
prometheus.io/scrape: "true"
spec:
selector:
app: pgpool
ports:
- name: pgpool-stats-port
protocol: TCP
port: 9719
targetPort: 9719
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment