Skip to content

Commit

Permalink
kubeadm: additional fixes for ubuntu support
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Apr 27, 2020
1 parent b9642fe commit debb177
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
5 changes: 4 additions & 1 deletion kvirt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,10 @@ def wait(self, name, image=None):
cmd = 'journalctl --identifier=ignition --all --no-pager'
else:
cloudinitfile = common.get_cloudinitfile(image)
cmd = "sudo grep -i cloud-init %s" % cloudinitfile
if common.is_debian(image):
cmd = "sudo grep -A5000 -i cloud-init %s" % cloudinitfile
else:
cmd = "sudo grep -i cloud-init %s" % cloudinitfile
ip = None
while ip is None:
ip = k.info(name).get('ip')
Expand Down
7 changes: 1 addition & 6 deletions kvirt/kubeadm/pre.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
yum -y install wget git
wget -P /root/ https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
mv /root/jq-linux64 /usr/bin/jq
chmod u+x /usr/bin/jq
yum -y install git
echo net.bridge.bridge-nf-call-iptables=1 >> /etc/sysctl.d/99-sysctl.conf
sysctl -p
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=permissive/" /etc/selinux/config
# yum install -y docker kubelet-$K8S kubectl-$K8S kubeadm-$K8S
#echo kubernetesVersion: $K8S >> /root/config.yml
yum install -y docker kubelet kubectl kubeadm
sed -i "s/--selinux-enabled //" /etc/sysconfig/docker
systemctl enable docker && systemctl start docker
Expand Down
5 changes: 1 addition & 4 deletions kvirt/kubeadm/pre_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apt-get update && apt-get install -y apt-transport-https curl wget
apt-get update && apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
wget -P /root/ https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
mv /root/jq-linux64 /usr/bin/jq
chmod u+x /usr/bin/jq
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
Expand Down
4 changes: 3 additions & 1 deletion kvirt/kubeadm/workers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
- size: 50
pool: {{ pool }}
files:
{% if 'ubuntu' in image or 'xenial' in image or 'yaketty' in image or 'zesty' in image or 'artful' in image or 'bionic' in image or 'cosmic' in image %}
- path: /etc/yum.repos.d/kubernetes.repo
origin: kubernetes.repo
{% endif %}
- path: /root/join.sh
origin: {{ basedir }}/clusters/{{ cluster }}/join.sh
- path: /root/admin.conf
origin: {{ basedir }}/clusters/{{ cluster }}/auth/kubeconfig
scripts:
{% if 'xenial' in image or 'yaketty' in image or 'zesty' in image or 'artful' in image or 'bionic' in image or 'cosmic' in image %}
{% if 'ubuntu' in image or 'xenial' in image or 'yaketty' in image or 'zesty' in image or 'artful' in image or 'bionic' in image or 'cosmic' in image %}
- pre_ubuntu.sh
{% else %}
- pre.sh
Expand Down

0 comments on commit debb177

Please sign in to comment.