node-k8s-client icon indicating copy to clipboard operation
node-k8s-client copied to clipboard

Trouble connecting/accessing information from cluster

Open vmarcel opened this issue 7 years ago • 3 comments

Hello, I am trying to use this package to connect to Google Container Engine, which uses kubernetes. The issue is I am unsure why I am getting either no value or undefined when I am trying to get a simple list of the pods. here is my config:

var kubectl = k8s.kubectl({
  endpoint: 'https://[cluser ip]',
  namespace: 'default',
  binary: '/usr/local/bin/kubectl',
  auth: {
    username: '[user]',
    password: '[pass]'
  }
})

How I am calling the function:

  kubectl.pod.list(function (err, pods) {
    console.log(pods)
  })

any reason why I this is not working?

vmarcel avatar Aug 30 '17 17:08 vmarcel

I am on Azure Container Service. I have tried using REST API with the three .pem files and it works like a charm.

emanuelecasadio avatar Oct 20 '17 16:10 emanuelecasadio

Have you managed to get it to work? I am running through the same issue.

khaled-nabil avatar Dec 11 '17 15:12 khaled-nabil

Yes, I got it working but now I don't use it anymore. However, I extracted the three .pem files from the ~/.azure or ~/.kube directory (they were encoded in base64 within a configuration file, if I can remember) and just used those files to access the cluster.

emanuelecasadio avatar Dec 12 '17 23:12 emanuelecasadio