Read control-plane logs
Choose which control-plane logs are collected, and read the Kubernetes audit log and the API server, authenticator, controller manager and scheduler logs.
Replace my-cluster with your cluster's name or id. Logs are kept 7 days.
| Type | What | Default |
|---|---|---|
audit |
The Kubernetes audit log: every write, every refusal and every request by a person or a workload. Successful reads by the cluster's own components are left out. | on |
api |
kube-apiserver | off |
authenticator |
kube-apiserver's authentication | off |
controllerManager |
kube-controller-manager | off |
scheduler |
kube-scheduler | off |
Prerequisites
- Permission for
eks:GetClusterLogson the cluster to read them (without it the Logs tab shows a refusal);eks:UpdateClusterConfigto choose the types. - In the console, also
eks:DescribeClusterto open the cluster.
Choose the log types
- Open Kubernetes, open the cluster, then choose Logs.
- Under Collected log types, turn each type on or off. Each switch is saved at once.
dcloud eks clusters update my-cluster --logging '{"types":["audit","api"]}'PATCH /eks/api/clusters/my-cluster
{ "logging": { "types": ["audit", "api"] } }resource "dcloud_eks_cluster" "main" {
name = "my-cluster"
logging = jsonencode({ types = ["audit", "api"] })
}The list replaces the types as a whole; [] collects none. Only types turned on are collected.
Read the logs
- On the Logs tab, under Log lines, choose the type (or All types) and the time window.
- (Optional) Enter text the lines must contain.
The window is Last hour at first; the console shows up to 500 lines, newest first, and refreshes every 15 seconds. Choose a line to see it in full; an audit line is summarized as who did what to which object.
dcloud eks clusters logs my-cluster --type audit --contains deleteGET /eks/api/clusters/my-cluster/logs?type=audit&contains=deleteNot available in Terraform. Reading logs is not a resource.
In the CLI and the API, without since the hour before until (default: now) is returned; lines
come newest first, 200 by default (limit, at most 1000). contains ignores case. Without
eks:GetClusterLogs the answer is 403.