Connect your cluster to Tiny Systems
To manage resources, installing modules and monitoring your cluster the platform needs to have access to it. To do that you need to create a kubeconfig. It's all-in-one piece of configuration which contains all information needed to establish the connection.
Create kubeconfig
This page explains how to create kubeconfig to connect your cluster to Tiny Systems.
It is quite common when Kubernetes providers(e.g. GKE, EKS) are using their own CLI helpers to authorise users to access their clusters. Such kubeconfigs are not supported by Tiny Systems, so you have to create a new kubeconfig. Luckily that's an easy thing to do.
Prerequisites
- You need to have
kubectlinstalled and configured on your computer. Please address your kubernetes provider for the specific instructions. Runkubectl get nsto check if everything is working. - Install
krew. Krew is the plugin manager forkubectlcommand-line tool. - Install
view-serviceaccount-kubeconfigplugin forkrew.
Create kubeconfig
Switch kubectl context to the cluster you want to use with Tiny Systems. First, we create Kubernetes namespace where Tiny Systems resources will be contained.
kubectl create ns tinysystemsCreate Tiny Systems service account within tinysystems namespace.
kubectl -n tinysystems create serviceaccount tinysystemsNow you have two options of how to install Tiny Systems.
- Namespace-wide. All resources of any project and workspace will be installed into a single Kubernetes namespace called
tinysystems. - Cluster-wide. Common resources will be installed into
tinysystemsnamespaces while workspace specific resources will be installed into a separate namespaces named after the workspace.
Which type should I choose? If you are willing to share the same cluster within several workspaces please consider cluster-wide installation. That will keep kubernetes resources from different workspaces isolated.
If you choose namespace-wide installation
Bind cluster-admin role to tinysystems service account within tinysystems namespace only using rolebinding.
kubectl -n tinysystems create rolebinding tinysystems-admin-binding --clusterrole=cluster-admin --serviceaccount=tinysystems:tinysystemsIf you choose cluster-wide installation.
Bind role using clusterrolebinding
kubectl create clusterrolebinding tinysystems-admin-binding --clusterrole=cluster-admin --serviceaccount=tinysystems:tinysystemsFinally, create and print kubeconfig for the sevice account we created.
kubectl -n tinysystems create token tinysystems --duration=3600s | kubectl view-serviceaccount-kubeconfigUse the resulted string during connection to your cluster.
WARNING
Please make sure you keep your kubeconfig safe.