1

I am using kubernetes for container orchestration,I dont get any output while running kubectl get rc on the master node while I get a list of replication controllers when using their REST API

curl -X GET masterurl/api/v1/replicationcontrollers.

What am I missing

user_mda
  • 18,148
  • 27
  • 82
  • 145

1 Answers1

0

By default, kubectl only shows resources that are in the default namespace, whereas that REST endpoint will return replication controllers from all namespaces.

To get the same output from kubectl, run it with the --all-namespaces flag, as in kubectl get rc --all-namespaces.

If you only want kubectl to return resources from a particular namespace foo that isn't default, you can use --namespace=foo.

Alex Robinson
  • 12,633
  • 2
  • 38
  • 55
  • I'm not able to reproduce the behavior you mentioned, Alex. I think /api/v1/replicationcontrollers means give me the RCs in the default namespace. EDIT- You are correct. I was making a mistake. – Eric Tune Nov 03 '15 at 23:00