I cannot create a kubernetes pod. I just deployed Kubernetes to Ubuntu 16.04.

I have this as a.yml:

apiVersion: v1
kind: ReplicationController
  name: nginx
  replicas: 2
    app: nginx
      name: nginx
        app: nginx
      - name: nginx
        image: nginx
        - containerPort: 80

I run this: kubectl create -f a.yml

I get this:

Error from server (NotFound): the server could not find the requested resource

I expected the above command to create a pod.

I ran this: kubectl cluster-info dump

I got this:

    "selfLink": "/api/v1/nodes",
    "resourceVersion": "185",
    "Items": [
            "name": "ip-10-10-10-10",
            "selfLink": "/api/v1/nodes/ip-10-10-10-10",
            "uid": "cdc51051-ea07-11e7-b7ae-025c31abfac0",
            "resourceVersion": "185",
            "creationTimestamp": "2017-12-26T06:41:29Z",
            "labels": {
                "kubernetes.io/hostname": "ip-10-10-10-10"
            "Spec": {
                "PodCIDR": "",
                "ExternalID": "ip-10-10-10-10",
                "ProviderID": "",
                "Unschedulable": false,
                "Taints": null,
                "ConfigSource": null
            "Status": {
                "Capacity": {
                    "cpu": "0",
                    "memory": "0",
                    "pods": "40"
                "Allocatable": {
                    "cpu": "0",
                    "memory": "0",
                    "pods": "40"
                "Phase": "",
                "Conditions": [
                        "Type": "Ready",
                        "Status": "True",
                        "LastHeartbeatTime": "2017-12-26T07:03:01Z",
                        "LastTransitionTime": "2017-12-26T06:41:29Z",
                        "Reason": "kubelet is posting ready status",
                        "Message": ""
                "Addresses": [
                        "Type": "LegacyHostIP",
                        "Address": ""
                "DaemonEndpoints": {
                    "KubeletEndpoint": {
                        "Port": 0
                "NodeInfo": {
                    "MachineID": "",
                    "SystemUUID": "",
                    "BootID": "",
                    "KernelVersion": "",
                    "OSImage": "",
                    "ContainerRuntimeVersion": "",
                    "KubeletVersion": "",
                    "KubeProxyVersion": "",
                    "OperatingSystem": "",
                    "Architecture": ""
                "Images": null,
                "VolumesInUse": null,
                "VolumesAttached": null
    ] } {
    "selfLink": "/api/v1/namespaces/kube-system/events",
    "resourceVersion": "185",
    "Items": [] } {
    "selfLink": "/api/v1/namespaces/kube-system/replicationcontrollers",
    "resourceVersion": "185",
    "Items": [] } {
    "selfLink": "/api/v1/namespaces/kube-system/services",
    "resourceVersion": "185",
    "Items": [] } Error from server (NotFound): the server could not find the requested resource (get daemonsets.extensions)

What am I doing wrong?

Update 12/26/17

The command kubectl get ns produces

the server doesn't have a resource type "namespaces"

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"clean", BuildDate:"2017-12-15T21:07:38Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"0", GitVersion:"v1.0.3", GitCommit:"61c6ac5f350253a4dc002aee97b7db7ff01ee4ca", GitTreeState:"clean", BuildDate:"", GoVersion:"", Compiler:"", Platform:""}

Update 1/15/18 How do I get some namespaces to be returned?

  • What happens if kubectl get ns is run?
    – 030
    Dec 26, 2017 at 11:14
  • What version of Kubernetes are you using? Dec 26, 2017 at 18:52
  • Images: null and you're asking for an image named 'nginx', that doesn't looks like a registry image name, as such I guess k8s have no idea what to do
    – Tensibai
    Dec 26, 2017 at 19:45

2 Answers 2


As per https://kubernetes.io/docs/tasks/tools/install-kubectl/#before-you-begin:

You must use a kubectl version that is within one minor version difference of your cluster. For example, a v1.2 client should work with v1.1, v1.2, and v1.3 master. Using the latest version of kubectl helps avoid unforeseen issues.

So you need to either downgrade your kubectl version or upgrade your cluster version.


It looks like your k8s cluster has not been deployed well. I have verified that it works to deploy the nginx by using the template as defined in the question.

In contrast to your cluster, the cluster I am using has several k8s images to host the dashboard etc.

        "Images": [
                "Names": [
                "SizeBytes": 138972432
                "Names": [
                "SizeBytes": 119155776

Also in order to deploy images, at least some namespaces should be returned.

$ kubectl get ns
NAME          STATUS    AGE
default       Active    37m
kube-public   Active    37m
kube-system   Active    37m

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.