Skip to content

Passing metrics flag when creating cluster doesn't create metrics sidecar #229

@rblaine95

Description

@rblaine95

After deploying PGO Version 3.0 on OpenShift Origin 3.9, creating a cluster with -m or --metrics flag creates a primary postgres cluster with no metrics sidecar.

If I exec into the pod and curl 127.0.0.1:9100/metrics or 127.0.0.1:9187/metrics I get connection refused, but if I curl 127.0.0.1:5432 I get an empty response (meaning a connection was made but nothing returned for obvious reasons).

$ pgo version

pgo client version 3.0
apiserver version 3.0
$ pgo create cluster testcluster --metrics
$ oc get pods

NAME                                          READY     STATUS    RESTARTS   AGE
postgres-operator-85ddd7768f-5fgjv            2/2       Running   0          2m
testcluter-75bcf44d5f-zb7cv                   1/1       Running   0          1m
$ oc version

oc v3.9.0+191fece
kubernetes v1.9.1+a0ce1bc657
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://127.0.0.1:8443 # because I'm using oc cluster up for testing purposes
openshift v3.9.0+46ff3a0-18
kubernetes v1.9.1+a0ce1bc657
$ oc describe pod testcluter-75bcf44d5f-zb7cv

Name:           testcluter-75bcf44d5f-zb7cv
Namespace:      crunchy-postgres
Node:           localhost/192.168.11.132
Start Time:     Tue, 22 May 2018 15:56:19 +0200
Labels:         archive=false
                archive-timeout=60
                crunchy_collect=true
                name=testcluter
                pg-cluster=testcluter
                pod-template-hash=3167900819
                primary=true
                replica=false
                vendor=crunchydata
Annotations:    openshift.io/scc=restricted
Status:         Running
IP:             172.17.0.15
Controlled By:  ReplicaSet/testcluter-75bcf44d5f
Containers:
  database:
    Container ID:   docker://f751b3e3d0148640eb364919ff96748309f8688d1b0794c7f73beac015368247
    Image:          crunchydata/crunchy-postgres:centos7-10.4-1.8.3
    Image ID:       docker-pullable://crunchydata/crunchy-postgres@sha256:7cb942d5894cc67f2bb5e0622696f71b53ea34f914cc92c9a7a4ad3a2c6bfcb0
    Port:           5432/TCP
    State:          Running
      Started:      Tue, 22 May 2018 15:56:21 +0200
    Ready:          True
    Restart Count:  0
    Readiness:      exec [/opt/cpm/bin/readiness.sh] delay=15s timeout=8s period=10s #success=1 #failure=3
    Environment:
      PG_PRIMARY_PORT:       5432
      PG_MODE:               primary
      PG_PRIMARY_HOST:       testcluter
      PG_LOCALE:             en_US.UTF8
      BACKUP_PATH:           
      PGDATA_PATH_OVERRIDE:  testcluter
      PG_DATABASE:           userdb
      ARCHIVE_MODE:          off
      ARCHIVE_TIMEOUT:       60
      PGHOST:                /tmp
      collect:               
    Mounts:
      /backrestrepo from backrestrepo-volume (rw)
      /backup from backup (ro)
      /pgconf from pgconf-volume (rw)
      /pgdata from pgdata (rw)
      /pgprimary from primary-volume (rw)
      /pgroot from root-volume (rw)
      /pguser from user-volume (rw)
      /pgwal from pgwal-volume (rw)
      /recover from recover-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-5k5dv (ro)
Conditions:
  Type           Status
  Initialized    True 
  Ready          True 
  PodScheduled   True 
Volumes:
  pgdata:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  testcluter
    ReadOnly:   false
  backup:
    Type:    EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:  
  user-volume:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  testcluter-testuser-secret
    Optional:    false
  primary-volume:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  testcluter-primaryuser-secret
    Optional:    false
  root-volume:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  testcluter-postgres-secret
    Optional:    false
  pgwal-volume:
    Type:    EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:  
  backrestrepo-volume:
    Type:    EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:  Memory
  recover-volume:
    Type:    EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:  Memory
  pgconf-volume:
    Type:    EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:  Memory
  default-token-5k5dv:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-5k5dv
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     <none>
Events:
  Type    Reason                 Age   From                Message
  ----    ------                 ----  ----                -------
  Normal  Scheduled              1m    default-scheduler   Successfully assigned testcluter-75bcf44d5f-zb7cv to localhost
  Normal  SuccessfulMountVolume  1m    kubelet, localhost  MountVolume.SetUp succeeded for volume "user-volume"
  Normal  SuccessfulMountVolume  1m    kubelet, localhost  MountVolume.SetUp succeeded for volume "pv0057"
  Normal  SuccessfulMountVolume  1m    kubelet, localhost  MountVolume.SetUp succeeded for volume "backup"
  Normal  SuccessfulMountVolume  1m    kubelet, localhost  MountVolume.SetUp succeeded for volume "recover-volume"
  Normal  SuccessfulMountVolume  1m    kubelet, localhost  MountVolume.SetUp succeeded for volume "backrestrepo-volume"
  Normal  SuccessfulMountVolume  1m    kubelet, localhost  MountVolume.SetUp succeeded for volume "root-volume"
  Normal  SuccessfulMountVolume  1m    kubelet, localhost  MountVolume.SetUp succeeded for volume "pgwal-volume"
  Normal  SuccessfulMountVolume  1m    kubelet, localhost  MountVolume.SetUp succeeded for volume "default-token-5k5dv"
  Normal  SuccessfulMountVolume  1m    kubelet, localhost  MountVolume.SetUp succeeded for volume "primary-volume"
  Normal  SuccessfulMountVolume  1m    kubelet, localhost  (combined from similar events): MountVolume.SetUp succeeded for volume "pgconf-volume"
  Normal  Pulled                 1m    kubelet, localhost  Container image "crunchydata/crunchy-postgres:centos7-10.4-1.8.3" already present on machine
  Normal  Created                59s   kubelet, localhost  Created container
  Normal  Started                59s   kubelet, localhost  Started container

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions