Skip to content

Fresh objects

When you want to figure out which object are recently created the fresh ones are colored green. It only works with get subcommand.

You can customize threshold level by using environment variable KUBECOLOR_OBJ_FRESH or ~/.kube/color.yaml config field objFreshThreshold with value format time.Duration.

Terminal window
export KUBECOLOR_OBJ_FRESH="10h"

Demo:

kubectl get pods NAME READY STATUS RESTARTS AGE grafana-6b978df578-tvchh 1/1 Running 0 1h30m nginx-7c5ddbdf54-9d575 1/1 Running 0 12d nginx-7c5ddbdf54-f6wft 1/1 Running 0 12d postgresql-0 1/1 Running 0 5h traefik-6b445777bf-xknsw 1/1 Running 0 15m export KUBECOLOR_OBJ_FRESH=10h kubectl get pods NAME READY STATUS RESTARTS AGE grafana-6b978df578-tvchh 1/1 Running 0 1h30m nginx-7c5ddbdf54-9d575 1/1 Running 0 12d nginx-7c5ddbdf54-f6wft 1/1 Running 0 12d postgresql-0 1/1 Running 0 5h traefik-6b445777bf-xknsw 1/1 Running 0 15m

Default value is 0s, meaning the feature is disabled.