Installation Through Source Code
February 27, 2019 ยท View on GitHub
- Prerequisites
- Server Side Installation (Controller Installation)
- Client Side Installation (Plugin Installation)
Prerequisites
-
Kubernetes Version 1.9 or greater
kubectlinstalled and configured. For details refer here.
-
Dependencies
-
- version > 1.7
- setup
GOPATHenvironment variable by as per the Golang documentation. - add
$GOPATH/bindirectory to your environment$PATHvariable.
-
-
Fetch the Purser source code from GitHub.
go get github.com/vmware/purser# change directory to project root cd $GOPATH/src/github.com/vmware/purser -
For Windows users, install gnu
makefrom here. -
Download project dependencies with
make.# download project tools make tools # download project dependencies make deps # update project depedencies make update
Server Side Installation (Controller Installation)
Follow the below steps to install the purser controller and custom resource definitions for the user groups in the Kubernetes cluster.
Build Controller Binary
Build the purser controller binary using make target.
make build
Build Container Image
Update the Makefile to set the REGISTRY field to your Docker username and execute the following make targets to build and publish the docker images.
# create the container(docker image)
make container
# authenticate your Docker credentials
docker login
# publish your docker image to docker hub
make push
Install Purser Plugin
-
Update the image name in
purser-controller-setup.yamlto the docker image name that you pushed. -
Install the controller in the cluster using
kubectl.
The following steps will install Purser in your cluster at namespace purser.
Creation of this namespace is needed because purser needs to create a service-account which requires namespace.
Also, the frontend will use kubernetes DNS to call backend for data and this DNS contains a field for namespace.
# Namespace setup
kubectl create ns purser
# DB setup
curl https://raw.githubusercontent.com/vmware/purser/master/cluster/purser-database-setup.yaml -O
kubectl --namespace=purser create -f purser-database-setup.yaml
# Purser controller setup
kubectl --namespace=purser create -f purser-controller-setup.yaml
# Purser UI setup
curl https://raw.githubusercontent.com/vmware/purser/master/cluster/purser-ui-setup.yaml -O
kubectl --namespace=purser create -f purser-ui-setup.yaml
Use flag --kubeconfig=<absolute path to config> if your cluster configuration is not at the default location.
Client Side Installation (Plugin Installation)
-
Build the purser plugin binary in the
GOPATH/bindirectory.go build -o $GOPATH/bin/purser_plugin github.com/vmware/purser/cmd/plugin -
Install the Purser plugin by copying the
plugin.yamlinto one of the paths specified under the Kubernetes documentation section installing kubectl plugins.