Skip to content

Commit e2084d9

Browse files
authored
Merge pull request #7042 from EnterpriseDB/dev/cnp-7340
2 parents fdd327c + f6f9cda commit e2084d9

File tree

2 files changed

+161
-11
lines changed

2 files changed

+161
-11
lines changed

product_docs/docs/postgres_for_kubernetes/1/migrating_edb_registries.mdx

Lines changed: 81 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ Now, the {{name.ln}} and EDB Postgres Distributed for Kubernetes operators and a
2121
| docker.enterprisedb.com/anything_else | docker.enterprisedb.com/k8s |
2222
| quay.io/enterprisedb | docker.enterprisedb.com/k8s |
2323

24+
!!! Warning "Critical: Upgrade Failure Prevention"
25+
**You MUST update pull secrets BEFORE upgrading the operator.** Failure to do so will result in:
26+
27+
- Image pull failures during upgrade
28+
- Deployment failures
29+
- Potential downtime for your PostgreSQL clusters
30+
31+
Complete all migration steps in this guide before initiating any operator upgrade.
32+
2433
## Scope of changes
2534

2635
- **Pull secrets.** Because the old system relied on specifying the desired repository by username when authenticating, update the credentials stored in secrets that Kubernetes uses to pull images.
@@ -75,9 +84,18 @@ kubectl create secret -n pgd-operator-system docker-registry edb-pull-secret \
7584

7685
#### OpenShift pull secrets
7786

78-
The relevant pull secrets live in the `openshift-operators` namespace on OpenShift.
87+
!!! Important "OpenShift Installation Modes"
88+
The namespace where you create the pull secret depends on your operator
89+
installation mode. Check your installation mode in the OpenShift web console
90+
under `Operators → Installed Operators`.
91+
92+
##### Cluster-wide installation (All namespaces mode)
93+
94+
For cluster-wide installations, the operator runs in the `openshift-operators`
95+
namespace. Create the pull secret in this namespace.
7996

80-
For {{name.ln}} and operand images, you'll need to update `postgresql-operator-pull-secret`:
97+
For {{name.ln}} and operand images, you'll need to update
98+
`postgresql-operator-pull-secret`:
8199

82100
```shell
83101
oc create secret -n openshift-operators docker-registry postgresql-operator-pull-secret \
@@ -88,7 +106,8 @@ oc create secret -n openshift-operators docker-registry postgresql-operator-pull
88106
| oc apply -f -
89107
```
90108

91-
If you're using the EDB Postgres Distributed for Kubernetes operator, you'll ***also*** need to update `pgd-operator-pull-secret`:
109+
If you're using the EDB Postgres Distributed for Kubernetes operator,
110+
you'll ***also*** need to update `pgd-operator-pull-secret`:
92111

93112
```shell
94113
oc create secret -n openshift-operators docker-registry pgd-operator-pull-secret \
@@ -99,25 +118,81 @@ oc create secret -n openshift-operators docker-registry pgd-operator-pull-secret
99118
| oc apply -f -
100119
```
101120

121+
##### Namespace-specific installation (A specific namespace mode)
122+
123+
For namespace-specific installations, the operator runs in your chosen namespace
124+
(for example, `proj-dev`, `my-operators`, etc.). Create the pull secret in the
125+
**same namespace** where the operator is installed.
126+
127+
First, identify your operator's namespace:
128+
129+
```shell
130+
# Find the namespace where the operator is running
131+
oc get subscription cloud-native-postgresql -A \
132+
-o jsonpath='{.items[0].metadata.namespace}'
133+
```
134+
135+
Then create the pull secret in that namespace. Replace `<OPERATOR_NAMESPACE>`
136+
with your operator's namespace:
137+
138+
```shell
139+
oc create secret -n <OPERATOR_NAMESPACE> docker-registry postgresql-operator-pull-secret \
140+
--docker-server=docker.enterprisedb.com \
141+
--docker-username=k8s \
142+
--docker-password=${EDB_SUBSCRIPTION_TOKEN} \
143+
--dry-run=client -o=json \
144+
| oc apply -f -
145+
```
146+
147+
For example, if your operator is installed in the `proj-dev` namespace:
148+
149+
```shell
150+
oc create secret -n proj-dev docker-registry postgresql-operator-pull-secret \
151+
--docker-server=docker.enterprisedb.com \
152+
--docker-username=k8s \
153+
--docker-password=${EDB_SUBSCRIPTION_TOKEN} \
154+
--dry-run=client -o=json \
155+
| oc apply -f -
156+
```
157+
158+
If you're using the EDB Postgres Distributed for Kubernetes operator in a
159+
namespace-specific installation, also update `pgd-operator-pull-secret` in the
160+
same namespace:
161+
162+
```shell
163+
oc create secret -n <OPERATOR_NAMESPACE> docker-registry pgd-operator-pull-secret \
164+
--docker-server=docker.enterprisedb.com \
165+
--docker-username=k8s \
166+
--docker-password=${EDB_SUBSCRIPTION_TOKEN} \
167+
--dry-run=client -o=json \
168+
| oc apply -f -
169+
```
170+
171+
!!! Tip "Verifying pull secret creation"
172+
After creating the pull secret, verify it exists:
173+
```shell
174+
oc get secret postgresql-operator-pull-secret -n <NAMESPACE>
175+
```
176+
102177
### Updating Helm values
103178

104179
For your {{name.ln}} Helm releases, you'll need to update override values for both `image.repository` and `image.imageCredentials.username`:
105180

106181
```shell
107182
helm upgrade --reuse-values \
108-
--set image.repository=docker.enterprisedb.com/k8s/edb-postgres-for-kubernetes \
183+
--set image.repository=docker.enterprisedb.com/k8s/edb-postgres-for-cloudnativepg \
109184
--set image.imageCredentials.username=k8s \
110185
edb-pg4k \
111186
edb/edb-postgres-for-kubernetes
112187
```
113188

114189
(here, `edb-pg4k` and `edb/edb-postgres-for-kubernetes` are the release and pathname used in other examples; substitute your own values)
115190

116-
For your EDB Postgres Distributed for Kubernetes Helm releases, you'll need to override values for both `global.image.repository` and `image.imageCredentials.username`:
191+
For your EDB Postgres Distributed for Kubernetes Helm releases, you'll need to override values for both `global.repository` and `image.imageCredentials.username`:
117192

118193
```shell
119194
helm upgrade --reuse-values \
120-
--set global.image.repository=docker.enterprisedb.com/k8s \
195+
--set global.repository=docker.enterprisedb.com/k8s \
121196
--set image.imageCredentials.username=k8s \
122197
edb-pg4k-pgd \
123198
edb/edb-postgres-distributed-for-kubernetes

product_docs/docs/postgres_for_kubernetes/preview/migrating_edb_registries.mdx

Lines changed: 80 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ Now, the {{name.ln}} and EDB Postgres Distributed for Kubernetes operators and a
2121
| docker.enterprisedb.com/anything_else | docker.enterprisedb.com/k8s |
2222
| quay.io/enterprisedb | docker.enterprisedb.com/k8s |
2323

24+
!!! Warning "Critical: Upgrade Failure Prevention"
25+
**You MUST update pull secrets BEFORE upgrading the operator.** Failure to do so will result in:
26+
27+
- Image pull failures during upgrade
28+
- Deployment failures
29+
- Potential downtime for your PostgreSQL clusters
30+
31+
Complete all migration steps in this guide before initiating any operator upgrade.
32+
2433
## Scope of changes
2534

2635
- **Pull secrets.** Because the old system relied on specifying the desired repository by username when authenticating, update the credentials stored in secrets that Kubernetes uses to pull images.
@@ -75,9 +84,18 @@ kubectl create secret -n pgd-operator-system docker-registry edb-pull-secret \
7584

7685
#### OpenShift pull secrets
7786

78-
The relevant pull secrets live in the `openshift-operators` namespace on OpenShift.
87+
!!! Important "OpenShift Installation Modes"
88+
The namespace where you create the pull secret depends on your operator
89+
installation mode. Check your installation mode in the OpenShift web console
90+
under `Operators → Installed Operators`.
91+
92+
##### Cluster-wide installation (All namespaces mode)
93+
94+
For cluster-wide installations, the operator runs in the `openshift-operators`
95+
namespace. Create the pull secret in this namespace.
7996

80-
For {{name.ln}} and operand images, you'll need to update `postgresql-operator-pull-secret`:
97+
For {{name.ln}} and operand images, you'll need to update
98+
`postgresql-operator-pull-secret`:
8199

82100
```shell
83101
oc create secret -n openshift-operators docker-registry postgresql-operator-pull-secret \
@@ -88,7 +106,8 @@ oc create secret -n openshift-operators docker-registry postgresql-operator-pull
88106
| oc apply -f -
89107
```
90108

91-
If you're using the EDB Postgres Distributed for Kubernetes operator, you'll ***also*** need to update `pgd-operator-pull-secret`:
109+
If you're using the EDB Postgres Distributed for Kubernetes operator,
110+
you'll ***also*** need to update `pgd-operator-pull-secret`:
92111

93112
```shell
94113
oc create secret -n openshift-operators docker-registry pgd-operator-pull-secret \
@@ -99,6 +118,62 @@ oc create secret -n openshift-operators docker-registry pgd-operator-pull-secret
99118
| oc apply -f -
100119
```
101120

121+
##### Namespace-specific installation (A specific namespace mode)
122+
123+
For namespace-specific installations, the operator runs in your chosen namespace
124+
(for example, `proj-dev`, `my-operators`, etc.). Create the pull secret in the
125+
**same namespace** where the operator is installed.
126+
127+
First, identify your operator's namespace:
128+
129+
```shell
130+
# Find the namespace where the operator is running
131+
oc get subscription cloud-native-postgresql -A \
132+
-o jsonpath='{.items[0].metadata.namespace}'
133+
```
134+
135+
Then create the pull secret in that namespace. Replace `<OPERATOR_NAMESPACE>`
136+
with your operator's namespace:
137+
138+
```shell
139+
oc create secret -n <OPERATOR_NAMESPACE> docker-registry postgresql-operator-pull-secret \
140+
--docker-server=docker.enterprisedb.com \
141+
--docker-username=k8s \
142+
--docker-password=${EDB_SUBSCRIPTION_TOKEN} \
143+
--dry-run=client -o=json \
144+
| oc apply -f -
145+
```
146+
147+
For example, if your operator is installed in the `proj-dev` namespace:
148+
149+
```shell
150+
oc create secret -n proj-dev docker-registry postgresql-operator-pull-secret \
151+
--docker-server=docker.enterprisedb.com \
152+
--docker-username=k8s \
153+
--docker-password=${EDB_SUBSCRIPTION_TOKEN} \
154+
--dry-run=client -o=json \
155+
| oc apply -f -
156+
```
157+
158+
If you're using the EDB Postgres Distributed for Kubernetes operator in a
159+
namespace-specific installation, also update `pgd-operator-pull-secret` in the
160+
same namespace:
161+
162+
```shell
163+
oc create secret -n <OPERATOR_NAMESPACE> docker-registry pgd-operator-pull-secret \
164+
--docker-server=docker.enterprisedb.com \
165+
--docker-username=k8s \
166+
--docker-password=${EDB_SUBSCRIPTION_TOKEN} \
167+
--dry-run=client -o=json \
168+
| oc apply -f -
169+
```
170+
171+
!!! Tip "Verifying pull secret creation"
172+
After creating the pull secret, verify it exists:
173+
```shell
174+
oc get secret postgresql-operator-pull-secret -n <NAMESPACE>
175+
```
176+
102177
### Updating Helm values
103178

104179
For your {{name.ln}} Helm releases, you'll need to update override values for both `image.repository` and `image.imageCredentials.username`:
@@ -113,11 +188,11 @@ helm upgrade --reuse-values \
113188

114189
(here, `edb-pg4k` and `edb/edb-postgres-for-kubernetes` are the release and repository path name used in other examples; substitute your own values)
115190

116-
For your EDB Postgres Distributed for Kubernetes Helm releases, you'll need to override values for both `global.image.repository` and `image.imageCredentials.username`:
191+
For your EDB Postgres Distributed for Kubernetes Helm releases, you'll need to override values for both `global.repository` and `image.imageCredentials.username`:
117192

118193
```shell
119194
helm upgrade --reuse-values \
120-
--set global.image.repository=docker.enterprisedb.com/k8s \
195+
--set global.repository=docker.enterprisedb.com/k8s \
121196
--set image.imageCredentials.username=k8s \
122197
edb-pg4k-pgd \
123198
edb/edb-postgres-distributed-for-kubernetes

0 commit comments

Comments
 (0)