Error from server (NotFound)

So first time I have tried deplying a cluster. I have created a yaml file but am getting

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

kubectl create -f radarr -v=8
I0725 17:24:02.457635 16076 loader.go:357] Config loaded from file /home/courtp/.kube/config
I0725 17:24:02.460342 16076 round_trippers.go:414] GET https://192.168.99.100:8443/swagger-2.0.0.pb-v1
I0725 17:24:02.460369 16076 round_trippers.go:421] Request Headers:
I0725 17:24:02.460382 16076 round_trippers.go:424] Accept: application/json, /
I0725 17:24:02.460394 16076 round_trippers.go:424] User-Agent: kubectl/v1.9.3 (linux/amd64) kubernetes/d283541
I0725 17:24:02.481960 16076 round_trippers.go:439] Response Status: 404 Not Found in 21 milliseconds
I0725 17:24:02.482015 16076 round_trippers.go:442] Response Headers:
I0725 17:24:02.482029 16076 round_trippers.go:445] Content-Length: 487
I0725 17:24:02.482042 16076 round_trippers.go:445] Date: Thu, 25 Jul 2019 16:24:02 GMT
I0725 17:24:02.482055 16076 round_trippers.go:445] Content-Type: application/json
I0725 17:24:02.495970 16076 request.go:873] Response Body: {
“paths”: [
“/apis”,
“/apis/”,
“/apis/apiextensions.k8s.io”,
“/apis/apiextensions.k8s.io/v1beta1”,
“/healthz”,
“/healthz/etcd”,
“/healthz/log”,
“/healthz/ping”,
“/healthz/poststarthook/crd-informer-synced”,
“/healthz/poststarthook/generic-apiserver-start-informers”,
“/healthz/poststarthook/start-apiextensions-controllers”,
“/healthz/poststarthook/start-apiextensions-informers”,
“/metrics”,
“/openapi/v2”,
“/version”
]
}
I0725 17:24:02.503351 16076 helpers.go:201] server response object: [{
“metadata”: {},
“status”: “Failure”,
“message”: “the server could not find the requested resource”,
“reason”: “NotFound”,
“details”: {
“causes”: [
{
“reason”: “UnexpectedServerResponse”,
“message”: “unknown”
}
]
},
“code”: 404
}]
F0725 17:24:02.503406 16076 helpers.go:119] Error from server (NotFound): the server could not find the requested resource

Anything else I can add?

Probably the yaml is wrong. Wanna share it? :slight_smile:


apiVersion: apps/v1
kind: Deployment
metadata:
name: radarr
labels:
app: radarr
spec:
replicas: 1
selector:
matchLabels:
app: radarr
template:
metadata:
labels:
app: radarr

 spec:
  containers:
     - name: radarr
       image: linuxserver/radarr
       imagePullPolicy: Always
       ports:
         - containerPort: 7878
      
env:
    - name: PGID
      value: "1000"
    - name: PUID
      value: "1000"

volumeMounts:

- mountPath: /config

name: radarr-config

- mountPath: /downloads

name: radarr-downloads

- mountPath: /movies

name: radarr-movies


kind: Service
apiVersion: v1
#metadata:
name: radarr-service
spec:
selector:
app: radarr
ports:

  • protocol: TCP
    port: 7878
    targetPort: 7878
    type: NodePort

Just as a general FYI, please use markdown formatting for code blocks when you post things like that. It makes it much easier for others to read. Here is the above post posted as a codeblock:

---
 apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: radarr
   labels:
     app: radarr
 spec:
   replicas: 1
   selector:
      matchLabels:
        app: radarr
   template:
     metadata:
       labels:
         app: radarr   
     spec:
      containers:
         - name: radarr
           image: linuxserver/radarr
           imagePullPolicy: Always
           ports:
             - containerPort: 7878          
 	env:
        - name: PGID
          value: "1000"
        - name: PUID
          value: "1000"
 volumeMounts:
             - mountPath: /config
               name: radarr-config
             - mountPath: /downloads
               name: radarr-downloads
             - mountPath: /movies
               name: radarr-movies
---
kind: Service
apiVersion: v1
metadata:
  name: radarr-service
spec:
  selector:
    app: radarr
  ports:
  - protocol: TCP
    port: 7878
    targetPort: 7878
  type: NodePort

Yes, please, paste it again with markdown. Spaces are important in yaml and we can’t see that :slight_smile:

it does not let me post a md file. sorry guys Im so new to all this…

but

I found that I needed to update the client version. I have done this and now able to create the cluster!

my first cluster by TM :slight_smile:

Try as bin said :slight_smile:

If you are a naive or someone who don’t wanna land in trouble then, I’d recommend deploy using a specialized cloud paas like RealCloud, where you can deploy the Kubernetes Cluster with 1 click.

I ran into exactly this issue and googled my way here.
The problem for my was resolved by aligning my kubectl client and server versions.

These versions produced the error above:

kubectl version                                                                                                                                                                                                                         2019-08-01 11:03:07
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T10:09:24Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:32:14Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}

Upgrading kubectl on my laptop to the same as the server version resolved the problem.
May not work for you but perhaps worth a shot.
I work with both (very) old and new clusters and use asdf with this plugin to switch versions.