Skip to content

Instantly share code, notes, and snippets.

@bigkraig
Last active February 24, 2017 23:23
Show Gist options
  • Save bigkraig/43f6a487d1ee7cb2bf74ad587b17fd6a to your computer and use it in GitHub Desktop.
Save bigkraig/43f6a487d1ee7cb2bf74ad587b17fd6a to your computer and use it in GitHub Desktop.
# Insightful instructions, originally posted by Xynova (https://github.com/xynova)
echo "TOOLBOX_DOCKER_TAG=24" >> $HOME/.toolboxrc
echo PATH=/opt/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin >> /etc/kubernetes/kubelet.env
# Make socat directories
mkdir -p /opt/bin/socat.d/bin /opt/bin/socat.d/lib
# Create socat wrapper
cat << EOF > /opt/bin/socat
#! /bin/bash
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/opt/bin
LD_LIBRARY_PATH=/opt/bin/socat.d/lib:$LD_LIBRARY_PATH exec /opt/bin/socat.d/bin/socat "\$@"
EOF
chmod +x /opt/bin/socat
# Get socat and libraries from the CoreOS toolbox
toolbox
dnf install -y socat
cp -f /usr/bin/socat /media/root/opt/bin/socat.d/bin/socat
cp -f /usr/lib64/libssl.so.1.0.2h /media/root/opt/bin/socat.d/lib/libssl.so.10
cp -f /usr/lib64/libcrypto.so.1.0.2h /media/root/opt/bin/socat.d/lib/libcrypto.so.10
# Then tell the kubelet to consider binaries in the /opt/bin directory .. maybe changing it to a socat specific isolated one is better
# /etc/systemd/system/kubelet.service
# [Unit]
# Description=Kubernetes Kubelet Master
# Documentation=http://kubernetes.io/docs/admin/kubelet
# [Service]
# ExecStartPre=/usr/bin/mkdir -p /etc/kubernetes/manifests
# ExecStartPre=/usr/bin/mkdir -p /etc/cni/net.d
# ExecStartPre=/usr/bin/mkdir -p /opt/cni/bin
# Environment="PATH=/opt/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment