Can't access pod logs

I am trying to access the logs of a pod in a kubernetes cluster but get a 404 on sending the following rest request:

GET api/namespaces/myNamespace/pods/myPod/log

  • Is docker a solution for making application cross platform?
  • App running in Docker on EB refuses connecting to self
  • Not able to connect to the Docker server running on another Linux system
  • Execution of python script hangs while executing docker exec command
  • How do I connect to a web app running on an image on docker hub?
  • ERRO : Error trying to connect to local peer: grpc: timed out trying to connect
  • When I try to see the status of the pod I get the following:

    "metadata": {
            "name": "podtest",
            "generateName": "podtest-",
            "namespace": "podtest01734160-58f9-4042-8f38-3e55d7d5beb3",
            "selfLink": "/api/v1/namespaces/podtest01734160-58f9-4042-8f38-3e55d7d5beb3/pods/podtest-rc-no-env-hc5rl",
            "uid": "dba5c41f-8307-11e5-96f2-005056976c6f",
            "resourceVersion": "3595515",
            "creationTimestamp": "2015-11-04T15:22:27Z",
            "labels": {
              "name": "kube-pod"
            "annotations": {
              "": "{\"kind\":\"SerializedReference\",\"apiVersion\":\"v1\",\"reference\":{\"kind\":\"ReplicationController\",\"namespace\":\"podtest01734160-58f9-4042-8f38-3e55d7d5beb3\",\"name\":\"podtest-rc-no-env\",\"uid\":\"dba55f97-8307-11e5-96f2-005056976c6f\",\"apiVersion\":\"v1\",\"resourceVersion\":\"3594964\"}}"
          "spec": {
            "containers": [
                "name": "podtest01734160-58f9-4042-8f38-3e55d7d5beb3",
                "image": "dockertest",
                "resources": {},
                "terminationMessagePath": "/dev/termination-log",
                "imagePullPolicy": "IfNotPresent"
            "restartPolicy": "Always",
            "dnsPolicy": "ClusterFirst",
            "nodeName": "node-n2"
          "status": {
            "phase": "Running",
            "conditions": [
                "type": "Ready",
                "status": "True"
            "hostIP": "",
            "podIP": "",
            "startTime": "2015-11-04T15:25:51Z",
            "containerStatuses": [
                "name": "podtest01734160-58f9-4042-8f38-3e55d7d5beb3",
                "state": {
                  "running": {
                    "startedAt": "2015-11-04T15:28:43Z"
                "lastState": {},
                "ready": true,
                "restartCount": 0,
                "image": "dockertest",
                "imageID": "docker://62457b12fc411b13fcaa122a946aefcac0c66df05ce1158d8d618ebe3af95362",
                "containerID": "docker://baea3dc8cd7129704e205c76bf4ca57635659fec22774fcdcf197fb5c75ab433"

    Why can’t I get to the logs?

  • Getting All Docker Container's IP Address along with Container ID's and Name's
  • Docker : How to run a service and a terminal in one command?
  • How to change nginx-proxy settings
  • Networking in Docker Swarm, and why we need a proxy
  • Can't Configure Remote Access of Docker Host
  • Docker: Monitor logical units of linked containers
  • 3 Solutions collect form web for “Can't access pod logs”

    This works from me /api/v1/namespaces/myNamespace/pods/myPod/log

    Yours doesn’t have the api version.

    I found these;
    When the pod status changes to Running you can use the kubectl logs command to view the output.

    kubectl logs podname

    kubectl cluster-info
    How do I access the Kubernetes api from within a pod container?

    GET api/v1/namespaces/”podtest01734160-58f9-4042-8f38-3e55d7d5beb3″/pods/myPod/log

    there are two points need to be aware:
    1. in metadata it shows “namespace”: “podtest01734160-58f9-4042-8f38-3e55d7d5beb3” but it is not myNamespace,
    2. as the answer from iocanel, the api version is necessary, more info
    could be check here :

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.