[Kubernates/Openshift] – How to install/deploy/use OLM (Operator Lifecycle Manager) in Minishift?

Following the steps to install.

1. Install Minishift

See here how to install Minishift with your SO and with the virtualization environment that you wish.

Following the steps to perform it in MacOSX using the virtualization environment of the type xhyve.

$ brew install docker-machine-driver-xhyve
$ brew cask install minishift

2. Enable operators in your Minishift

# create a profile
$ minishift profile set operator

# add insecure registry to download the images from docker
$ minishift config set insecure-registry 172.30.0.0/16

# add addon to allow work with operators
$ minishift addon enable admin-user

# Optional vm setup
$ minishift config set cpus 4
$ minishift config set memory 8GB

2. Install/deploy OLM in your Minishift

  • Get the project

$ mkdir -p $GOPATH/src/github.com/operator-framework/operator-lifecycle-manager
$ cd $GOPATH/src/github.com/operator-framework/operator-lifecycle-manager
$ git clone https://github.com/operator-framework/operator-lifecycle-manager.git
$ cd $GOPATH/src/github.com/operator-framework/operator-lifecycle-manager

# Use the master branch
$ git checkout master
$ git pull

  • Deploy the OLM

Run the following command to install the latest version(master branch)

$ oc create -f deploy/okd/manifests/latest/

IMPORTANT: Not worry if you see errors like the following example. Sometimes the CRDs don’t register fast enough for the CR (instances) to create successfully.

unable to recognize “deploy/okd/manifests/latest/0000_50_olm_13-packageserver.subscription.yaml”: no matches for kind “Subscription” in version “operators.coreos.com/v1alpha1”

For further information check its documentation.

  • Start OLM interface

In the `$GOPATH/src/github.com/operator-framework/operator-lifecycle-manager` execute the following script and when it finishes access it by the link http://localhost:9000. 

$ ./scripts/run_console_local.sh

3. Add Role for OLM show the operators in the catalogue

The following command is required in order to give the permissions required for the operator appears in the “Developer Catalogue”

$ oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:kube-system:default

Screenshot 2019-03-27 at 09.59.04

References

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s