Creating a GCP Kubernetes Cluster

To create a GCP Kubernetes cluster:
  1. Navigate to the appropriate folder, depending on whether you are using a single zone or multiple zones.
    • Single zone -/var/jenkins_home/docker-deploy/gcp/k8s/manifest-single-zone
    • Multiple zones - /var/jenkins_home/docker-deploy/gcp/k8s/manifest-multiple-zones
  2. Run the following command:
    ./create-k8s-cluster.sh

What to do next

To verify the deployment of the GCP Kubernetes cluster, use the following command:
kubectl get nodes

Example output:

NAME                                                  STATUS    ROLES     AGE       VERSION
gke-tml-reference-cluste-default-pool-8518f90b-48pq   Ready     <none>    35s       v1.12.8-gke.10
gke-tml-reference-cluste-default-pool-8518f90b-9mfr   Ready     <none>    35s       v1.12.8-gke.10
gke-tml-reference-cluste-default-pool-8518f90b-srs3   Ready     <none>    34s       v1.12.8-gke.10

Creating Static IPs

The Traffic Manager service and Config Manager service(s) are open externally. These services are provided via Load Balancers created in Kubernetes. By default, the Load Balancers use public IPs, which are not reserved; these public IPs may change with a Mashery Local cluster rebuild.

For more information on static IPs, see Configuring Domain Names with Static IP Addresses.

To make the Traffic Manager service and Config Manager service(s) accessible via fixed IPs, static IPs are need in Mashery Local deployment. Administrator can run the create-static-ips.sh script to create static IPs and assign them to the Traffic Manager service and Config Manager service.

To create static IPs:

  1. Navigate to the appropriate folder, depending on whether you are using a single zone or multiple zones.
    • Single zone -/var/jenkins_home/docker-deploy/gcp/k8s/manifest-single-zone
    • Multiple zones - /var/jenkins_home/docker-deploy/gcp/k8s/manifest-multiple-zones
  2. Run the following script:
    ./create-static-ips.sh
    Note: If static IPs had already been created with a previous Mashery Local deployment (the same Mashery Local cluster name), those static IPs will be reused in the Mashery Local cluster deployment.

Example output

ERROR: (gcloud.compute.addresses.describe) Could not fetch resource:
 - The resource 'projects/mashery-cloud-operations/regions/us-central1/addresses/tm-static-ip-73be74c90c1d15d35e8fb03f57d3a140' was not found
 
Created [https://www.googleapis.com/compute/v1/projects/mashery-cloud-operations/regions/us-central1/addresses/tm-static-ip-73be74c90c1d15d35e8fb03f57d3a140].
Static IP for tm in region: 104.154.182.48
 
 
ERROR: (gcloud.compute.addresses.describe) Could not fetch resource:
 - The resource 'projects/mashery-cloud-operations/regions/us-central1/addresses/cm-static-ip-73be74c90c1d15d35e8fb03f57d3a140-0' was not found
 
Created [https://www.googleapis.com/compute/v1/projects/mashery-cloud-operations/regions/us-central1/addresses/cm-static-ip-73be74c90c1d15d35e8fb03f57d3a140-0].
Static IP for cm in zone #0: 104.154.192.166

If an Administrator has already created static IPs, and plans to manually assign them to the Traffic Manager service and Configuration Manager service, the Administrator must edit the following deployment files, located in the folder containing the manifest, as shown in the following table:

Deployment file Original line Updated line
tm-svc.yml #loadBalancerIP: "" loadBalancerIP: "xxx.xxx.xxx.xxx"
cm-svc-0.yml #loadBalancerIP: "" loadBalancerIP: "yyy.yyy.yyy.yyy"
cm-svc-1.yml #loadBalancerIP: "" loadBalancerIP: "zzz.zzz.zzz.zzz"

Note that each line in the .yml files has two leading spaces.

Customers can update the DNS to associate host names with the created static IP addresses. For more information, see "Configure your domain name records" on the following page:

https://cloud.google.com/kubernetes-engine/docs/tutorials/configuring-domain-name-static-ip