A Google Kubernetes Engine (GKE) cluster consists of a control plane and worker machines called nodes. You can run your containerized Kubernetes workloads in a GKE cluster. Nodes are the worker machines that run your containerized applications and other workloads, and the control plane is the unified endpoint for your cluster. For more information, see GKE cluster architecture.
The Kubernetes API server runs on the control plane, allowing you to interact with Kubernetes objects in the cluster through Kubernetes API calls. Objects are persistent entities in the Kubernetes system and represent the state of your cluster. For more information, in the Kubernetes documentation, see Objects in Kubernetes, and the API Overview which links to the "Kubernetes API reference" pages.
This document shows you how to use the Kubernetes API connector in a workflow to make requests to the Kubernetes service endpoint hosted on a GKE cluster's control plane. For example, you can use the connector to create Kubernetes Deployments, run Jobs, manage Pods, or access deployed apps through a proxy. For more information, see the Kubernetes API Connector Overview.
Before you begin
Before you proceed with the tasks in this document, make sure that you have completed certain prerequisites.
Enable APIs
Before you can access Kubernetes API objects using the Kubernetes API connector, you must enable the following APIs:
- Kubernetes Engine API: to build and manage container-based applications using GKE
Workflows APIs: to manage workflow definitions and executions; enabling the Workflows API automatically enables the Workflow Executions API
Console
Enable the APIs:
gcloud
In the Google Cloud console, activate Cloud Shell.