0

I have finished setting up a test Kubernets host running on a bare metal Centos 7. This will be used as a test system as we will be deploying everything in IBM Bluemix Kubernetes service.

Getting the configuration from Bluemix is easy... and while our Kubernetes on Centos works OK I don't know how to generate the configuration to access it from our workstations. It is explained at https://kubernetes.io/docs/tasks/administer-cluster/share-configuration/

but I am new to setting up a Kubernetes host... and have no idea where that

$ cluster/kube-up.sh

command is... or which package to install to get it.

Thanks for any guide on this.

Jeff Sloyer
  • 4,899
  • 1
  • 24
  • 48
icordoba
  • 1,834
  • 2
  • 33
  • 60

2 Answers2

1

You can try option see, copy admin.conf file to your workstation, then run

 kubectl --kubeconfig=./admin.conf proxy -p 80 

after this your can access your dashboard from workstation http://localhost/ui

sfgroups
  • 18,151
  • 28
  • 132
  • 204
  • Thanks... seems as simple as that (don't really need proxy as I just wanted to execute kubectl commands like apply or create). How can I make that permanent so I don't need to add --kubeconfig=... in every command? – icordoba Jun 07 '17 at 14:53
  • if you workstation is Unix create shell alias k=' kubectl --kubeconfig=./admin.conf ' if its windows doskey k=' kubectl --kubeconfig=./admin.conf '. then you can use ' k create -f pod.yml' – sfgroups Jun 07 '17 at 15:09
  • Thanks I'll do that. Anyway, for Bluemix I do: "bx cs cluster-config MyTestCluster" and then "export KUBECONFIG=.../justGeneratedConfigFile.yml" and kubectl will connect directly to that cluster. Probably I can do similar with my local cluster. Thanks!!! – icordoba Jun 07 '17 at 15:21
  • right, we can set environment variable also export KUBECONFIG=$HOME/admin.conf – sfgroups Jun 07 '17 at 17:19
0

You can copy admin.conf the file to HOME_DIR/.kube/config. By default, the kubectl utility will look at the file under home directory. Also, we don't need to set environment or --kubeconfig parameter.