Setting up Cellery on GCP

Madhuka Wickramapala
wso2-cellery
Published in
4 min readAug 15, 2019

Prerequisites

Before setting up cellery runtime you need to have a GCP account created and Gloud SDK installed in your machine. You also need to have installed Cellery.

Introduction

Cellery provides a developer runtime, tooling and a management plane which allows developers to run and manage their composite microservice applications on kubernetes. GCP is one of the platforms which cellery can be installed onto.

Configuring GCP project

If you have not already created a project, use gcloud init command to create a GCP project. It is important to note that gcloud must be configured to the project in which you want to install cellery runtime onto. Also make sure that billing is enabled for that project.

GCP project creation

Here I have created a gcp project named “vick-team” and set the region as “us-west1” and the zone as “us-west1-b”. Make sure that region and zone are set correctly. Execute gcloud config list --format json to get the region and zone details.

Gcloud config list

If region or zone is not set properly go to GCP console and select default region and zone for your project. You can also use the gcloud cli to set the project zone and region.

gcloud config set project <project name>
gcloud config set compute/region <region>
gcloud config set compute/zone <zone>

Enabling GCP Apis needed for Cellery

We need to enable some GCP Apis which will be used to create resources in GCP. Go to GCP console then select APIs and Services from menu pane and select Dashboard as shown below.

Enabling GCP Apis

Next click on ENABLE APIS AND SERVICES button at the top and enable “Cloud Engine API”, “Kubernetes API”, “Cloud Filestore API” and “Cloud SQL Admin API”. Alternatively you can enable those Apis by executing below command.

gcloud services enable container.googleapis.com file.googleapis.com sqladmin.googleapis.com 

An Api key is needed to access the above mentioned Apis. Go to IAM and admin from the left menu and select “Service accounts” as shown below.

Generating Api key (1)

Then select the default service account (In this case “vick-team”)> Create Key > JSON option, and download the JSON file.

Generating Api key (2)

Copy the generated json file into $HOME/.cellery/gcp folder .

Installing Cellery on GCP

Now everything is ready to install cellery onto GCP and there are two methods : interactive and non-interactive mode.

Interactive method

Execute cellery setup and select Create > GCP > basic or complete. This will create a cellery installation on GCP.

Installing cellery via interactive method

Non-interactive method

To create a basic cellery runtime in non-interactive mode execute cellery setup create gcp and execute cellery setup create gcp --complete -y to create a complete cellery runtime.

Configuring host entries

Execute kubectl get ingress -n cellery-system and get the nginx ip address. Then update the /etc/hosts file with that ip address to access the system components exposed by cellery.

<IP Address> wso2-apim cellery-dashboard wso2sp-observability-api wso2-apim-gateway cellery-k8s-metrics idp.cellery-system 

Removing Cellery runtime from GCP

Users can remove the created cellery runtime from GCP via Cellery CLI.

Interactive method

Execute cellery setup and select Manage > GCP> cleanup and select the GCP cluster name. This will remove the GCP cluster as well as all the resources; Sql instance, File store and storage.

Removing cellery via interactive method

Non-interactive method

To remove cellery runtime in non-interactive mode execute cellery setup cleanup gcp <CLUSTER_NAME> .

In the next article we will discuss how to setup cellery on Docker-For-Mac.

--

--