Skip to content

expose bootc MicroShift API server to the host #149

Description

@eslutsky

if this option enabled add to the podman option -p 6043:6043:

add new option to Makefile to access the API server:

WORKDIR=$(mktemp -d /tmp/kubeconfig-XXXXXX)
POD_NAME=microshift-okd-1
sudo podman cp ${POD_NAME}:/var/lib/microshift/resources/kubeadmin/${POD_NAME}/kubeconfig ${WORKDIR}/
sudo chown  $(whoami):$(whoami) ${WORKDIR}/kubeconfig
podman_ip_gw=$(sudo podman network inspect microshift-okd-multinode | jq -r '.[0].subnets.[0].gateway')

echo "${podman_ip_gw} ${POD_NAME}" >${WORKDIR}/hosts

# run the commands in new namespace (making it possible to manipulate /etc/hosts temporarily without root )
unshare -Urm bash <<END
    mount --bind $WORKDIR /etc
    export KUBECONFIG=${WORKDIR}/kubeconfig
    oc get pods -A
   # run-test-from host
END

rm -rf "$WORKDIR"

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions