Skip to content

CNTRLPLANE-194: add auth-api-bootstrap stage to bootkube.sh template #9424

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

Merged
Merged
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
36 changes: 36 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 @@ -58,6 +58,7 @@ KUBE_CONTROLLER_MANAGER_OPERATOR_IMAGE=$(image_for cluster-kube-controller-manag
KUBE_SCHEDULER_OPERATOR_IMAGE=$(image_for cluster-kube-scheduler-operator)
INGRESS_OPERATOR_IMAGE=$(image_for cluster-ingress-operator)
NODE_TUNING_OPERATOR_IMAGE=$(image_for cluster-node-tuning-operator)
AUTH_OPERATOR_IMAGE=$(image_for cluster-authentication-operator)

CLOUD_CREDENTIAL_OPERATOR_IMAGE=$(image_for cloud-credential-operator)

Expand Down Expand Up @@ -117,6 +118,41 @@ then
record_service_stage_success
fi

# The cluster-authentication-operator is going to be responsible for managing the
# rolebindingrestrictions.authorization.openshift.io CRD as outlined in
# https://github.com/openshift/enhancements/pull/1726
#
# This CRD is required for bootstrapping so that the authorization.openshift.io/RestrictSubjectBindings
# default admission plugin on the kube-apiserver does not prevent
# the creation of `system:*` RoleBindings.
#
# Because the only thing required for bootstrapping from the cluster-authentication-operator
# is this API, and this API used to be part of the api-bootstrap process,
# this stage is put immediately after the api-bootstrap stage.
if [ ! -f auth-api-bootstrap.done ]
then
record_service_stage_start "auth-api-bootstrap"
echo "Rendering auth api manifests..."

rm --recursive --force auth-api-bootstrap

bootkube_podman_run \
--name auth-api-render \
--volume "$PWD:/assets:z" \
"${AUTH_OPERATOR_IMAGE}" \
render \
--asset-output-dir=/assets/auth-api-bootstrap/manifests \
--rendered-manifest-dir=/assets/manifests \
--cluster-profile=${CLUSTER_PROFILE_ANNOTATION} \
Copy link
Member

Choose a reason for hiding this comment

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

This seems to breaks nightlies:

Feb 24 08:13:18 ip-10-0-103-202 bootkube.sh[124202]: Rendering auth api manifests...
Feb 24 08:13:18 ip-10-0-103-202 bootkube.sh[124202]: /usr/local/bin/bootkube.sh: line 134: CLUSTER_PROFILE_ANNOTATION: unbound variable
Feb 24 08:13:18 ip-10-0-103-202 systemd[1]: bootkube.service: Main process exited, code=exited, status=1/FAILURE

--payload-version=$VERSION


cp auth-api-bootstrap/manifests/* manifests/

touch auth-api-bootstrap.done
record_service_stage_success
fi

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