A kubectl plugin to display colorized fields of the kubernetes resources based on their managed fields.
$ go install github.com/tt-kuma/kubectl-colorize-managed-fields/cmd/kubectl-colorize-managed-fields@latest
Here is an example of a resource applied by specifying a field manager.
$ cat <<EOF | kubectl apply -f - --server-side --field-manager sample-manager
apiVersion: v1
kind: ConfigMap
metadata:
name: sample
data:
key1: value1
key2: value2
key3: value3
EOF
Run kubectl colorize-managed-fields
. You can specify target resources like kubectl get
.
$ kubectl colorize-managed-fields configmaps sample
You can see the following yaml with colorized fields based on managed fields.
For another example, overwrite some fields by specifying another field manager.
$ cat <<EOF | kubectl apply -f - --server-side --field-manager new-sample-manager --force-conflicts
apiVersion: v1
kind: ConfigMap
metadata:
name: sample
data:
key1: new-value1
key2: value2
EOF
When multiple manager exists, each manager assigned a different color. The fields managed by multiple managers are colorized by fixed color indicating a conflict.
kubectl-colorize-managed-fields is licensed under the Apache License 2.0.