Teleport GKE Auto-Discovery
The Teleport Discovery Service can automatically register your Google Kubernetes Engine (GKE) clusters with Teleport. With Teleport Kubernetes Discovery, you can configure the Teleport Kubernetes Service and Discovery Service once, then create GKE clusters without needing to register them with Teleport after each creation.
In this guide, we will show you how to get started with Teleport Kubernetes Discovery for GKE.
Overview
Teleport cluster auto-discovery involves two components:
- The Teleport Discovery Service that watches for new clusters or
changes to previously discovered clusters.
It dynamically registers each discovered cluster as a
kube_cluster
resource in your Teleport cluster. It does not need connectivity to the clusters it discovers. - The Teleport Kubernetes Service that monitors the dynamic
kube_cluster
resources registered by the Discovery Service. It proxies communications between users and the cluster.
This guide presents the Discovery Service and Kubernetes Service running in the same process, however both can run independently and on different machines.
For example, you can run an instance of the Kubernetes Service in the same private network as the clusters you want to register with your Teleport cluster, and an instance of the Discovery Service in any network you wish.
Prerequisites
-
A running Teleport cluster version 16.4.8 or above. If you want to get started with Teleport, sign up for a free trial or set up a demo environment.
-
The
tctl
admin tool andtsh
client tool.Visit Installation for instructions on downloading
tctl
andtsh
.
- A Google Cloud account with permissions to create GKE clusters, IAM roles, and service accounts.
- The
gcloud
CLI tool. Follow the Google Cloud documentation page to install and authenticate togcloud
. - One or more GKE clusters running. Your Kubernetes user must have permissions
to create
ClusterRole
andClusterRoleBinding
resources in your clusters. - A Linux host where you will run the Teleport Discovery and Kubernetes services. You can run this host on any cloud provider or even use a local machine.
- To check that you can connect to your Teleport cluster, sign in with
tsh login
, then verify that you can runtctl
commands using your current credentials. For example:If you can connect to the cluster and run the$ tsh login --proxy=teleport.example.com --user=email@example.com
$ tctl status
# Cluster teleport.example.com
# Version 16.4.8
# CA pin sha256:abdc1245efgh5678abdc1245efgh5678abdc1245efgh5678abdc1245efgh5678tctl status
command, you can use your current credentials to run subsequenttctl
commands from your workstation. If you host your own Teleport cluster, you can also runtctl
commands on the computer that hosts the Teleport Auth Service for full permissions.