Creating Db2 Warehouse NetworkPolicy resources on OpenShift HADR deployment upgrade
If you are upgrading from Db2 11.5.7.0-cn4 or earlier, you need to manually create
NetworkPolicy
resources before upgrading a Db2uCluster instance.
Before you begin
Set the following environment variables before starting this procedure:
- DB2UCLUSTER_PRIMARY="db2wh-primary"
- DB2UCLUSTER_STANDBY="db2wh-standby"
- DB2UCLUSTER_AUX1="db2wh-aux1"
- DB2UCLUSTER_AUX2="db2wh-aux2"
You can retrieve the Db2uCluster name by running the following
command:
oc get db2ucluster -n ${PROJECT_CPD_INST_OPERANDS}
Note: If
you do not have auxiliary standbys then do not set these environment variables.
About this task
Since the release of Db2
Warehouse 11.5.7.0-cn5, the Db2uCluster CR requires network
policies that permit HADR communication between deployments. You need to verify and create the
required NetworkPolicy
resources before upgrading your HADR Db2
Warehouse on
OpenShift deployment.
Procedure
Example
db2wh-primary
(See step 1):c-${DB2UCLUSTER_PRIMARY}-primary-hadr-ext formation_id=${DB2UCLUSTER_PRIMARY}-primary,type=engine
The
following example shows the definition that includes the network policy for the primary deployment
${DB2UCLUSTER_PRIMARY}-primary
(See step 3):oc apply -f - << EOF
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: c-${DB2UCLUSTER_PRIMARY}-primary-hadr-ext
spec:
ingress:
- ports:
- port: 60006
protocol: TCP
podSelector:
matchLabels:
formation_id: ${DB2UCLUSTER_PRIMARY}-primary
type: engine
policyTypes:
- Ingress
EOF