This repository creates a private GKE cluster in your organization within a Shared VPC setup.
Make sure you have the right permissions to create the needed resources:
- roles/resourcemanager.projectCreator: Create projects.
- roles/compute.admin: Network and compute resources.
- roles/container.admin: Kubernetes resources.
‼️ The above list is non exhaustive
Create the terraform.tfvars
file by copying the terraform.tfvars.example
file. Adjust it to your organization parameters.
billing_account
: The billing account ID to which the resources will be associated to.org_id
: Your GCP org ID.project_unique_id
: A random string to prevent project name collisions. You can manually type or auto generate. Only needed every time you want to create the setup on a clean project.master_authorized_networks
: CIDR ranges of allowed ranges that can connect to the cluster.
Run the following command to create all resources.
terraform apply
Run the following commands to configure your kubectl client.
Optionally setup a new gcloud
configuration.
gcloud config configurations create poc
gcloud config set project <service-project-id>
gcloud config set account <your-company-account>
Configure kubectl.
gcloud container clusters list
gcloud container clusters get-credentials gke-gpu-cluster --location <listed-location-above>
Verify by listing nodes
kubectl get nodes