I recently wanted to add my lab K8s cluster to Morpheus. I ended up having to create a service account for Morpheus to fully ingest the brownfield K8s cluster. Prior to creating this account I had issues listing all namespaces and other resources.
Here is what I ended up having to do to create an account and get connected:
Create Service Account for Morpheus to Connect
kubectl create serviceaccount morpheus
Create Role Binding
kubectl create clusterrolebinding morpheus-admin \
--clusterrole=cluster-admin --serviceaccount=default:morpheus \
--namespace=default
Gather API URL
kubectl config view --minify | grep server | cut -f 2- -d ":" | tr -d " "
Gather Service Account Token
SECRET_NAME=$(kubectl get secrets | grep ^morpheus | cut -f1 -d ' ')
kubectl describe secret $SECRET_NAME | grep -E '^token' | cut -f2 -d':' | tr -d " "
Add Brownfield K8s
Infra > Clusters > +Add Clusters > External Kubernetes Clusters
- Assign Group
- Assign:
Cluster Name
Resource Name
Description (Optional)
Visibility
Labels (Optional) - Assign
Layout
API URL
API Token