Google GKE
Core pluginmarmotdata/gke
Discover namespaces, services, workloads, and cron jobs from Google GKE clusters
The GKE plugin discovers namespaces, services, deployments, stateful sets, cron jobs, and pods from Google Kubernetes Engine clusters. It is the Kubernetes plugin's discovery engine with Google Cloud authentication, so the assets, lineage, and run history it produces are identical. See the Kubernetes plugin for details on what gets discovered and how resources are linked.
Authentication uses Google Cloud IAM: on each run the plugin mints a short-lived OAuth token from the Google credentials of wherever Marmot runs. There is no static token to store or rotate. This is the clean way to read a GKE cluster from a GCE instance, Cloud Run, or another Google Cloud workload.
Prerequisites
The identity Marmot runs as needs read access to the cluster, granted two ways:
First, a Google Cloud IAM role that allows connecting to the cluster (for example roles/container.viewer), so Google authorizes the token.
Second, a read-only Kubernetes RBAC role bound to that identity:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: marmot-discovery
rules:
- apiGroups: [""]
resources: ["namespaces", "services", "pods"]
verbs: ["get", "list"]
- apiGroups: ["apps"]
resources: ["deployments", "statefulsets", "replicasets"]
verbs: ["get", "list"]
- apiGroups: ["batch"]
resources: ["cronjobs", "jobs"]
verbs: ["get", "list"]
Credentials resolve from Application Default Credentials: Workload Identity, a Cloud Run or GCE service account, or GOOGLE_APPLICATION_CREDENTIALS. When Marmot runs outside Google Cloud, set credentials.credentials_json (or credentials.credentials_file) to a service account key.
Connecting to a cluster
Name the cluster and the plugin resolves its endpoint and CA certificate from the GKE management API. Set project_id, location, and cluster. This needs the container.clusters.get permission (included in roles/container.viewer).
project_id: "my-project"
location: "us-central1"
cluster: "autopilot-cluster-1"
In the UI
Point-and-click, no config file needed.
- 1 Open
Runs→Create Pipeline - 2 Pick Google GKE from the plugin list.
- 3 Fill in the wizard, set a schedule, save.
With the CLI
Save a YAML config, then run marmot ingest.
name: my-gke-pipeline
runs:
- gke:
project_id: "<project_id>"
location: "<location>"
cluster: "<cluster>"marmot ingest -c ingest.yaml Not using plugins? Other ways to populate Marmot
Configuration
19 top-level fields.
tags multiselect Tags to apply to discovered assets
external_links object[] External links to show on all assets
name string Display name for the link
icon string Icon identifier for the link
url string URL to the external resource
filter object Filter discovered assets by name (regex)
include multiselect Include patterns for resource names (regex)
exclude multiselect Exclude patterns for resource names (regex)
cluster_name string Cluster name to prefix asset names with
namespaces multiselect Namespaces to discover. Empty or ["*"] means all namespaces
exclude_namespaces multiselect Namespaces to skip when discovering all namespaces
["kube-system","kube-public","kube-node-lease"] label_selector string Only discover namespaced resources matching this label selector (e.g. team=data)
discover_namespaces bool Discover namespaces
true discover_services bool Discover services
true discover_deployments bool Discover deployments
true discover_statefulsets bool Discover stateful sets
true discover_cronjobs bool Discover cron jobs, with their recent job runs as run history
true discover_pods bool Discover pods. Off by default because pods are short-lived and can flood the catalog
false labels_to_metadata bool Include resource labels in asset metadata
true annotations_to_metadata bool Include resource annotations in asset metadata
false credentials object GCP credentials configuration
credentials_json password Service account key JSON content
credentials_file string Path to a service account key JSON file
project_id string GCP project ID
location string Cluster region or zone, for example us-central1
cluster string GKE cluster name