fix network

This commit is contained in:
D4rk4 2020-07-31 14:36:44 +02:00
parent c294cf1694
commit a22215fa08
2 changed files with 5 additions and 4 deletions

View file

@ -3,7 +3,7 @@ k8s_first_master_node: 'k8s-demo'
k8s_domain: coins.k8s.demo.ix.gs
k8s_pod_network: '192.168.0.0/16'
k8s_service_network: '10.254.0.0/24'
k8s_controlplane_vip: '10.129.0.194'
k8s_controlplane_vip: '100.100.100.15'
k8s_controlplane_address: '{{ k8s_controlplane_vip }}:6443'
k8s_cluster_name: k8s-demo

View file

@ -7,13 +7,14 @@ vcpu=`cat /proc/cpuinfo|grep proc|tail -1|awk '{print $NF}'`
k8sdsk="${apptmp}/k8s-demo.raw"
httpboot='http://ftp.debian.org/debian/dists/stretch/main/installer-amd64/current/images/netboot/debian-installer/amd64'
seed='https://git.ix.gs/public/coins-demo/raw/branch/master/contrib/k8s-seed.txt'
qemu="${appdir}/contrib/qemu-system-x86_64 -L ${appdir}/contrib/share/qemu -net nic -net user -m ${vmmem} -smp ${vcpu} -localtime -enable-kvm -cpu host,+nx -M pc -vga std -usbdevice tablet -k en-us -hda ${k8sdsk} -boot once=d -nographic"
qemu="${appdir}/contrib/qemu-system-x86_64 -L ${appdir}/contrib/share/qemu -net nic -net user,net=100.100.100.0/24,host=100.100.100.100 -m ${vmmem} -smp ${vcpu} -localtime -enable-kvm -cpu host,+nx -M pc -vga std -usbdevice tablet -k en-us -hda ${k8sdsk} -boot once=d -nographic"
wget='wget -cq4O'
###
installvm() {
fallocate -l ${vmsize} ${k8sdsk}
echo "Preparing K8S VM..."
wget -cO ${apptmp}/kernel ${httpboot}/linux
wget -cO ${apptmp}/initrd ${httpboot}/initrd.gz
${wget} ${apptmp}/kernel ${httpboot}/linux
${wget} ${apptmp}/initrd ${httpboot}/initrd.gz
${qemu} -kernel ${apptmp}/kernel -initrd ${apptmp}/initrd -append "console=ttyS0,115200n8 apt-setup/proposed=true nomodeset fb=false priority=critical locale=en_US url=${seed}"
rm -f ${apptmp}/kernel ${apptmp}/initrd
}