I cannot create a kubernetes pod. I just deployed Kubernetes to Ubuntu 16.04.
I have this as a.yml:
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx
spec:
replicas: 2
selector:
app: nginx
template:
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- 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": "10.10.10.10"
}
],
"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?
kubectl get ns
is run? – 030 Dec 26 '17 at 11:14