Skip to content

Instantly share code, notes, and snippets.

@whip113
Last active September 4, 2018 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whip113/50ccecaafb080e2970139389dc685b3a to your computer and use it in GitHub Desktop.
Save whip113/50ccecaafb080e2970139389dc685b3a to your computer and use it in GitHub Desktop.
Install MiniShift
# First, create a VM with enough resources to stand up multiple Conjur intances. I recommmend 4vCPU and 10GB of memory minimum.
# Don't forget to enable virtualization on your VM CPU settings
# I used Ubuntu with the `kvm` driver here. If you use a different distro you can find the minishift pre-req's and correct binary at
# https://docs.openshift.org/latest/minishift/getting-started/preparing-to-install.html
# Install Docker
#Install pre-req packages
sudo apt-get install -y curl \
apt-transport-https \
ca-certificates \
software-properties-common \
git
#Add Docker Key
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#Add Docker Repository
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
#Update `apt`
$ sudo apt-get update
#Install Docker and add user to the docker group
$ sudo apt-get install -y docker-ce
$ sudo groupadd docker
$ sudo usermod -aG docker $USER
#Refresh the groups
$ newgrp docker
#Install KVM Driver
$ sudo curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.7.0/docker-machine-driver-kvm -o /usr/local/bin/docker-machine-driver-kvm
$ sudo chmod +x /usr/local/bin/docker-machine-driver-kvm
#Install KVM dependencies
$ sudo apt install libvirt-bin qemu-kvm
#Create the libvirt group and add your user to it
$ sudo usermod -aG libvirtd $USER
#Refresh group membership details
$ newgrp libvirtd
#Download the latest version of `minishift` from https://github.com/minishift/minishift/releases
$ wget https://github.com/minishift/minishift/releases/download/v1.21.0/minishift-1.21.0-linux-amd64.tgz
#Extract `minishift` and copy to /usr/local/sbin
# This path works for Ubuntu. Use `echo $PATH` to see what paths are already defined and put the
# minishift binary in one of those paths, or set the path to where your binary is
$ tar -xzvf minishift-1.21.0-linux-amd64.tgz
$ cp minishift-1.21.0-linux-amd64/minishift /usr/local/sbin/minishift
#Start the minishift/openshift cluster
$ minishift start --memory 8192 --vm-driver kvm --show-libmachine-logs --insecure-registry $(minishift openshift registry) # To define a specific version, add `--openshift-version v3.7.2`
# If the cluster starts correctly, you'll see something similar to the below
OpenShift server started.
The server is accessible via web console at:
https://192.168.42.127:8443
You are logged in as:
User: developer
Password: <any value>
To login as administrator:
oc login -u system:admin
# Next, configure the Openshift CLI client `oc`
$ minishift oc-env
# This will give an output similar to the below
# Run the `export` command shown
export PATH="/home/nate/.minishift/cache/oc/v3.9.0/linux:$PATH"
# Run these commands to configure your shell:
$ minishift docker-env
$ eval $(minishift oc-env)
$ export PATH="/home/nate/.minishift/cache/oc/v3.9.0/linux:$PATH"
# Configure user `developer` for push and pull from docker registry
$ oc policy add-role-to-user registry-viewer <user_name>
$ oc policy add-role-to-user registry-editor <user_name>
# Login to Openshift
$ oc login
# Login to registry
docker login -u developer -p $(oc whoami -t) $(minishift openshift registry)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment