Skip to content

Latest commit

 

History

History
112 lines (73 loc) · 3.64 KB

sourcecode-installation.md

File metadata and controls

112 lines (73 loc) · 3.64 KB

Installation Through Source Code

Prerequisites

  1. Kubernetes Version 1.9 or greater

    • kubectl installed and configured. For details refer here.
  2. Dependencies

    • Go

      • version > 1.7
      • setup GOPATH environment variable by as per the Golang documentation.
      • add $GOPATH/bin directory to your environment $PATH variable.
    • Docker

  3. 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
  4. For Windows users, install gnu make from here.

  5. 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.yaml to 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/bin directory.

    go build -o $GOPATH/bin/purser_plugin github.com/vmware/purser/cmd/plugin
  • Install the Purser plugin by copying the plugin.yaml into one of the paths specified under the Kubernetes documentation section installing kubectl plugins.