Creating Db2 Warehouse NetworkPolicy resources on OpenShift HADR deployment upgrade
Important: IBM Cloud Pak for Data
Version 4.8 will reach end of support (EOS) on 31 July, 2025. For more information, see the Discontinuance of service announcement for IBM Cloud Pak for Data Version 4.X.
Upgrade to IBM Software Hub Version 5.1 before IBM Cloud Pak for Data Version 4.8 reaches end of support. For more information, see Upgrading from IBM Cloud Pak for Data Version 4.8 to IBM Software Hub Version 5.1.
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=engineThe
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