Skip to content

Commit

Permalink
cluster-up: Avoid a known conmon issue when using podman
Browse files Browse the repository at this point in the history
There is currently a known conmon issue [1] when podman based containers
dump large amounts of data to stdout. gocli would previously do this
when copying the kubectl binary to the host machine.

This change replaces that with a simple volume mount workaround when
using podman until the underlying conmon issue is resolved.

[1] containers/conmon#315

Signed-off-by: Lee Yarwood <[email protected]>
  • Loading branch information
lyarwood committed Feb 10, 2022
1 parent c142361 commit 52ee5e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions cluster-up/cluster/ephemeral-provider-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ _cli="${_cri_bin} run --privileged --net=host --rm ${USE_TTY} -v ${_docker_socke
if [ -d /lib/modules ]; then
_cli="${_cli} -v /lib/modules/:/lib/modules/"
fi

# Workaround https://github.com/containers/conmon/issues/315 by not dumping file content to stdout
if [ ${_cri_bin} == "podman" ]; then
_cli="${_cli} -v ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER:/kubevirtci_config"
fi

_cli="${_cli} ${_cli_container}"

function _main_ip() {
Expand Down
11 changes: 9 additions & 2 deletions cluster-up/cluster/k8s-provider-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,16 @@ function up() {
eval ${_cli:?} run $params

# Copy k8s config and kubectl
${_cli} scp --prefix ${provider_prefix:?} /usr/bin/kubectl - >${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl
# Workaround https://github.com/containers/conmon/issues/315 by not dumping the file to stdout for the time being
if [ ${_cri_bin} == "podman" ]; then
${_cli} scp --prefix ${provider_prefix:?} /usr/bin/kubectl /kubevirtci_config/.kubectl
${_cli} scp --prefix $provider_prefix /etc/kubernetes/admin.conf /kubevirtci_config/.kubeconfig
else
${_cli} scp --prefix ${provider_prefix:?} /usr/bin/kubectl - >${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl
${_cli} scp --prefix $provider_prefix /etc/kubernetes/admin.conf - >${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig
fi

chmod u+x ${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubectl
${_cli} scp --prefix $provider_prefix /etc/kubernetes/admin.conf - >${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig

# Set server and disable tls check
export KUBECONFIG=${KUBEVIRTCI_CONFIG_PATH}/$KUBEVIRT_PROVIDER/.kubeconfig
Expand Down

0 comments on commit 52ee5e6

Please sign in to comment.