Credential help when adding brownfield Kubernetes Clusters to Morpheus

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

  1. Assign Group
  2. Assign:
    Cluster Name
    Resource Name
    Description (Optional)
    Visibility
    Labels (Optional)
  3. Assign
    Layout
    API URL
    API Token

Additional Links:

5 Likes

Nice ! i added Openshift into Morpheus by External K8s


1 Like