-
Notifications
You must be signed in to change notification settings - Fork 0
/
kube-setup 2.sh
executable file
·40 lines (30 loc) · 1.1 KB
/
kube-setup 2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
#
# verified on Fedora 31 WS
egrep '^flags.*(vmx|svm)' /proc/cpuinfo || (echo enable CPU virtualization support and try again && exit 9)
dnf clean all
dnf -y upgrade
# install KVM software
dnf install @virtualization -y
systemctl enable --now libvirtd
usermod -aG libvirt student
# install kubectl
echo installing kubectl
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
dnf install -y kubectl
# install minikube
echo downloading minikube, check version
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
mv minikube /usr/local/bin
echo at this point, reboot your Fedora Workstation. After reboot, manually run as non-root
echo minikube start --memory 4096 --vm-driver=kvm2
echo also use usermod -aG libvirt $USER where $USER is the name of the user that is going to start minikube