configure kubectl to connect remote cluster

This commit is contained in:
2018-10-30 16:34:00 +11:00
parent 6cd5db44cc
commit 853dfe8431
+36
View File
@@ -92,3 +92,39 @@ kubectl cluster-info
http://your_ip:8080/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
```
## Configure Kubectl to access remote Kubernetes cluster
Here is a very simple config which use HTTP and `not secure`, should only for local testing purpose
### Config
Having a yaml file called `config-demo` in your current folder
```yaml
apiVersion: v1
clusters:
- cluster:
server: http://your_cluster_ip:8080
name: development
contexts:
- context:
cluster: development
namespace: dev
user: developer
name: dev
current-context: dev
kind: Config
preferences: {}
users:
- name: developer
```
### Connect to remote cluster
```bash
kubectl get all --kubeconfig=config-demo --all-namespaces
```
For long term usage, you will need to copy the content to your `~/.kube/config`
TODO: Setup SSL connection