Creating a TIBCO Local Mashery Cluster

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

Creating the Kubernetes cluster

  1. Navigate to the folder docker-deploy/onprem/k8s/manifest-single-zone. Put all the TIBCO Mashery Local images in this folder (that you downloaded earlier) and execute the following command:
    Note:

    If you built the TIBCO Mashery Local images using tml-installer, you need to copy those images from that build machine to this location on deployment host.

    ./create-local-k8s-cluster.sh
    This will create a local k8s cluster consisting of one Kubernetes master node and the number of worker nodes you specified in the manifest-single-zone.json. Default cluster consists of one Kubernetes master and one worker node and it takes around 15 minutes. The script also deletes any previous kube configuration file at the location ~/.kube/config and creates a new configuration file for the newly-created cluster at this location so that you can execute any kubectl command from your terminal. Also, make sure you can ping the VMs with the IP (192.168.99.110, in case of default) from your local machine. If not, please resolve this first. The issue could be related with VirtualBox networking.
  2. Verify that the cluster is created successfully by running the following command. Status should be Ready for all the nodes. Do not proceed until all the nodes are in Ready status.
    kubectl get nodes
Sample output for 1 master and 2 nodes:
NAME      STATUS    ROLES     AGE       VERSION

master    Ready     master    7m        v1.10.5

node-1    Ready     <none>    4m        v1.10.5

node-2    Ready     <none>    29s       v1.10.5
Note: Important! If you modified the k8s_deploy_namespace to deploy Mashery Local 5.1 in a specific namespace in k8s cluster, you need to configure kubectl again for the given namespace. After running the above command, your kube config file (~/.kube/config) will have entry for the GCP k8s cluster and user as shown below.
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: XYZ
    server: https://<K8S Server>
  name: gke_mashery-local-51
contexts:
- context:
    cluster: gke_mashery-local-51
    user: gke_mashery-local-51
  name: gke_mashery-local-51
current-context: gke_mashery-local-51
kind: Config
preferences: {}
users:
- name: gke_mashery-local-51
  user:
    auth-provider:
      config:
        cmd-args: config config-helper --format=json
        cmd-path: /Users/Ashkumar/Downloads/google-cloud-sdk/bin/gcloud
        expiry-key: '{.credential.token_expiry}'
        token-key: '{.credential.access_token}'
      name: gcp

Note down the value of cluster and user.

Execute the following commands to create a new context for the namespace you want to deploy and configure kubectl to use the new context:
  1. kubectl config set-context <conext-name>
    --namespace=<namespace_value provided in the
    manifest-single-zone.json> --cluster=<k8s cluster name >
    --user=<k8s user>
    Sample command:
    kubectl config set-context mashery-dev --namespace=mashery
    --cluster=gke_mashery-local-51 --user=gke_mashery-local-51
  2. kubectl config use-context <context-name>
    Sample command:
    kubectl config use-context mashery-dev

Creating the TIBCO Mashery Local Cluster

  1. Execute the following command. This deploys the desired number of Mashery Local containers on the local cluster. It will show the progress on the terminal itself.
    ./create-tml-cluster.sh
    You can verify your deployment by running the command kubectl get pods. It should list all the pods. Sample output:
    NAME                            READY     STATUS    RESTARTS   AGE
    
    cache-deploy-54c7f7df6b-6w5h4   1/1       Running   0          15m
    
    cache-deploy-54c7f7df6b-w66vs   1/1       Running   0          15m
    
    cass-set-0                      1/1       Running   0          17m
    
    cass-set-1                      1/1       Running   0          16m
    
    db-set-0                        1/1       Running   0          15m
    
    db-set-1                        1/1       Running   0          15m
    
    log-set-0                       1/1       Running   0          16m
    
    tm-deploy-54bb9dddb8-cg2l4      1/1       Running   0          15m
    
    tm-deploy-54bb9dddb8-fdz6c      1/1       Running   0          15m