davidB / kubectl-view-allocations

kubectl plugin to list allocations (cpu, memory, gpu,... X utilization, requested, limit, allocatable,...)

Home Page:https://crates.io/crates/kubectl-view-allocations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Verbose logging using 0.14.1

mveitas opened this issue · comments

Using the latest plugin version, when trying to run kubectl view-allocations -g node I get the following output

(⎈ |dev3:kube-system)➜ Downloads k view-allocations -g node -n kube-system {"v":0,"name":"kubectl_view_allocations","msg":"{\"kind\":\"PodList\",\"apiVersion\":\"v1\",\"metadata\":{\"selfLink\":\"/api/v1/namespaces/kube-system/pods\",\"resourceVersion\":\"263148227\"},\"items\":[{\"metadata\":{\"name\":\"aws-node-67mt6\",\"generateName\":\"aws-node-\",\"namespace\":\"kube-system\",\"selfLink\":\"/api/v1/namespaces/kube-system/pods/aws-node-67mt6\",\"uid\":\"dda70fa2-bd43-4b27-838b-d604762606af\",\"resourceVersion\":\"262298067\",\"creationTimestamp\":\"2021-06-29T11:10:41Z\",\"labels\":{\"controller-revision-hash\":\"65df9886c9\",\"k8s-app\":\"aws-node\",\"pod-template-generation\":\"4\"},\"annotations\":{\"kubernetes.io/psp\":\"eks.privileged\"},\"ownerReferences\":[{\"apiVersion\":\"apps/v1\",\"kind\":\"DaemonSet\",\"name\":\"aws-node\",\"uid\":\"52c6b4df-a80b-11e9-90db-0ad39c728456\",\"controller\":true,\"blockOwnerDeletion\":true}],\"managedFields\":[{\"manager\":\"kube-controller-manager\",\"operation\":\"Update\",\"apiVersion\":\"v1\",\"time\":\"2021-06-29T11:10:41Z\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:metadata\":{\"f:generateName\":{},\"f:labels\":{\".\":{},\"f:controller-revision-hash\":{},\"f:k8s-app\":{},\"f:pod-template-generation\":{}},\"f:ownerReferences\":{\".\":{},\"k:{\\\"uid\\\":\\\"52c6b4df-a80b-11e9-90db-0ad39c728456\\\"}\":{\".\":{},\"f:apiVersion\":{},\"f:blockOwnerDeletion\":{},\"f:controller\":{},\"f:kind\":{},\"f:name\":{},\"f:uid\":{}}}},\"f:spec\":{\"f:affinity\":{\".\":{},\"f:nodeAffinity\":{\".\":{},\"f:requiredDuringSchedulingIgnoredDuringExecution\":{\".\":{},\"f:nodeSelectorTerms\":{}}}},\"f:containers\":{\"k:{\\\"name\\\":\\\"aws-node\\\"}\":{\".\":{},\"f:env\":{\".\":{},\"k:{\\\"name\\\":\\\"ADDITIONAL_ENI_TAGS\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_VPC_CNI_NODE_PORT_SUPPORT\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_VPC_ENI_MTU\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_VPC_K8S_CNI_CONFIGURE_RPFILTER\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_VPC_K8S_CNI_EXTERNALSNAT\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_VPC_K8S_CNI_LOGLEVEL\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_VPC_K8S_CNI_LOG_FILE\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_VPC_K8S_CNI_RANDOMIZESNAT\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_VPC_K8S_CNI_VETHPREFIX\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_VPC_K8S_PLUGIN_LOG_FILE\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"AWS_VPC_K8S_PLUGIN_LOG_LEVEL\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"DISABLE_INTROSPECTION\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"DISABLE_METRICS\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"ENABLE_POD_ENI\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}},\"k:{\\\"name\\\":\\\"MY_NODE_NAME\\\"}\":{\".\":{},\"f:name\":{},\"f:valueFrom\":{\".\":{},\"f:fieldRef\":{\".\":{},\"f:apiVersion\":{},\"f:fieldPath\":{}}}},\"k:{\\\"name\\\":\\\"WARM_ENI_TARGET\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}}},\"f:image\":{},\"f:imagePullPolicy\":{},\"f:livenessProbe\":{\".\":{},\"f:exec\":{\".\":{},\"f:command\":{}},\"f:failureThreshold\":{},\"f:initialDelaySeconds\":{},\"f:periodSeconds\":{},\"f:successThreshold\":{},\"f:timeoutSeconds\":{}},\"f:name\":{},\"f:ports\":{\".\":{},\"k:{\\\"containerPort\\\":61678,\\\"protocol\\\":\\\"TCP\\\"}\":{\".\":{},\"f:containerPort\":{},\"f:hostPort\":{},\"f:name\":{},\"f:protocol\":{}}},\"f:readinessProbe\":{\".\":{},\"f:exec\":{\".\":{},\"f:command\":{}},\"f:failureThreshold\":{},\"f:initialDelaySeconds\":{},\"f:periodSeconds\":{},\"f:successThreshold\":{},\"f:timeoutSeconds\":{}},\"f:resources\":{\".\":{},\"f:limits\":{\".\":{},\"f:cpu\":{},\"f:memory\":{}},\"f:requests\":{\".\":{},\"f:cpu\":{},\"f:memory\":{}}},\"f:securityContext\":{\".\":{},\"f:capabilities\":{\".\":{},\"f:add\":{}}},\"f:terminationMessagePath\":{},\"f:terminationMessagePolicy\":{},\"f:volumeMounts\":{\".\":{},\"k:{\\\"mountPath\\\":\\\"/host/etc/cni/net.d\\\"}\":{\".\":{},\"f:mountPath\":{},\"f:name\":{}},\"k:{\\\"mountPath\\\":\\\"/host/opt/cni/bin\\\"}\":{\".\":{},\"f:mountPath\":{},\"f:name\":{}},\"k:{\\\"mountPath\\\":\\\"/host/var/log/aws-routed-eni\\\"}\":{\".\":{},\"f:mountPath\":{},\"f:name\":{}},\"k:{\\\"mountPath\\\":\\\"/run/xtables.lock\\\"}\":{\".\":{},\"f:mountPath\":{},\"f:name\":{}},\"k:{\\\"mountPath\\\":\\\"/var/run/aws-node\\\"}\":{\".\":{},\"f:mountPath\":{},\"f:name\":{}},\"k:{\\\"mountPath\\\":\\\"/var/run/dockershim.sock\\\"}\":{\".\":{},\"f:mountPath\":{},\"f:name\":{}}}}},\"f:dnsPolicy\":{},\"f:enableServiceLinks\":{},\"f:hostNetwork\":{},\"f:initContainers\":{\".\":{},\"k:{\\\"name\\\":\\\"aws-vpc-cni-init\\\"}\":{\".\":{},\"f:env\":{\".\":{},\"k:{\\\"name\\\":\\\"DISABLE_TCP_EARLY_DEMUX\\\"}\":{\".\":{},\"f:name\":{},\"f:value\":{}}},\"f:image\":{},\"f:imagePullPolicy\":{},\"f:name\":{},\"f:resources\":{},\"f:securityContext\":{\".\":{},\"f:privileged\":{}},\"f:terminationMessagePath\":{},\"f:terminationMessagePolicy\":{},\"f:volumeMounts\":{\".\":{},\"k:{\\\"mountPath\\\":\\\"/host/opt/cni/bin\\\"}\":{\".\":{},\"f:mountPath\":{},\"f:name\":{}}}}},\"f:priorityClassName\":{},\"f:restartPolicy\":{},\"f:schedulerName\":{},\"f:securityContext\":{},\"f:serviceAccount\":{},\"f:serviceAccountName\":{},\"f:terminationGracePeriodSeconds\":{},\"f:tolerations\":{},\"f:volumes\":{\".\":{},\"k:{\\\"name\\\":\\\"cni-bin-dir\\\"}\":{\".\":{},\"f:hostPath\":{\".\":{},\"f:path\":{},\"f:type\":{}},\"f:name\":{}},\"k:{\\\"name\\\":\\\"cni-net-dir\\\"}\":{\".\":{},\"f:hostPath\":{\".\":{},\"f:path\":{},\"f:type\":{}},\"f:name\":{}},\"k:{\\\"name\\\":\\\"dockershim\\\"}\":{\".\":{},\"f:hostPath\":{\".\":{},\"f:path\":{},\"f:type\":{}},\"f:name\":{}},\"k:{\\\"name\\\":\\\"log-dir\\\"}\":{\".\":{},\"f:hostPath\":{\".\":{},\"f:path\":{},\"f:type\":{}},\"f:name\":{}},\"k:{\\\"name\\\":\\\"run-dir\\\"}\":{\".\":{},\"f:hostPath\":{\".\":{},\"f:path\":{},\"f:type\":{}},\"f:name\":{}},\"k:{\\\"name\\\":\\\"xtables-lock\\\"}\":{\".\":{},\"f:hostPath\":{\".\":{},\"f:path\":{},\"f:type\":{}},\"f:name\":{}}}}}},{\"manager\":\"kubelet\",\"operation\":\"Update\",\"apiVersion\":\"v1\",\"time\":\"2021-06-29T11:11:03Z\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:status\":{\"f:conditions\":{\"k:{\\\"type\\\":\\\"ContainersReady\\\"}\":{\".\":{},\"f:lastProbeTime\":{},\"f:lastTransitionTime\":{},\"f:status\":{},\"f:type\":{}},\"k:{\\\"type\\\":\\\"Initialized\\\"}\":{\".\":{},\"f:lastProbeTime\":{},\"f:lastTransitionTime\":{},\"f:status\":{},\"f:type\":{}},\"k:{\\\"type\\\":\\\"Ready\\\"}\":{\".\":{},\"f:lastProbeTime\":{},\"f:lastTransitionTime\":{},\"f:status\":{},\"f:type\":{}}},\"f:containerStatuses\":{},\"f:hostIP\":{},\"f:initContainerStatuses\":{},\"f:phase\":{},\"f:podIP\":{},\"f:podIPs\":{\".\":{},\"k:{\\\"ip\\\":\\\"10.113.37.147\\\"}\":{\".\":{},\"f:ip\":{}}},\"f:startTime\":{}}}}]},\"spec\":{\"volumes\":[{\"name\":\"cni-bin-dir\",\"hostPath\":{\"path\":\"/opt/cni/bin\",\"type\":\"\"}},{\"name\":\"cni-net-dir\",\"hostPath\":{\"path\":\"/etc/cni/net.d\",\"type\":\"\"}},{\"name\":\"dockershim\",\"hostPath\":{\"path\":\"/var/run/dockershim.sock\",\"type\":\"\"}},{\"name\":\"xtables-lock\",\"hostPath\":{\"path\":\"/run/xtables.lock\",\"type\":\"\"}},{\"name\":\"log-dir\",\"hostPath\":{\"path\":\"/var/log/aws-routed-eni\",\"type\":\"DirectoryOrCreate\"}},{\"name\":\"run-dir\",\"hostPath\":{\"path\":\"/var/run/aws-node\",\"type\":\"DirectoryOrCreate\"}},{\"name\":\"aws-node-token-6wd6h\",\"secret\":{\"secretName\":\"aws-node-token-6wd6h\",\"defaultMode\":420}}],\"initContainers\":[{\"name\":\"aws-vpc-cni-init\",\"image\":\"602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon-k8s-cni-init:v1.7.5\",\"env\":[{\"name\":\"DISABLE_TCP_EARLY_DEMUX\",\"value\":\"false\"}],\"resources\":{},\"volumeMounts\":[{\"name\":\"cni-bin-dir\",\"mountPath\":\"/host/opt/cni/bin\"},{\"name\":\"aws-node-token-6wd6h\",\"readOnly\":true,\"mountPath\":\"/var/run/secrets/kubernetes.io/serviceaccount\"}],\"terminationMessagePath\":\"/dev/termination-log\",\"terminationMessagePolicy\":\"File\",\"imagePullPolicy\":\"Always\",\"securityContext\":{\"privileged\":true}}] ....

same here ... it displays a huge json file

This huge json is a response for k8s apiserver, that the plugin failed to parse. see #141
it should be fixed with 0.14.5