Hello,
I prefer using Postman and CURL to do operations with a cluster and I am wondering whether there is an API param intended to filter out or to hide managed fields, as they make the payload considerably longer for the average user who might no be interested on that
curl --location --request GET 'http://127.0.0.1:8001/api/v1/namespaces/my-namespace/pods/alpine-969959d5c-8wr77'
See example below
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "alpine-969959d5c-8wr77",
"generateName": "alpine-969959d5c-",
"namespace": "my-namespace",
"selfLink": "/api/v1/namespaces/my-namespace/pods/alpine-969959d5c-8wr77",
"uid": "747ee893-9fef-4617-a5bc-304e091b5fac",
"resourceVersion": "276451",
"creationTimestamp": "2020-04-23T12:12:23Z",
"labels": {
"k8s-app": "alpine",
"pod-template-hash": "969959d5c",
"removeme": "true"
},
"annotations": {
"description": "alpine sleep"
},
"ownerReferences": [
{
"apiVersion": "apps/v1",
"kind": "ReplicaSet",
"name": "alpine-969959d5c",
"uid": "b847c571-5174-488c-920c-d2c2832a7449",
"controller": true,
"blockOwnerDeletion": true
}
],
"managedFields": [
{
"manager": "kube-controller-manager",
"operation": "Update",
"apiVersion": "v1",
"time": "2020-04-23T12:12:23Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:description": {}
},
"f:generateName": {},
"f:labels": {
".": {},
"f:k8s-app": {},
"f:pod-template-hash": {},
"f:removeme": {}
},
"f:ownerReferences": {
".": {},
"k:{\"uid\":\"b847c571-5174-488c-920c-d2c2832a7449\"}": {
".": {},
"f:apiVersion": {},
"f:blockOwnerDeletion": {},
"f:controller": {},
"f:kind": {},
"f:name": {},
"f:uid": {}
}
}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"alpine\"}": {
".": {},
"f:args": {},
"f:command": {},
"f:env": {
".": {},
"k:{\"name\":\"JMCF\"}": {
".": {},
"f:name": {},
"f:value": {}
}
},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:securityContext": {
".": {},
"f:privileged": {}
},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:enableServiceLinks": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
},
{
"manager": "kubelet",
"operation": "Update",
"apiVersion": "v1",
"time": "2020-04-23T12:12:28Z",
"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:phase": {},
"f:podIP": {},
"f:podIPs": {
".": {},
"k:{\"ip\":\"172.17.0.9\"}": {
".": {},
"f:ip": {}
}
},
"f:startTime": {}
}
}
}
]
},
"spec": {
"volumes": [
{
"name": "default-token-ph649",
"secret": {
"secretName": "default-token-ph649",
"defaultMode": 420
}
}
],
"containers": [
{
"name": "alpine",
"image": "alpine:latest",
"command": [
"sleep"
],
"args": [
"120000"
],
"env": [
{
"name": "JMCF",
"value": "Cantera"
}
],
"resources": {},
"volumeMounts": [
{
"name": "default-token-ph649",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always",
"securityContext": {
"privileged": false
}
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "default",
"serviceAccount": "default",
"nodeName": "minikube",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 300
},
{
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 300
}
],
"priority": 0,
"enableServiceLinks": true
},
"status": {
"phase": "Running",
"conditions": [
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2020-04-23T12:12:23Z"
},
{
"type": "Ready",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2020-04-23T12:12:28Z"
},
{
"type": "ContainersReady",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2020-04-23T12:12:28Z"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2020-04-23T12:12:23Z"
}
],
"hostIP": "192.168.99.101",
"podIP": "172.17.0.9",
"podIPs": [
{
"ip": "172.17.0.9"
}
],
"startTime": "2020-04-23T12:12:23Z",
"containerStatuses": [
{
"name": "alpine",
"state": {
"running": {
"startedAt": "2020-04-23T12:12:27Z"
}
},
"lastState": {},
"ready": true,
"restartCount": 0,
"image": "alpine:3.11.5",
"imageID": "docker-pullable://alpine@sha256:b276d875eeed9c7d3f1cfa7edb06b22ed22b14219a7d67c52c56612330348239",
"containerID": "docker://4bae85232671f5dd4e0a1c2198df0f88cf723a846a117d7799b895fd866daa4c",
"started": true
}
],
"qosClass": "BestEffort"
}
}
Cluster information:
Kubernetes version: 1.18
Cloud being used: Minikube
Installation method:
Host OS: MacOS
CNI and version:
CRI and version:
You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.