Creating the Kubernetes Cluster on GCP
Use the GCP console to create a new Kubernetes cluster:
- Open the Google Cloud Platform console at https://console.cloud.google.com/home/dashboard.
- Click on the Menu (Products & Services) button on the top left of the page and select Kubernetes Engine.
- Select
Create cluster in the pop-up that opens up on the window.
Walk through the different options and information needed to create a cluster, then click Create. - Refer to the information below for extra details.
Note:Once the cluster is created it should show up similar to the following image.
Single or Multiple Zone
To create single zone cluster, select Zonal in Location Type. To create multi-zone cluster, select Regional in Location Type.
Select No of Nodes as per desired number of TIBCO Mashery Local components. In case of Regional/ Multi zone, GCP will create the same number of nodes in each zone and deploy same of TIBCO Mashery Local components on each zone. So plan accordingly as per cluster requirement.
It is recommended to use 4 core CPU with 15 GB memory (n1-standar-4) in Machine type.
Install the Kubernetes Dashboard UI
Click
Connect in the console to reveal the
gcloud commands to execute (the following is an excerpt):
The output from the first command should look like the following.
Fetching cluster endpoint and auth data. kubeconfig entry generated for ml5-single-zone.
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 commands to create a new context for the namespace you want to deploy and configure kubectl to use the new context.
-
kubectl config set-context <conext-name> --namespace=<namespace_value provided in the manifest-single-zone.json or manifest-multi-zones.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
-
kubectl config use-context <context-name>
Sample command:kubectl config use-context mashery-dev
Copyright © Cloud Software Group, Inc. All rights reserved.