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

Start rendering assets using cluster-kube-apiserver operator renderer #322

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
43 changes: 43 additions & 0 deletions pkg/asset/ignition/content/bootkube.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ mkdir --parents /etc/kubernetes/manifests/
MACHINE_CONFIG_OPERATOR_IMAGE=$(podman run --rm {{.ReleaseImage}} image machine-config-operator)
echo "Found Machine Config Operator's image: $MACHINE_CONFIG_OPERATOR_IMAGE"

KUBE_APISERVER_OPERATOR_IMAGE=$(podman run --rm {{.ReleaseImage}} image cluster-kube-apiserver-operator)
KUBE_CONTROLLER_MANAGER_OPERATOR_IMAGE=$(podman run --rm {{.ReleaseImage}} image cluster-kube-controller-manager-operator)

if [ ! -d cvo-bootstrap ]
then
echo "Rendering Cluster Version Operator Manifests..."
Expand Down Expand Up @@ -65,6 +68,46 @@ then
cp --recursive kco-bootstrap/manifests .
fi

if [ ! -d kube-apiserver-bootstrap ]
then
echo "Rendering Kubernetes API server core manifests..."

# shellcheck disable=SC2154
podman run \
--volume "$PWD:/assets:z" \
"${KUBE_APISERVER_OPERATOR_IMAGE}" \
/usr/bin/cluster-kube-apiserver-operator render \
--asset-input-dir=/assets/tls \
--asset-output-dir=/assets/kube-apiserver-bootstrap \
--config-override-file=/usr/share/bootkube/manifests/config/config-overrides.yaml \
--config-output-file=/assets/kube-apiserver-bootstrap/config

abhinavdahiya marked this conversation as resolved.
Show resolved Hide resolved
# TODO: copy the bootstrap manifests to replace kube-core-operator
cp --recursive kube-apiserver-bootstrap/manifests/openshift-kube-apiserver-ns.yaml manifests/00_openshift-kube-apiserver-ns.yaml
cp --recursive kube-apiserver-bootstrap/manifests/secret-* manifests/
cp --recursive kube-apiserver-bootstrap/manifests/configmap-* manifests/
fi

if [ ! -d kube-controller-manager-bootstrap ]
then
echo "Rendering Kubernetes Controller Manager core manifests..."

# shellcheck disable=SC2154
podman run \
--volume "$PWD:/assets:z" \
"${KUBE_CONTROLLER_MANAGER_OPERATOR_IMAGE}" \
/usr/bin/cluster-kube-controller-manager-operator render \
--asset-input-dir=/assets/tls \
--asset-output-dir=/assets/kube-controller-manager-bootstrap \
--config-override-file=/usr/share/bootkube/manifests/config/config-overrides.yaml \
--config-output-file=/assets/kube-controller-manager-bootstrap/config

# TODO: copy the bootstrap manifests to replace kube-core-operator
cp --recursive kube-controller-manager-bootstrap/manifests/openshift-kube-controller-manager-ns.yaml manifests/00_openshift-kube-controller-manager-ns.yaml
cp --recursive kube-controller-manager-bootstrap/manifests/secret-* manifests/
cp --recursive kube-controller-manager-bootstrap/manifests/configmap-* manifests/
fi

if [ ! -d mco-bootstrap ]
then
echo "Rendering MCO manifests..."
Expand Down