Installing GKE
8 May 2023 · Read time 5 min
Introduction
This section covers the creation of a GKE Kubernetes container and cluster.
We start with this section with the assumption that you already have a Google Cloud account and know how to create a kubernetes environment. Included are links to installation sections that guide you through the process of installing the Google development environment. When you finish this section, you will be ready to use the Altinity Cloud Manager to provision and manage ClickHouse clusters.
Prerequisites Check that each of the items in the following list are complete:
- gcloud - Google Console CLI (
gcloud version
) - kubectl Kubernetes | Altinity (
kubectl config view
) - You are logged in to gcloud (
gcloud auth login
) - You have set the Project ID is set (
gcloud config list
)
Preparing your client computer for install Google GKE from the terminal includes the following sections:
After completing the preliminary setup, you are ready to set up an Altinity.Cloud ClickHouse connection to your Google environment:
Create Kubernetes Container
The networks create command creates a GKE Kubernetes container that to host a cluster.
For more information, check out the following Google GKE documentation.
- Google Cloud: Creating a regional cluster
To create a GKE Kubernetes container:
- Copy and paste the following command to your terminal.
NOTE: This step takes a few minutes to complete.
# Create Kubernetes 'kubernetes-1' gcloud compute networks create kubernetes-1 \ --bgp-routing-mode regional \ --subnet-mode custom
Figure 1 - The command to create kubernetes-1 and Google’s response.
Create a Google cluster
The clusters create command creates a GKE cluster inside the Google kubernetes container. Altinity then uses this cluster to set up ClickHouse when you use the Connection Setup wizard.
Use your browser to review the Google Kubernetes console to see the new cluster.
To create a new GKE cluster:
- Copy and paste the following command to your terminal:
# Create Cluster 'cluster-1' inside Kubernetes 'kubernetes-1' gcloud container clusters create cluster-1 \ --region us-west1 \ --node-locations us-west1-a,us-west1-b \ --machine-type n2-standard-4 \ --network kubernetes-1 \ --create-subnetwork name=k-subnet-1 \ --enable-ip-alias
Figure 2 - Running the clusters create
command. The blue-highlighted items in the example screenshot are example values that you can alter by following Altinity recommendations.
Credential Setup
The get-credentials command sets up your local config file so that kubectl commands are authorized to talk to the Google GKE.
Once the cluster is ready, use the following get-credentials
command to allow kubectl to issue commands to Kubernetes. Highlighted in blue in the terminal screenshot is the name of the cluster cluster-1, the region us-west1, and the project name in this example any-test-gke.
NOTE: Figure 1 shows the project name as any-test-gke.
To authorize kubectl commands to access Google clusters:
-
Copy and paste the following command to your terminal:
gcloud container clusters get-credentials cluster-1 \ --region us-west1 \ --project my-project
Figure 3 - Running the Google get-credentials
command so that kubectl commands are authorized to talk to the Google GKE environment.
Altinity Cloud Manager Connection Setup
After completing the preliminary setup, you are ready to set up an Altinity.Cloud ClickHouse connection to your Google environment:
Feedback
Was this page helpful?
Glad to hear it!
Sorry to hear that. We'll track this issue and see how we can improve.