Planning and Configuration for a New Cluster on On-premises VirtualBox using Kubernetes

Files to Modify

Only Single zone deployment is supported for on-premises deployment.

After building the Mashery Local images, copy the /var/jenkins_home/docker-deploy folder in the tml-installer container to the desired host from where you want to run the deployment. If your build and deployment host are the same, the following sample command will copy the docker-deploy folder from the container to the current working directory on the local machine:
docker cp tml-installer:/var/jenkins_home/docker-deploy .
The following file is a reference deployment manifest in the tml-installer container for deployment in a single zone: docker-deploy/onprem/k8s/manifest-single-zone.json

Kubernetes Configuration

The On-premises deployment will create Virtual Box instances for each Kubernetes node.

The k8s cluster creation script creates one Kubernetes Master Node VM and the given number of worker VMs where Mashery Local containers will be deployed.

The Kubernetes master VM needs at least 2 GB of memory.

A Kubernetes worker Node VM needs at least 6 GB of memory for even the smallest deployment containing a single instance of each Mashery Local component.

So if you plan to create a cluster of 1 Kubernetes master VM and one Kubernetes worker VM, plan for minimum 8 GB of memory for the cluster to work properly.

Edit the reference deployment file docker-deploy/onprem/k8s/manifest-single-zone.json:
"tml_cluster_name": "Tibco Mashery Local Reference Cluster",
"k8s_local_zones": ["local"],

"k8s_provider": "kubeadm",
"k8s_master_count": "1",
"k8s_master_memory": "2048",
"k8s_master_cpu": "2",
"k8s_node_count": "1",
"k8s_node_memory": "6144",
"k8s_node_cpu": "2",

Mashery Local Component configuration

The following settings can be customized. The tml_image_tag must be updated to match your Docker image build.
Note:
Variable Prefix Description
tml_cm Mashery Local Cluster Manager Component
tml_tm Mashery Local Traffic Manager Component
tml_cache Mashery Local Cache Component
tml_sql Mashery Local SQL Component
tml_log Mashery Local Log Component
tml_nosql Number of Cassandra Component
"tml_image_tag": "v5.1.0.1",
"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": "gp2",
"k8s_storage_provisioner": "kubernetes.io/no-provisioner",
"k8s_deploy_namespace": "default",
"tml_sql_storage_size": "2Gi",
"tml_log_storage_size": "2Gi",
"tml_nosql_storage_size": "2Gi",
"tml_cache_storage_size": "2Gi",

"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": 8080,
"tml_api_https_enabled": "false",
"tml_api_https_port": 8443,

"tml_cm_http_enabled": "true",
"tml_cm_http_port": 9080,
"tml_cm_https_enabled": "true",
"tml_cm_https_port": 9443,

"cassandra_max_heap": "512M",
"cassandra_replication_factor": 1

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/onprem/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. Default is blank.
TIBCO Mashery Local also offers the capability to sync data from an active MoM (Mashery on-premises Manager) server in TIBCO Cloud Mashery at the time of cluster creation. To load the data using the MoM sync configuration, please specify the following three properties in the tml_sql_properties.json:
  1. In the docker-deploy/onprem/k8s/manifest-single-zone.json file, set tml_cluster_mode as tethered.
  2. Specify the following properties in the docker-deploy/properties/tml_sql_properties.json file:
    "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/onprem/k8s/manifest-single-zone.json.
  2. Call TML V3 API service. See https://developer.mashery.com/docs/read/mashery_api/30.