# PostgreSQL operator pods fail to come up

**URL:** <https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614>\
**Category:** Percona Operator for PostgreSQL\
**Created:** [January 13, 2023, 5:12pm UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614 "2023-01-13T17:12:21Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![Ravi\_Kumar\_Pokala](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ravi_kumar_pokala/32/8780_2.png) [@Ravi\_Kumar\_Pokala](https://forums.percona.com/u/Ravi_Kumar_Pokala)\
**Post date:** [February 6, 2023, 5:17pm UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/21 "2023-02-06T17:17:29Z")

</div>

> kd role/pgo-target-role -n percona-pgo  
> Name: pgo-target-role  
> Labels: vendor=crunchydata  
> Annotations:   
> PolicyRule:  
> Resources Non-Resource URLs Resource Names Verbs

* * *

configmaps [get list watch create patch update delete deletecollection]  
endpoints [get list watch create patch update delete deletecollection]  
persistentvolumeclaims [get list watch create patch update delete deletecollection]  
pods/exec [get list watch create patch update delete deletecollection]  
pods [get list watch create patch update delete deletecollection]  
secrets [get list watch create patch update delete deletecollection]  
services [get list watch create patch update delete deletecollection]  
deployments.apps [get list watch create patch update delete deletecollection]  
replicasets.apps [get list watch create patch update delete deletecollection]  
jobs.batch [get list watch create patch update delete deletecollection]  
[pgclusters.crunchydata.com](http://pgclusters.crunchydata.com) [get list watch create patch update delete deletecollection]  
[pgpolicies.crunchydata.com](http://pgpolicies.crunchydata.com) [get list watch create patch update delete deletecollection]  
[pgreplicas.crunchydata.com](http://pgreplicas.crunchydata.com) [get list watch create patch update delete deletecollection]  
[pgtasks.crunchydata.com](http://pgtasks.crunchydata.com) [get list watch create patch update delete deletecollection]  
pods/log [get list watch]

---

<div class="post-metadata">

**Author:** ![Ravi\_Kumar\_Pokala](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ravi_kumar_pokala/32/8780_2.png) [@Ravi\_Kumar\_Pokala](https://forums.percona.com/u/Ravi_Kumar_Pokala)\
**Post date:** [February 6, 2023, 5:20pm UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/22 "2023-02-06T17:20:20Z")

</div>

[pgo-deploy-logs.txt](https://forums.percona.com/uploads/short-url/6dYhEqOtDHWWK5RMcURRqciWMec.txt) (13.5 KB)  
@Sergey_Pronin : Please find the attached logs from the pgo-deploy pod.

---

<div class="post-metadata">

**Author:** ![Ravi\_Kumar\_Pokala](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ravi_kumar_pokala/32/8780_2.png) [@Ravi\_Kumar\_Pokala](https://forums.percona.com/u/Ravi_Kumar_Pokala)\
**Post date:** [February 10, 2023, 12:30am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/23 "2023-02-10T00:30:36Z")

</div>

@Sergey_Pronin : I am looking for your help in resolving this issue.

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [February 10, 2023, 7:57am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/24 "2023-02-10T07:57:26Z")

</div>

Hey Ravi,

I will ask someone from the team to look into it. Seems you are hitting issues that are specific to your k8s deployment and it is not something that can be easily solved through a forum.

---

<div class="post-metadata">

**Author:** ![Ravi\_Kumar\_Pokala](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ravi_kumar_pokala/32/8780_2.png) [@Ravi\_Kumar\_Pokala](https://forums.percona.com/u/Ravi_Kumar_Pokala)\
**Post date:** [February 13, 2023, 4:24am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/25 "2023-02-13T04:24:47Z")

</div>

@Sergey_Pronin : Thank you for following up with your team, I appreciate it.

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [February 13, 2023, 8:13am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/26 "2023-02-13T08:13:29Z")

</div>

Hey @Ilford ,

actually you can install the operator through a helm chart.  
See this doc: [Install with Helm - Percona Operator for PostgreSQL](https://docs.percona.com/percona-operator-for-postgresql/2.0/helm.html)

You just need to set a version.

---

<div class="post-metadata">

**Author:** ![Roua\_Saad](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roua_saad/32/9905_2.png) [@Roua\_Saad](https://forums.percona.com/u/Roua_Saad)\
**Post date:** [March 29, 2023, 6:48am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/27 "2023-03-29T06:48:41Z")

</div>

Hello @Ravi_Kumar_Pokala , were you able to solve the issue? I am facing similar error when deploying the operator

---

<div class="post-metadata">

**Author:** ![Ravi\_Kumar\_Pokala](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ravi_kumar_pokala/32/8780_2.png) [@Ravi\_Kumar\_Pokala](https://forums.percona.com/u/Ravi_Kumar_Pokala)\
**Post date:** [March 29, 2023, 4:21pm UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/28 "2023-03-29T16:21:23Z")

</div>

No, looks like operators need some changes to work.

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [March 30, 2023, 3:19pm UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/29 "2023-03-30T15:19:04Z")

</div>

@Roua_Saad can you tell me more about your environment? Kubernetes version, the way you deploy the cluster, steps to reproduce the issue?

---

<div class="post-metadata">

**Author:** ![Roua\_Saad](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roua_saad/32/9905_2.png) [@Roua\_Saad](https://forums.percona.com/u/Roua_Saad)\
**Post date:** [March 31, 2023, 7:15am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/30 "2023-03-31T07:15:13Z")

</div>

Sure! I was deploying Percona operator of version 1.2.0 in Openshift I followed this link [Install on OpenShift - Percona Operator for PostgreSQL](https://docs.percona.com/percona-operator-for-postgresql/openshift.html) for the deployment and I used the same yaml files (for operator.yaml and cr.yaml) used with some modifications (namespace, images point it out to the image streams in the project);  
the operator job was initialized (pgo-deploy) with its associated deployment pod ( with the 4 containers : apiserver , operator scheduler and event).  
However when I deployed the cr.yaml file for Percona Distribution for PostgreSQL the Pgcluster and Pgreplica along with pgbouncer and so on were not created (no pods were initialized, expected to have as deployments postgres-cs-backrest-shared-repo, postgres-cs-pgbouncer, postgres-cs-repl1, postgres-cs-repl2 and postgres-cs).

---

<div class="post-metadata">

**Author:** ![Roua\_Saad](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roua_saad/32/9905_2.png) [@Roua\_Saad](https://forums.percona.com/u/Roua_Saad)\
**Post date:** [March 31, 2023, 7:18am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/31 "2023-03-31T07:18:47Z")

</div>

So I looked into the operator container logs and I saw the following error:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/c/cd8f08fd7d74183c8a8719d3b41a4646198c183b.png)

oc apply -f operator.yaml –as=system:admin

## Kindly find the operator yaml file: apiVersion: v1 kind: ServiceAccount metadata: name: pgo-deployer-sa

kind: ClusterRole  
apiVersion`: rbac.authorization.k8s.io/v1`  
metadata:  
name: pgo-deployer-cr  
rules:

- apiGroups:
  - ‘’  
resources:
  - namespaces  
verbs:
  - get
  - list
  - watch
  - create
  - update
  - delete

- apiGroups:
  - ‘’  
resources:
  - serviceaccounts  
verbs:
  - get
  - create
  - update
  - delete

- apiGroups:  
` - rbac.authorization.k8s.io`  
resources:
  - roles
  - rolebindings  
verbs:
  - get
  - create
  - update
  - delete

- apiGroups:
  - ‘’  
resources:
  - configmaps
  - endpoints
  - pods
  - pods/exec
  - secrets
  - services
  - persistentvolumeclaims  
verbs:
  - get
  - list
  - watch
  - create
  - patch
  - update
  - delete
  - deletecollection

- apiGroups:
  - ‘’  
resources:
    - pods/log  
verbs:
    - get
    - list
    - watch

- apiGroups:
  - apps  
resources:
  - deployments
  - replicasets  
verbs:
  - get
  - list
  - watch
  - create
  - patch
  - update
  - delete
  - deletecollection

- apiGroups:
  - batch  
resources:
  - jobs  
verbs:
  - get
  - list
  - watch
  - create
  - patch
  - update
  - delete
  - deletecollection

- apiGroups:
  - [pg.percona.com](http://pg.percona.com)  
resources:
  - perconapgclusters
  - pgclusters
  - pgpolicies
  - pgreplicas
  - pgtasks  
verbs:
  - get
  - list
  - watch
  - create
  - patch
  - update
  - delete
  - deletecollection

* * *

apiVersion: v1  
kind: ConfigMap  
metadata:  
name: pgo-deployer-cm  
data:  
values.yaml: |-  
archive\_mode: “true”  
archive\_timeout: “60”  
ccp\_image\_pull\_secret: “”  
ccp\_image\_pull\_secret\_manifest: “”  
create\_rbac: “true”  
delete\_operator\_namespace: “false”  
delete\_watched\_namespaces: “false”  
disable\_telemetry: “false”  
namespace: “bsaf-preprod-consumer”  
namespace\_mode: “disabled”  
pgo\_image\_prefix: “bsaf-preprod-consumer/percona-postgresql-operator”  
pgo\_image\_pull\_policy: “Always”  
pgo\_image\_pull\_secret: “”  
pgo\_image\_pull\_secret\_manifest: “”  
pgo\_image\_tag: “1.2.0”  
pgo\_installation\_name: “devtest”  
pgo\_admin\_password: “examplepassword”  
pgo\_admin\_perms: “\*”  
pgo\_admin\_role\_name: “pgoadmin”  
pgo\_admin\_username: “admin”  
ccp\_image\_prefix: “bsaf-preprod-consumer/percona-postgresql-operator”  
ccp\_image\_tag: “1.2.0-postgres-ha”  
disable\_auto\_failover: “false”  
db\_name: “”  
db\_password\_age\_days: “0”  
db\_password\_length: “24”  
backup\_storage: “default”  
primary\_storage: “default”  
replica\_storage: “default”  
pgo\_client\_version: “4.7.1”  
pgbadgerport: “10000”  
sync\_replication: “false”  
exporterport: “9187”  
scheduler\_timeout: “3600”  
db\_password\_length: “24”  
db\_port: “5432”  
db\_replicas: “0”  
db\_user: “testuser”  
badger: “false”  
metrics: “true”  
backrest\_storage: “default”  
wal\_storage: “”  
pgadmin\_storage: “default”  
pgo\_operator\_namespace: “bsaf-preprod-consumer”

* * *

apiVersion: `rbac.authorization.k8s.io/v1`  
kind: ClusterRoleBinding  
metadata:  
name: pgo-deployer-crb  
roleRef:  
apiGroup:` rbac.authorization.k8s.io`  
kind: ClusterRole  
name: pgo-deployer-cr  
subjects:

- kind: ServiceAccount  
name: pgo-deployer-sa  
namespace: bsaf-preprod-consumer

* * *

apiVersion: batch/v1  
kind: Job  
metadata:  
name: pgo-deploy  
spec:  
backoffLimit: 0  
template:  
metadata:  
name: pgo-deploy  
spec:  
serviceAccountName: pgo-deployer-sa  
restartPolicy: Never  
containers:  
- name: pgo-deploy  
image: bsaf-preprod-consumer/percona-postgresql-operator:1.2.0-pgo-deployer  
imagePullPolicy: Always  
resources:  
limits:  
cpu: ‘2’  
memory: 2Gi  
requests:  
cpu: ‘1’  
memory: 1Gi  
env:  
- name: DEPLOY\_ACTION  
value: install  
volumeMounts:  
- name: deployer-conf  
mountPath: “/conf”  
volumes:  
- name: deployer-conf  
configMap:  
name: pgo-deployer-cm

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [April 7, 2023, 10:27am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/32 "2023-04-07T10:27:01Z")

</div>

@Roua_Saad seems that you forgot to set the namespace during apply.  
As you see in the yaml the namespace is set only in a couple of places. Could you please make sure that you specify it as well during apply?

`oc apply -n bsaf-preprod-consumer -f operator.yaml –as=system:admin`

---

<div class="post-metadata">

**Author:** ![Roua\_Saad](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roua_saad/32/9905_2.png) [@Roua\_Saad](https://forums.percona.com/u/Roua_Saad)\
**Post date:** [April 7, 2023, 10:32am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/33 "2023-04-07T10:32:34Z")

</div>

@Sergey_Pronin yes I’ve deployed it using the correct namespace and the job appeared on the right project with the error provided earlier

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [April 7, 2023, 10:37am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/34 "2023-04-07T10:37:27Z")

</div>

@Roua_Saad did you run the command as I explained, specifying the namespace? If you did not, than service account is in the wrong namespace.

---

<div class="post-metadata">

**Author:** ![Roua\_Saad](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roua_saad/32/9905_2.png) [@Roua\_Saad](https://forums.percona.com/u/Roua_Saad)\
**Post date:** [April 7, 2023, 10:49am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/35 "2023-04-07T10:49:51Z")

</div>

@Sergey_Pronin I did apply the command that you provided,but the pod of the job pgo-deployer kept failing with the following error in the logs:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/7/7334abb04685abbb10acb51fad7aa8d34190e064.png)

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [April 10, 2023, 6:37am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/36 "2023-04-10T06:37:07Z")

</div>

@Roua_Saad there can be two reasons to that:

1. service account was modified
2. service account was not created or created in another namespace

I would encourage you to start from a clean slate - delete everything and ensure you set namespace correctly.

We can jump into a quick call to discuss it and see what is happening.

---

<div class="post-metadata">

**Author:** ![Roua\_Saad](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roua_saad/32/9905_2.png) [@Roua\_Saad](https://forums.percona.com/u/Roua_Saad)\
**Post date:** [April 10, 2023, 6:43am UTC](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614/37 "2023-04-10T06:43:04Z")

</div>

@Sergey_Pronin, thank you for following up, I’ll delete everything and attempt to redeploy it once more to see the outcome.

[Previous page](https://forums.percona.com/t/postgresql-operator-pods-fail-to-come-up/19614.md?page=1)
