Implementation:Tensorflow Serving GKE Cluster Setup
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Cloud_Infrastructure, Kubernetes |
| Last Updated | 2026-02-13 17:00 GMT |
Overview
Concrete tool for creating a Google Kubernetes Engine cluster for TensorFlow Serving deployment using gcloud CLI commands.
Description
Three gcloud commands provision and configure a GKE cluster:
- gcloud auth login --project authenticates and selects the GCP project
- gcloud container clusters create provisions the cluster with specified node count
- gcloud container clusters get-credentials updates local ~/.kube/config with cluster endpoint and authentication
Usage
Run these commands once to provision the cluster. The cluster persists until explicitly deleted. For production, consider Terraform or infrastructure-as-code tools instead.
Code Reference
Source Location
- Repository: tensorflow/serving
- File: tensorflow_serving/g3doc/serving_kubernetes.md (L168-218)
Signature
# Authenticate and select project
gcloud auth login --project tensorflow-serving
# Create cluster
gcloud container clusters create resnet-serving-cluster --num-nodes 5
# Get credentials for kubectl
gcloud container clusters get-credentials resnet-serving-cluster
Import
# Requires: gcloud SDK
# GCP project with Kubernetes Engine API and billing enabled
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Cluster name | string | Yes | Name for the GKE cluster |
| --num-nodes | int | No | Number of worker nodes (default varies by zone) |
| GCP project | string | Yes | Authenticated GCP project ID |
Outputs
| Name | Type | Description |
|---|---|---|
| GKE cluster | cluster | Running Kubernetes cluster with N nodes |
| ~/.kube/config | file | Updated kubectl configuration for cluster access |
Usage Examples
Create Cluster
# Authenticate
gcloud auth login --project my-project
# Create cluster with 5 nodes
gcloud container clusters create serving-cluster \
--num-nodes=5 \
--machine-type=n1-standard-4
# Get kubectl credentials
gcloud container clusters get-credentials serving-cluster
# Verify
kubectl get nodes
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment