Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OCPCLOUD-1171] Implement CCCMO render to run CCM on bootstrap node #4947

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions data/data/bootstrap/files/usr/local/bin/bootkube.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ CLUSTER_ETCD_OPERATOR_IMAGE=$(image_for cluster-etcd-operator)
CONFIG_OPERATOR_IMAGE=$(image_for cluster-config-operator)
KUBE_APISERVER_OPERATOR_IMAGE=$(image_for cluster-kube-apiserver-operator)
KUBE_CONTROLLER_MANAGER_OPERATOR_IMAGE=$(image_for cluster-kube-controller-manager-operator)
CLUSTER_CLOUD_CONTROLLER_MANAGER_OPERATOR_IMAGE=$(image_for cluster-cloud-controller-manager-operator)
KUBE_SCHEDULER_OPERATOR_IMAGE=$(image_for cluster-kube-scheduler-operator)
INGRESS_OPERATOR_IMAGE=$(image_for cluster-ingress-operator)

Expand Down Expand Up @@ -230,6 +231,45 @@ then
record_service_stage_success
fi

if [ ! -f cloud-controller-manager-bootstrap.done ]
then
record_service_stage_start "cluster-cloud-controller-manager-bootstrap"
echo "Rendering Cloud Controller Manager core manifests..."

rm --recursive --force cloud-controller-manager-bootstrap

# Copy the CCCMO images configMap to resolve pod images from internal registry in CCCMO render run
# Source config map is located in https://github.com/openshift/cluster-cloud-controller-manager-operator/blob/master/manifests/0000_26_cloud-controller-manager-operator_01_images.configmap.yaml
bootkube_podman_run \
--name copy-cloud-controller-manager-images \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: existing style seems to be an extra level of indentation for these wrapped lines.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: error creating container storage: the container name "copy-cloud-controller-manager-images" is already in use by "5ca8294f8b2b2089541e267b4d46aeed08295f1ca16e14a45dd80807bf8e03ca". You have to remove that container to be able to reuse that name.: that name is already in use

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comment below, that is the root cause, https://github.com/openshift/installer/pull/4947/files#r662375716

--entrypoint /bin/bash "${RELEASE_IMAGE_DIGEST}" \
-c "cat /release-manifests/0000_26_cloud-controller-manager-operator_01_images.configmap.yaml" > manifests/ccm-images.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/release-manifests/0000_26_cloud-controller-manager-operator_01_images.configmap.yaml: No such file or directory

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it a CI build? Seems like CCCMO is not present in the payload you were using


ADDITIONAL_FLAGS=""
if [ -f "$PWD/manifests/cloud-provider-config.yaml" ]; then
ADDITIONAL_FLAGS="--cloud-config-file=/assets/manifests/cloud-provider-config.yaml"
fi

bootkube_podman_run \
--name cloud-controller-render \
--volume "$PWD:/assets:z" \
"${CLUSTER_CLOUD_CONTROLLER_MANAGER_OPERATOR_IMAGE}" \
/render run \
--images-file=/assets/manifests/ccm-images.yaml \
--dest-dir=/assets/cloud-controller-manager-bootstrap \
--cluster-infrastructure-file=/assets/manifests/cluster-infrastructure-02-config.yml \
${ADDITIONAL_FLAGS}

# Copy rendered resources to manifests folder
cp -r cloud-controller-manager-bootstrap/bootstrap/. bootstrap-manifests/
# Copy cloud config to /etc/kubernetes/bootstrap-configs
cp -r cloud-controller-manager-bootstrap/config/. /etc/kubernetes/bootstrap-configs


touch cloud-controller-manager-bootstrap.done
record_service_stage_success
Copy link
Member

@wking wking May 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: inconsistent indent, although that appears to be the existing style for record_service_stage_success in this file.

fi

if [ ! -f kube-scheduler-bootstrap.done ]
then
record_service_stage_start "kube-scheduler-bootstrap"
Expand Down