garethr / garethr-kubernetes

Puppet types and provider for managing Pods, ReplicationControllers, Services and more in Kubernetes
http://garethr.github.io/garethr-kubernetes
Apache License 2.0
28 stars 28 forks source link

Issue with kubeclient (2.1.0) #16

Closed KrisBuytaert closed 7 years ago

KrisBuytaert commented 8 years ago

Seems like I can't even get the information from the API ..

Error: Could not run: Puppet detected a problem with the information returned from the service when accessing kubernetes_pod. The specific error was: Unknown context

/tmp/vagrant-puppet/modules-89b46079a69868a23ebae582c0c9866d/kube_functions/lib/kubeclient/config.rb:81:in fetch_context' /tmp/vagrant-puppet/modules-89b46079a69868a23ebae582c0c9866d/kube_functions/lib/kubeclient/config.rb:35:incontext' /tmp/vagrant-puppet/modules-89b46079a69868a23ebae582c0c9866d/kube_functions/lib/puppet_x/puppetlabs/kubernetes/provider.rb:37:in client' /tmp/vagrant-puppet/modules-89b46079a69868a23ebae582c0c9866d/kube_functions/lib/puppet_x/puppetlabs/kubernetes/provider.rb:48:inlist_instances_of' /tmp/vagrant-puppet/modules-89b46079a69868a23ebae582c0c9866d/kube_functions/lib/puppet/provider/kubernetes_pod/swagger.rb:57:in list_instances' /tmp/vagrant-puppet/modules-89b46079a69868a23ebae582c0c9866d/kube_functions/lib/puppet_x/puppetlabs/swagger/provider.rb:17:ininstances' /tmp/vagrant-puppet/modules-89b46079a69868a23ebae582c0c9866d/kube_functions/lib/puppet_x/puppetlabs/swagger/provider.rb:30:in prefetch' /usr/share/ruby/vendor_ruby/puppet/transaction.rb:307:inprefetch' /usr/share/ruby/vendor_ruby/puppet/transaction.rb:197:in prefetch_if_necessary' /usr/share/ruby/vendor_ruby/puppet/transaction.rb:96:inblock in evaluate' /usr/share/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:116:in call' /usr/share/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:116:intraverse' /usr/share/ruby/vendor_ruby/puppet/transaction.rb:138:in evaluate' /usr/share/ruby/vendor_ruby/puppet/resource/catalog.rb:169:inblock in apply' /usr/share/ruby/vendor_ruby/puppet/util/log.rb:149:in with_destination' /usr/share/ruby/vendor_ruby/puppet/transaction/report.rb:112:inas_logging_destination' /usr/share/ruby/vendor_ruby/puppet/resource/catalog.rb:168:in apply' /usr/share/ruby/vendor_ruby/puppet/configurer.rb:120:inblock in apply_catalog' /usr/share/ruby/vendor_ruby/puppet/util.rb:161:in block in benchmark' /usr/share/ruby/benchmark.rb:296:inrealtime' /usr/share/ruby/vendor_ruby/puppet/util.rb:160:in benchmark' /usr/share/ruby/vendor_ruby/puppet/configurer.rb:119:inapply_catalog' /usr/share/ruby/vendor_ruby/puppet/configurer.rb:227:in run_internal' /usr/share/ruby/vendor_ruby/puppet/configurer.rb:134:inblock in run' /usr/share/ruby/vendor_ruby/puppet/context.rb:64:in override' /usr/share/ruby/vendor_ruby/puppet.rb:244:inoverride' /usr/share/ruby/vendor_ruby/puppet/configurer.rb:133:in run' /usr/share/ruby/vendor_ruby/puppet/application/apply.rb:297:inapply_catalog' /usr/share/ruby/vendor_ruby/puppet/application/apply.rb:231:in block in main' /usr/share/ruby/vendor_ruby/puppet/context.rb:64:inoverride' /usr/share/ruby/vendor_ruby/puppet.rb:244:in override' /usr/share/ruby/vendor_ruby/puppet/application/apply.rb:193:inmain' /usr/share/ruby/vendor_ruby/puppet/application/apply.rb:154:in run_command' /usr/share/ruby/vendor_ruby/puppet/application.rb:381:inblock (2 levels) in run' /usr/share/ruby/vendor_ruby/puppet/application.rb:507:in plugin_hook' /usr/share/ruby/vendor_ruby/puppet/application.rb:381:inblock in run' /usr/share/ruby/vendor_ruby/puppet/util.rb:488:in exit_on_fail' /usr/share/ruby/vendor_ruby/puppet/application.rb:381:inrun' /usr/share/ruby/vendor_ruby/puppet/util/command_line.rb:146:in run' /usr/share/ruby/vendor_ruby/puppet/util/command_line.rb:92:inexecute' /bin/puppet:8:in `

'

Kould also be my config as kubectl config view --raw=true apiVersion: v1 clusters: [] contexts: [] current-context: "" kind: Config preferences: {} users: []

Which gives an empty context ..

garethr commented 8 years ago

I've just tried this with kubeclient 2.1.0 and found it worked as expected. So I think this is a problem with your config. Sorry it took a while for me to get to.

Do other kubectl commands work as expected? ie. can you list the nodes in your cluster with kubectl get nodes?

KrisBuytaert commented 8 years ago

kubectl get nodes etc works for sure ... but I`ll have a deeper look after next weeks' conference chaos :)

garethr commented 7 years ago

@KrisBuytaert I've not been able to recreate this so I'm going to close unfortunately, unless you have had time to recreate?