Planning and Configuring

Files to modify

In the Installer container, change to the following folder:
/var/jenkins_home/docker-deploy/gcp/k8s
There are the reference deployment manifests:
  • manifest-single-zone.json for deployment in single zone
  • manifest-multi-zones.json for deployment in multiple zones

Customize Kubernetes Cluster

Since Kubernetes clusters could be set up in many different ways and they can be shared by many applications, it is the Administrator's responsibility to have the cluster set up and be ready for deployment.

Note for MacOS: If you have already installed minikube or kubetctl before, it's better to remove those to do a clean install (remove any trace of previous Kubernetes installation):
  • rm kubectl
  • rm ~/.kube
  • rm ~/.ssh kube*
The following settings should be customized:
"tmg_cluster_name": "Tibco Mashery Local Reference Cluster",

"k8s_gcp_zones": ["us-west1-a", "us-west1-b", "us-west1-c"],

Customize TIBCO Mashery Local Cluster

Note: IMPORTANT! Before you customize your TIBCO Mashery Local cluster, make sure the tml_image_tag matches your Docker image build. For example, to verify "tml_image_tag": "v5.0.0.1", you can check the Docker image build in Jenkins as shown below:

The following settings can be customized:
Note: The tml_image_tag must be updated to match your docker image build. tml_image_registry_host is the registry host for Docker images in GCP. Default is us.gcr.io for US region. tml_image_repo should be the project's ID in GCP under which you are deploying the cluster. k8s_deploy_namespace is the namespace in which Mashery Local 5.1 will be deployed in k8s.
Sample Cluster Configuration (Single Zone):
"tml_image_tag": "v5.1.0.1",
"tml_image_registry_host" : "us.gcr.io",
"tml_image_repo": "mashery-cloud-operations",
"tml_cm_count": 1,
"tml_tm_count": 1,
"tml_cache_count": 1,
"tml_sql_count": 1,
"tml_log_count": 1,
"tml_nosql_count": 1,

"k8s_storage_type": "pd-standard",
"k8s_storage_provisioner": "kubernetes.io/gce-pd",
"k8s_deploy_namespace": "default",
"tml_sql_storage_size": "10Gi",
"tml_log_storage_size": "10Gi",
"tml_nosql_storage_size": "10Gi",
"tml_cache_storage_size": "10Gi",

"tml_tm_http_enabled": "true",
"tml_tm_http_port": 80,
"tml_tm_https_enabled": "true",
"tml_tm_https_port": 443,
"tml_tm_oauth_enabled": "true",
"tml_tm_oauth_port": 8083,

"tml_api_http_enabled": "false",
"tml_api_http_port": 7080,
"tml_api_https_enabled": "false",
"tml_api_https_port": 7443,

"tml_cm_http_enabled": "true",
"tml_cm_http_port": 8080,
"tml_cm_https_enabled": "true",
"tml_cm_https_port": 8443,

"cassandra_max_heap": "512M",
"cassandra_replication_factor": 1
Note:
Single Zone Deployment Multiple Zone Deployment
tml_cm_count Number of Cluster Manager Containers Number of Cluster Manager Containers per zone
tml_tm_count Number of Traffic Manager Containers Number of Traffic Manager Containers per zone
tml_cache_count Number of Memcached Containers Number of Memcached Containers per zone
tml_sql_count Number of MySQL Containers Number of MySQL Containers per zone
tml_log_count Number of Log Service Containers Number of Log Service Containers per zone
tml_nosql_count Number of Cassandra Containers Number of Cassandra Containers per zone

Setting up Mashery Service Configuration Data

Mashery Local offers the option of importing service configuration data offline. A sample data.zip is provided with the TIBCO Mashery Local build that can be loaded into the database during TIBCO Mashery Local cluster creation.

To load the sample data:
  1. In the docker-deploy/gcp/k8s/manifest-single-zone.json file, set tml_cluster_mode as untethered_cm.
  2. Copy the sample data docker-deploy/sample_data/data.zip into the docker-deploy/properties/ directory; this ensures that the data from the data.zip will be automatically loaded in the database when the TIBCO Mashery Local cluster is created.
Note: Make sure that the apiKey and apiSecret is empty in docker-deploy/properties/tml_sql_properties.json if you want to use the offline data loading feature.
TIBCO Mashery Local also offers the capability to sync data from an active MoM server in TIBCO Cloud Mashery at the time of cluster creation. To load the data using the MoM sync configuration:
  1. In the docker-deploy/gcp/k8s/manifest-single-zone.json file, set tml_cluster_mode as tethered.
  2. Specify the following properties in docker-deploy/properties/tml_sql_properties.json:
    "apiKey": "<MOM_API_KEY>",
    "apiSecret": "<MOM_API_SECRET>",
    Note: Do not place the sample data.zip in the docker-deploy/properties/ folder if you are loading the data using the MoM sync configuration.
  1. Set tml_cluster_mode as untethered_api in docker-deploy/gcp/k8s/manifest-single-zone.json.
  2. Call TML V3 API service as described in https://developer.mashery.com/docs/read/mashery_api/30.

Generating Deployment Scripts and Configuration

For single-zone deployment, run the following command and find generated deployment scripts and configuration in the folder manifest-single-zone:
./compose.sh manifest-single-zone.json
For multiple zone deployment, run the following command and find generated deployment scripts and configuration in folder manifest-multi-zones:
./compose.sh manifest-multi-zones.json