mortar icon indicating copy to clipboard operation
mortar copied to clipboard

Handle namespace defaulting

Open jnummelin opened this issue 7 years ago • 2 comments

Currently the namespace is a mandatory for each of the resources. Mortar could handle the namespace defaulting same way as kubectl does. The underlying k8s-client library has also some support for it coming, see https://github.com/kontena/k8s-client/pull/33. It might be better to handle namespace defaulting actually on Mortar level rather than in the API client level.

jnummelin avatar Aug 27 '18 20:08 jnummelin

The make this bit worse, the error is rather misleading:

/usr/local/lib/ruby/gems/2.5.0/gems/k8s-client-0.4.1/lib/k8s/transport.rb:192:in `parse_response’: POST /api/v1/services => HTTP 405 Method Not Allowed: the server does not allow this method on the requested resource (K8s::Error::MethodNotAllowed)

Without the namespace in the resources, k8s-client Mortar uses will POST the resources into wrong API endpoint...

jnummelin avatar Sep 14 '18 06:09 jnummelin

so if you copy/paste a sample yaml from: https://kubernetes.io/docs/tasks/run-application/run-stateless-application-deployment/

it will bomb because of this

matti avatar Oct 27 '18 08:10 matti