Updated : April 24th
Author : Charles Moulliard
Changes:
- Change cpu to 4, memory to 6Gb, add
sudo sysctl -w vm.max_map_count=262144
- Include minishift instructions
- Install Vagrant on MacOS machine like Virtualbox
This private network will be used between the host and the guest and will let you to access openshift at the address
https://192.168.99.50:8443/console
from your mac machine
vboxmanage hostonlyif create
vboxmanage hostonlyif ipconfig vboxnet0 --ip 192.168.99.1 --netmask 255.255.255.0
vboxmanage dhcpserver add --ifname vboxnet0 --ip 192.168.99.20 --netmask 255.255.255.0 --lowerip 192.168.99.50 --upperip 192.168.99.50
vboxmanage dhcpserver modify --ifname vboxnet0 --enable
mkdir vagrant-centos && vagrant-centos
cat > post-installation.sh << 'EOF'
#!/bin/bash
echo "Install docker, wget packages"
sudo yum install -y git docker wget python-rhsm-certificates
echo "Configure docker"
sudo bash -c "cat > /etc/docker/daemon.json" << 'EOFILE'
{
"insecure-registries" : [ "172.30.0.0/16" ],
"hosts" : [ "unix://", "tcp://0.0.0.0:2376" ]
}
EOFILE
echo "Start and enable docker service"
sudo groupadd docker
sudo usermod -aG docker vagrant
sudo systemctl enable docker
sudo systemctl start docker
sudo sysctl -w vm.max_map_count=262144
EOF
cat > Vagrantfile << 'EOF'
Vagrant.configure(2) do |config|
config.vm.box = "centos/7"
config.vm.provider "virtualbox" do |v, override|
v.name = "centos-7-docker"
v.memory = 6144
v.customize ["modifyvm", :id, "--cpus", "4"]
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
# Add private network
config.vm.network "private_network", ip: "192.168.99.50"
# Execute post installation
config.vm.provision :shell, path: "post-installation.sh"
end
EOF
vagrant plugin install ssh
vagrant up
vagrant ssh
- Create istiooc folder project and fetch it
mkdir istiooc && cd istiooc
wget -O istiooc https://github.com/openshift-istio/origin/releases/download/istio-3.9-0.7.1-alpha5/istiooc_linux
chmod +x istiooc
export PATH=$(pwd):$PATH
mv istiooc oc
- Start oc
oc cluster up\
--public-hostname=192.168.99.50\
--istio\
--launcher\
--launcher-catalog-git-branch='istio'\
--launcher-catalog-git-repo='https://github.com/snowdrop/launcher-booster-catalog.git'\
--launcher-openshift-user=admin\
--launcher-openshift-password=admin\
--launcher-github-token=''\
--launcher-github-username=''
If you shutdown the cluster and then restart it, then wait 1-2 min as process to create devex
namespace containig the launcher pods could take time. See here
- Install istiooc on your machine
mkdir istiooc && cd istiooc
wget -O istiooc https://github.com/openshift-istio/origin/releases/download/istio-3.9-0.7.1-alpha7/istiooc_linux
chmod +x istiooc
mv istiooc oc
cp oc ~/.minishift/cache/oc/v3.9.0/darwin
- Launch Minishift using extra-flags
minishift config view
- cpus : 4
- image-caching : false
- iso-url : centos
- memory : 5G
- openshift-version : v3.9.0
- vm-driver : xhyve
MINISHIFT_ENABLE_EXPERIMENTAL=y minishift start --extra-clusterup-flags='--istio
--launcher
--launcher-catalog-git-branch=istio
--launcher-catalog-git-repo=https://github.com/snowdrop/launcher-booster-catalog.git
--launcher-openshift-user=admin
--launcher-openshift-password=admin
--launcher-github-token=""
--launcher-github-username=""'
Last line should be