diff --git a/charts/cpd-install-pipeline/Chart.yaml b/charts/cpd-install-pipeline/Chart.yaml index 8becc87..d86e00c 100644 --- a/charts/cpd-install-pipeline/Chart.yaml +++ b/charts/cpd-install-pipeline/Chart.yaml @@ -22,11 +22,11 @@ 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: 1.5.5 +version: 1.5.6 # 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. # It is recommended to use it with quotes. -appVersion: "1.5.5" +appVersion: "1.5.6" # \ No newline at end of file diff --git a/charts/cpd-install-pipeline/templates/cpd-add-components-pipeline.yaml b/charts/cpd-install-pipeline/templates/cpd-add-components-pipeline.yaml index a4d6d91..451f811 100644 --- a/charts/cpd-install-pipeline/templates/cpd-add-components-pipeline.yaml +++ b/charts/cpd-install-pipeline/templates/cpd-add-components-pipeline.yaml @@ -74,40 +74,52 @@ spec: name: CP-INSTALL-OPTIONS type: string tasks: - - name: kubelet-db2-limited-priv - params: - - name: OLM_UTILS_IMAGE - value: '$(params.OLM_UTILS_IMAGE):$(params.VERSION){{- if ne .Values.arch "x86" -}} .{{ .Values.arch }}{{- end }}' - - name: CP-INSTALL-OPTIONS - value: $(params.CP-INSTALL-OPTIONS) - - name: OLM_CMD - value: |- - if [[ $(oc get mcp -o name | wc -l) -gt 0 ]]; then - apply-db2-kubelet - else - echo "No MachineConfig Found ..." - platformSpec=$(oc get Infrastructure/cluster -o jsonpath='{.spec.platformSpec.type}') + - name: kubelet-db2-limited-priv + retries: 10 + params: + - name: OLM_UTILS_IMAGE + value: $(params.OLM_UTILS_IMAGE):$(params.VERSION){{- if ne .Values.arch "x86" -}} .{{ .Values.arch }}{{- end }} + - name: CP-INSTALL-OPTIONS + value: $(params.CP-INSTALL-OPTIONS) + - name: OLM_CMD + value: |- + if [[ $(oc get mcp -o name | wc -l) -gt 0 ]]; then + apply-db2-kubelet + else + echo "No MachineConfig Found ..." + platformSpec=$(oc get Infrastructure/cluster -o jsonpath='{.spec.platformSpec.type}') - case $platformSpec in - IBMCloud) - echo "IBMCloud ROKS detected" - apply-db2-kubelet --openshift_type=roks - ;; - *) - echo "Can't detect CloudProvider. Don't know how to apply configuration" - ;; - esac - fi - retries: 10 - taskRef: - kind: Task - name: olm-utils - when: - - input: $(params.DB2_LIMITED_PRIV) - operator: in - values: - - 'true' - - 'yes' + case $platformSpec in + IBMCloud) + echo "\nIBMCloud ROKS detected" + apply-db2-kubelet --openshift_type=roks + + echo "* [Applying kubelet config without reboot]" + echo "* Fetching cp4d-kubelet.conf" + oc extract cm/cp4d-kubelet-conf -n kube-system --to=/tmp + + echo "* Deploying new kebelet" + for n in `oc get node -o name`; do + oc adm copy-to-node --copy=/tmp/cp4d-kubelet.conf=/etc/kubernetes/kubelet.conf $n + done + + echo "* Restarting kubelet" + oc adm restart-kubelet nodes --all --directive=RemoveKubeletKubeconfig + ;; + *) + echo "Can't detect CloudProvider. Don't know how to apply configuration" + ;; + esac + fi + taskRef: + kind: Task + name: olm-utils + when: + - input: $(params.DB2_LIMITED_PRIV) + operator: in + values: + - "true" + - "yes" - name: apply-scheduler params: - name: OLM_UTILS_IMAGE diff --git a/charts/cpd-install-pipeline/templates/cpd-install-pipeline.yaml b/charts/cpd-install-pipeline/templates/cpd-install-pipeline.yaml index defd55a..1aa451b 100644 --- a/charts/cpd-install-pipeline/templates/cpd-install-pipeline.yaml +++ b/charts/cpd-install-pipeline/templates/cpd-install-pipeline.yaml @@ -167,8 +167,20 @@ spec: case $platformSpec in IBMCloud) - echo "IBMCloud ROKS detected" - apply-db2-kubelet --openshift_type=roks + echo "\nIBMCloud ROKS detected" + apply-db2-kubelet --openshift_type=roks + + echo "* [Applying kubelet config without reboot]" + echo "* Fetching cp4d-kubelet.conf" + oc extract cm/cp4d-kubelet-conf -n kube-system --to=/tmp + + echo "* Deploying new kebelet" + for n in `oc get node -o name`; do + oc adm copy-to-node --copy=/tmp/cp4d-kubelet.conf=/etc/kubernetes/kubelet.conf $n + done + + echo "* Restarting kubelet" + oc adm restart-kubelet nodes --all --directive=RemoveKubeletKubeconfig ;; *) echo "Can't detect CloudProvider. Don't know how to apply configuration" @@ -196,16 +208,26 @@ spec: --entitled_registry_key=$(params.IBM_ENTITLEMENT_KEY) if [[ $(oc get mcp -o name | wc -l) -eq 0 ]]; then + platformSpec=$(oc get Infrastructure/cluster -o jsonpath='{.spec.platformSpec.type}') echo echo "non-MCP cluster detected, activating workaround" - oc debug $(oc get node -o name | head -n1) -- chroot /host cat /.docker/config.json > /tmp/config.json + case $platformSpec in + KubeVirt) + echo "KubeVirt detected, nothing to do" + echo + ;; + IBMCloud) + echo "ROKS detected, activating workaround" + echo + oc debug $(oc get node -o name | head -n1) -- chroot /host cat /.docker/config.json > /tmp/config.json - cat /tmp/config.json | jq --arg auth cp:$(params.IBM_ENTITLEMENT_KEY) '.auths += {"cp.icr.io": {"auth": $auth|@base64}}' > /tmp/config.json.new - sleep 1 + cat /tmp/config.json | jq --arg auth cp:$(params.IBM_ENTITLEMENT_KEY) '.auths += {"cp.icr.io": {"auth": $auth|@base64}}' > /tmp/config.json.new + sleep 1 - for n in `oc get node -o name`; do - oc adm copy-to-node --copy=/tmp/config.json.new=/.docker/config.json $n - done + for n in `oc get node -o name`; do + oc adm copy-to-node --copy=/tmp/config.json.new=/.docker/config.json $n + done + ;; fi taskRef: kind: Task