apiVersion: v1
kind: Pod
metadata:
  name: pgbench
spec:
  containers:
    - name: pgbench
      image: crunchydata/crunchy-pgbench:centos7-10.8-2.4.0
      command: ["/bin/sh"]
      args:
        - "-c"
        - "while true; do sleep 3600; done"
      env:
      - name: PG_DATABASE
        value: userdb
      - name: PG_HOSTNAME
        value: postgres-0.postgres
      - name: PG_USERNAME
        value: primaryuser
      - name: PG_PASSWORD
        value: password
      - name: PG_PORT
        value: "5432"
      - name: PGBENCH_SCALE
        value: "400"
  affinity:
    podAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchExpressions:
            - key: app
              operator: In
              values:
              - postgres
          topologyKey: kubernetes.io/hostname
