Connect Clusters


Prepare Cluster

The kube-context of a GKE cluster will by default not have cluster-admin role. Run the following command to get your google email address and to make your user cluster admin:

# GKE: make yourself admin
GKE_USER=$(gcloud config get-value account)
kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $GKE_USER
Verify Admin Access

To connect a cluster, you need admin access to the cluster. If running all the following commands return yes, you are most likely admin:

kubectl auth can-i "*" "*" --all-namespaces
kubectl auth can-i "*" namespace
kubectl auth can-i "*" clusterrole
kubectl auth can-i "*" crd
kubectl auth can-i get node
Public API Server
SaaS edition If you are using the SaaS edition of DevSpace Cloud, the API server of the cluster you want to connect must be available on a public IP address (or domain).

Connect Cluster

Connect a new Kubernetes cluster to DevSpace Cloud using:

devspace connect cluster

DevSpace will ask you to choose the kube-context of the cluster you want to connect as shown in this screencast:

DevSpace Cloud - Connect Cluster via CLI
Encryption Key
SaaS edition When connecting your first cluster to the SaaS edition of DevSpace Cloud, you need to define an encryption key. You should remember this key and treat it like a password for your cluster.
Ingress Controller Network

Choose LoadBalancer for all public clouds and whenever your Kubernetes cluster allows to create services that are defined with spec.type: LoadBalancer.