Skip to content

Commit

Permalink
* add minikube-install support using kvm2 for: (#31)
Browse files Browse the repository at this point in the history
* add minikube-install support using kvm2 for:
  * debian
  * ubuntu
  * fedora
  * centos
* separate minikube-setup and minikube-start
  * allow minikube start with psp and rbac support

NOTES:

Previously, one would need to execute minikube-install to start minikube with the rbac and psp policies enabled as these extra arguments are not supported in the minikube config. This update allows the use of `minikube-start` to spin up minikube in a production-like state without remembering the correct arguments.

In addition, this update brings minikube support to the popular linux distributions: debian, ubuntu, fedora, and centos.
  • Loading branch information
dmccaffery authored Nov 5, 2019
1 parent c885913 commit b0b8a78
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 26 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ __am-prompt-install() {
fi

local BASH_COMPLETION="$LOCAL_PREFIX/etc/bash_completion.d"
local UNAME=$(uname)
local UNAME=$(uname | tr [:upper:] [:lower:])
local UNAME_INSTALL="$SCRIPT_DIR/uname/install-$UNAME.sh"

if [ -f /etc/os-release ]; then
Expand Down
29 changes: 4 additions & 25 deletions src/scripts/Darwin/minikube-install
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
#!/usr/bin/env bash

brew cask install minikube 1>/dev/null 2>&1
brew install hyperkit 1>/dev/null 2>&1

# setup the hypervisor
brew install hyperkit
minikube config set vm-driver hyperkit
minikube config set cpus 4
minikube config set memory 4096
minikube config set bootstrapper kubeadm

# detect missing psp
if [ ! -f "$HOME/.minikube/addons/psp.yaml" ]; then

# add default psp
cat $HOME/.am/prompt/scripts/Darwin/psp.yaml > $HOME/.minikube/addons/psp.yaml
fi

# enable all the things
minikube start \
--kubernetes-version=1.15.5 \
--extra-config=apiserver.authorization-mode=RBAC \
--extra-config=apiserver.enable-admission-plugins="PodSecurityPolicy"

# enable the dashboard and heapter
minikube config set dashboard true
minikube config set heapster true

# make sure ingress is off
minikube config set ingress false
# setup minikube
minikube-setup
12 changes: 12 additions & 0 deletions src/scripts/centos/minikube-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

# install the hypervisor
sudo yum install -y qemu-kvm libvirt libvirt-python libguestfs-tools virt-install
systemctl enable libvirtd
systemctl start libvirtd

# set the vm-driver
minikube config set vm-driver kvm2

# setup minikube
minikube-setup
14 changes: 14 additions & 0 deletions src/scripts/debian/minikube-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# install the hypervisor
sudo apt-get install -y qemu-kvm libvirt-clients libvirt-daemon-system
sudo adduser `id -un` libvirt

# install minikube
brew install minikube

# set the vm-driver
minikube config set vm-driver kvm2

# setup minikube
minikube-setup
15 changes: 15 additions & 0 deletions src/scripts/fedora/minikube-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

# install the hypervisor
sudo dnf install @virtualization
sudo systemctl start libvirtd
sudo systemctl enable libvirtd

# install minikube
brew install minikube

# set the vm-driver
minikube config set vm-driver kvm2

# setup minikube
minikube-setup
23 changes: 23 additions & 0 deletions src/scripts/minikube-setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

minikube config set cpus 4
minikube config set memory 4096
minikube config set bootstrapper kubeadm
minikube config set kubernetes-version 1.15.5

# enable the dashboard and heapter
minikube config set dashboard true
minikube config set heapster true

# make sure ingress is off
minikube config set ingress false

# detect missing psp
if [ ! -f "$HOME/.minikube/addons/psp.yaml" ]; then

# get default pod security policy
curl -L https://github.com/kubernetes/minikube/files/3065532/psp.txt -o $HOME/.minikube/addons/psp.yaml
fi

# start minikube
minikube-start
6 changes: 6 additions & 0 deletions src/scripts/minikube-start
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# start minikube with rbac and psp
minikube start \
--extra-config=apiserver.authorization-mode=RBAC \
--extra-config=apiserver.enable-admission-plugins="PodSecurityPolicy"
File renamed without changes.
10 changes: 10 additions & 0 deletions src/scripts/ubuntu/minikube-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

# install the hypervisor
sudo apt-get install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils

# set the vm-driver
minikube config set vm-driver kvm2

# setup minikube
minikube-setup

0 comments on commit b0b8a78

Please sign in to comment.