Skip to content

Commit

Permalink
feat: Upgrade Cloud Pak for Data 4.7.1
Browse files Browse the repository at this point in the history
Signed-off-by: Denilson Nastacio <[email protected]>
  • Loading branch information
nastacio committed Aug 25, 2023
1 parent f4da5af commit 166d9dc
Show file tree
Hide file tree
Showing 17 changed files with 219 additions and 136 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Supported versions:
| Cloud Pak | Version | Installation mode |
| ----------|---------|-------------------|
| Cloud Pak for Business Automation | [22.0.2](https://www.ibm.com/docs/en/cloud-paks/cp-biz-automation/22.0.2) | Multi-pattern starter deployment |
| Cloud Pak for Data | [4.6.6](https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=overview) | Online, specialized installation |
| Cloud Pak for Data | [4.7.1](https://www.ibm.com/docs/en/cloud-paks/cp-data/4.7.x?topic=overview) | Online, specialized installation |
| Cloud Pak for Integration | [2023.2](https://www.ibm.com/docs/en/cloud-paks/cp-integration/2023.2) | Online installation |
| Cloud Pak for Security | [1.10.12](https://www.ibm.com/docs/en/cloud-paks/cp-security/1.10) | Online installation |
| Cloud Pak for Watson AIOps | [4.1.0](https://www.ibm.com/docs/en/cloud-paks/cloud-pak-watson-aiops/4.1.0) | Online Installation |
Expand Down
4 changes: 2 additions & 2 deletions config/argocd-cloudpaks/cp4d/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.7.0
version: 0.8.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "1.4.2"
appVersion: "1.5.1"
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{ if not ( eq ( default "" .Values.metadata.argocd_app_namespace ) "ibm-cloudpaks" ) }}
{{ if not ( eq ( default "" .Values.metadata.operators_namespace ) "ibm-cloudpaks" ) }}
---
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: {{.Values.metadata.argocd_app_namespace}}
name: {{.Values.metadata.operators_namespace}}
spec: {}
status: {}
{{ end }}
7 changes: 4 additions & 3 deletions config/argocd-cloudpaks/cp4d/templates/0100-cp4d-app.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
Expand Down Expand Up @@ -29,10 +28,12 @@ spec:
value: "{{.Values.iam_integration}}"
- name: metadata.argocd_app_namespace
value: {{.Values.metadata.argocd_app_namespace}}
- name: metadata.common_services_namespace
value: {{.Values.metadata.common_services_namespace}}
- name: metadata.image_arch
value: {{.Values.metadata.image_arch}}
- name: metadata.operators_namespace
value: {{.Values.metadata.operators_namespace}}
- name: metadata.operands_namespace
value: {{.Values.metadata.operands_namespace}}
- name: repoURL
value: ${ARGOCD_APP_SOURCE_REPO_URL}
- name: serviceaccount.argocd_application_controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ spec:
value: "{{.Values.iam_integration}}"
- name: metadata.argocd_app_namespace
value: {{.Values.metadata.argocd_app_namespace}}
- name: metadata.common_services_namespace
value: {{.Values.metadata.common_services_namespace}}
- name: metadata.image_arch
value: {{.Values.metadata.image_arch}}
- name: metadata.operators_namespace
value: {{.Values.metadata.operators_namespace}}
- name: metadata.operands_namespace
value: {{.Values.metadata.operands_namespace}}
- name: repoURL
value: ${ARGOCD_APP_SOURCE_REPO_URL}
- name: serviceaccount.argocd_application_controller
Expand Down
10 changes: 6 additions & 4 deletions config/argocd-cloudpaks/cp4d/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ serviceaccount:
metadata:
argocd_app_namespace: cp4d
argocd_namespace: openshift-gitops
common_services_namespace: cp4d
operators_namespace: cp4d
operands_namespace: cp4d-operands

# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=information-determining-which-components-install
components: cpfs,scheduler,cpd_platform,rstudio,wml,ws
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.7.x?topic=information-determining-which-components-install
components: ibm-cert-manager,ibm-licensing,cpfs,cpd_platform,rstudio,wml,ws

storageclass:
rwo: ocs-storagecluster-ceph-rbd
rwx: ocs-storagecluster-cephfs

iam_integration: true

version: 4.6.6
image_arch: amd64

version: 4.7.1
4 changes: 2 additions & 2 deletions config/cloudpaks/cp4d/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.6.0
version: 0.7.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 4.6.6
appVersion: 4.7.1
8 changes: 8 additions & 0 deletions config/cloudpaks/cp4d/templates/0000-operands-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: {{.Values.metadata.operands_namespace}}
spec: {}
status: {}
10 changes: 0 additions & 10 deletions config/cloudpaks/cp4d/templates/0000-operators-namespace.yaml

This file was deleted.

123 changes: 107 additions & 16 deletions config/cloudpaks/cp4d/templates/0090-sync-cluster-setup.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=information-setting-up-installation-environment-variables
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.7.x?topic=information-setting-up-installation-environment-variables
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -13,10 +13,21 @@ spec:
spec:
containers:
- name: configure-cluster
image: icr.io/cpopen/cpd/olm-utils:latest
# Image associated with CPD CLI v13.0.1 @ https://github.com/IBM/cpd-cli/releases/tag/v13.0.1
image: icr.io/cpopen/cpd/olm-utils-v2@sha256:7620c112def44374b9f53a8b5b3ef609be6d3a76fdd48b06f48e13ea3498a8f7
env:
- name: PROJECT_CERT_MANAGER
value: ibm-cert-manager
- name: PROJECT_LICENSE_SERVICE
value: ibm-licensing
- name: PROJECT_SCHEDULING_SERVICE
value: cpd-scheduler
- name: VERSION
value: {{.Values.version}}
- name: COMPONENTS
value: {{.Values.components}}
- name: IMAGE_ARCH
value: {{.Values.image_arch}}
command:
- /bin/bash
- -c
Expand All @@ -26,6 +37,34 @@ spec:
result=0
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.7.x?topic=cluster-installing-shared-components
bin/apply-cluster-components \
--release=${VERSION:?} \
--license_acceptance=true \
--cert_manager_ns=${PROJECT_CERT_MANAGER:?} \
--licensing_ns=${PROJECT_LICENSE_SERVICE:?} \
&& echo "INFO: Cert Manager and Licensing service installed." \
&& bin/apply-scheduler \
--release=${VERSION} \
--license_acceptance=true \
--scheduler_ns=${PROJECT_SCHEDULING_SERVICE:?} \
&& echo "INFO: Scheduling service installed." \
|| result=1
if [[ ${COMPONENTS:?} =~ cognos_analytics ]] \
|| [[ ${COMPONENTS} =~ dv ]] \
|| [[ ${COMPONENTS} =~ db2 ]] \
|| [[ ${COMPONENTS} =~ bigsql ]] \
|| [[ ${COMPONENTS} =~ watson_discovery ]] \
|| [[ ${COMPONENTS} =~ wkc ]] \
|| [[ ${COMPONENTS} =~ ws ]] \
|| [[ ${COMPONENTS} =~ wml_accelerator ]]; then
echo "INFO: Must update CRI-O container settings depending on the target env."
else
echo "INFO: None of the components to be installed require crio-changes"
exit 0
fi
OPENSHIFT_TYPE=self-managed
platform=$(oc get Infrastructure cluster -o jsonpath={.status.platform})
case "${platform}" in
Expand All @@ -46,23 +85,75 @@ spec:
OPENSHIFT_TYPE=self-managed
esac
ocp_version=$(oc get ClusterVersion version -o jsonpath='{.status.desired.version}' | cut -d "." -f 1,2)
if [ -z "${ocp_version}" ]; then
echo "ERROR: Unable to determine cluster version for ${cluster_name}"
exit 1
fi
hypershift_deployment=$(oc get Infrastructure cluster \
-o jsonpath='{.metadata.labels.hypershift\.openshift\.io/managed}')
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=settings-changing-cri-o-container
if [ "${OPENSHIFT_TYPE}" != "roks" ] && [ -z "${hypershift_deployment}" ]; then
if [[ ${COMPONENTS} =~ cognos_analytics ]] \
|| [[ ${COMPONENTS} =~ dv ]] \
|| [[ ${COMPONENTS} =~ db2 ]] \
|| [[ ${COMPONENTS} =~ bigsql ]] \
|| [[ ${COMPONENTS} =~ watson_discovery ]] \
|| [[ ${COMPONENTS} =~ wkc ]] \
|| [[ ${COMPONENTS} =~ ws ]] \
|| [[ ${COMPONENTS} =~ wml_accelerator ]]; then
echo "INFO: Changing CRI-O container settings"
bin/apply-crio --openshift-type=${OPENSHIFT_TYPE} --extra-vars="pid_limit=16384" \
|| result=1
fi
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.7.x?topic=settings-changing-cri-o-container
crio="none"
if [ -n "${hypershift_deployment}" ]; then
crio="none"
elif [ "${OPENSHIFT_TYPE}" == "roks" ]; then
crio="none"
elif [ "${platform}" == "Azure" ]; then
crio="azure"
elif [ "${OPENSHIFT_TYPE}" == "self-managed" ] && [ "${ocp_version}" == "4.10" ]; then
crio="pid"
elif [ "${OPENSHIFT_TYPE}" == "self-managed" ] && [ "${ocp_version}" == "4.12" ]; then
crio="kubelet"
fi
if [ "${crio}" == "pid" ]; then
echo "INFO: Changing CRI-O container settings"
bin/apply-crio --openshift-type=${OPENSHIFT_TYPE} \
|| result=1
elif [ "${crio}" == "kubelet" ]; then
oc label machineconfigpool worker custom-crio=pid-limit --overwrite \
&& oc apply -f - << EOF
apiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
metadata:
name: cpd-crio-kubeletconfig
spec:
kubeletConfig:
podPidsLimit: 16384
machineConfigPoolSelector:
matchLabels:
custom-crio: pid-limit
EOF
oc get kubeletconfig.machineconfiguration.openshift.io/cpd-crio-kubeletconfig -o yaml
oc wait kubeletconfig.machineconfiguration.openshift.io/cpd-crio-kubeletconfig \
--for=condition=Success=true \
--timeout=20s \
|| result=1
elif [ "${crio}" == "azure" ]; then
oc apply -f - << EOF
apiVersion: machineconfiguration.openshift.io/v1
kind: ContainerRuntimeConfig
metadata:
name: new-large-pidlimit
spec:
containerRuntimeConfig:
pidsLimit: 16384
machineConfigPoolSelector:
matchExpressions:
- key: pools.operator.machineconfiguration.openshift.io/worker
operator: Exists
EOF
oc get no -o name \
| grep compute \
| awk '{system("oc debug " $1 " -- bash -lc \"chroot /host sudo crio-status config | grep pids_limit\" ")}'
oc wait ContainerRuntimeConfig.machineconfiguration.openshift.io/new-large-pidlimit \
--for=condition=Success=true \
--timeout=20s \
|| result=1
fi
# Not attempting to set the IBM entitlement key because it is
Expand Down
72 changes: 38 additions & 34 deletions config/cloudpaks/cp4d/templates/0100-sync-install-olm.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=installing
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.7.x?topic=installing
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -14,18 +14,18 @@ spec:
spec:
containers:
- name: install-olm
image: icr.io/cpopen/cpd/olm-utils:latest
image: icr.io/cpopen/cpd/olm-utils-v2@sha256:7620c112def44374b9f53a8b5b3ef609be6d3a76fdd48b06f48e13ea3498a8f7
env:
- name: PROJECT_CPFS_OPS
value: {{.Values.metadata.common_services_namespace}}
- name: PROJECT_CPD_OPS
- name: PROJECT_CPD_INST_OPERATORS
value: {{.Values.metadata.operators_namespace}}
- name: PROJECT_CPD_INSTANCE
value: {{.Values.metadata.argocd_app_namespace}}
- name: PROJECT_CPD_INST_OPERANDS
value: {{.Values.metadata.operands_namespace}}
- name: VERSION
value: {{.Values.version}}
- name: COMPONENTS
value: {{.Values.components}}
- name: CPD_CLI_MANAGE_WORKSPACE
value: /tmp
command:
- /bin/bash
- -c
Expand All @@ -35,44 +35,48 @@ spec:
result=0
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=cluster-creating-custom-sccs-services
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.7.x?topic=services-creating-informix-scc
echo "INFO: Creating custom security context constraints for services."
# wkc only
if [[ ${COMPONENTS} =~ wkc ]]; then
bin/apply-scc \
--cpd_instance_ns=${PROJECT_CPD_INSTANCE} \
--components=wkc \
|| {
echo "ERROR: Failed to set SCC for WKC."
exit 1
}
fi
if [[ ${COMPONENTS} =~ informix ]]; then
bin/apply-scc \
--cpd_instance_ns=${PROJECT_CPD_INSTANCE} \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
--components=informix \
|| {
echo "ERROR: Failed to set SCC for Informix."
exit 1
result=1
}
fi
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.6.x?topic=si-creating-olm-objects
echo "INFO: Creating OLM objects for a specialized installation."
bin/apply-olm apply-olm \
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.7.x?topic=data-installing-cloud-pak-foundational-services
echo "INFO: Installing foundational services" \
&& bin/authorize-instance-topology \
--cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS:?} \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS:?} \
&& bin/setup-instance-topology \
--release=${VERSION:?} \
--cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS:?} \
--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS:?} \
--license_acceptance=true \
&& bin/get-license \
--release=${VERSION} \
--license-type=SE \
&& echo "INFO: Creating OLM objects for a specialized installation." \
&& bin/apply-olm apply-olm \
--release=${VERSION} \
--components=${COMPONENTS} \
--cs_ns=${PROJECT_CPFS_OPS} \
--cpd_operator_ns=${PROJECT_CPD_OPS} \
&& bin/get-olm-artifacts \
--subscription_ns=${PROJECT_CPFS_OPS} \
&& bin/get-olm-artifacts \
--subscription_ns=${PROJECT_CPD_OPS} \
&& echo "INFO: OLM resources applied." \
|| {
echo "ERROR: Failed to apply OLM resources."
result=1
}
--cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS} \
|| result=1
# https://www.ibm.com/docs/en/cloud-paks/cp-data/4.7.x?topic=data-specifying-privileges-that-db2u-runs
oc apply -f - <<EOF
apiVersion: v1
data:
DB2U_RUN_WITH_LIMITED_PRIVS: "false"
kind: ConfigMap
metadata:
name: db2u-product-cm
namespace: ${PROJECT_CPD_INST_OPERATORS}
EOF
exit ${result}
Expand Down
Loading

0 comments on commit 166d9dc

Please sign in to comment.