Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to access Kubernetes apiserver audit logs.
Overview
Each GKE On-Prem cluster has
Kubernetes Audit Logging, which keeps a chronological
record of calls made to the cluster's Kubernetes API server.
Audit logs are useful for investigating suspicious API
requests or for collecting statistics.
Audit logs from each apiserver are dumped to a persistent disk, so
that VM restarts/upgrades won't cause the logs to disapppear.
GKE On-Prem retains up to 10GB of audit logs.
Accessing Kubernetes audit logs
You can only access audit logs through the admin cluster:
View the Kubernetes API servers running in your clusters:
kubectl get pods --all-namespaces -l component=kube-apiserver
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-05 UTC."],[[["This page outlines how to access Kubernetes apiserver audit logs in GKE On-Prem clusters, which are chronological records of calls made to the cluster's Kubernetes API server."],["Audit logs are stored on a persistent disk to prevent data loss during VM restarts or upgrades, and GKE On-Prem retains up to 10GB of these logs."],["Accessing audit logs is done solely through the admin cluster, using `kubectl` commands to identify the API servers and then copy the audit log files from the respective pod."],["The most recent audit log file can contain up to 1GB of data for admin clusters and up to 850GB for user clusters, with older logs available in separate files that are timestamped."],["The audit logging behaviour is governed by a static Kubernetes audit logging policy, which is not currently configurable."]]],[]]