Skip to content

Instantly share code, notes, and snippets.

@superseb
Last active June 7, 2020 03:24
Show Gist options
  • Save superseb/bf3de5f69610b6cffaa6bce84f3ea93f to your computer and use it in GitHub Desktop.
Save superseb/bf3de5f69610b6cffaa6bce84f3ea93f to your computer and use it in GitHub Desktop.
Identify RKE / Rancher Launched Kubernetes / Imported clusters

Identify RKE / Rancher Launched Kubernetes / Imported clusters

This will describe how to identify clusters that are created by RKE, created by Rancher or managed by Rancher

RKE

Clusters created by RKE CLI have:

  • Cluster state stored as Configmap called full-cluster-state in namespace kube-system (cluster-state before RKE v0.2.0)
    • kubectl -n kube-system get configmap full-cluster-state
  • No cattle-system namespace
  • No ServiceAccount named kontainer-engine in namespace cattle-system

Rancher Launched Kubernetes

Clusters created as described on https://rancher.com/docs/rancher/v2.x/en/cluster-provisioning/rke-clusters/ have:

  • ServiceAccount named kontainer-engine in namespace cattle-system
    • kubectl -n cattle-system get sa kontainer-engine
  • Cluster state stored as Configmap called full-cluster-state in namespace kube-system (cluster-state before Rancher v2.2.0)
    • kubectl -n kube-system get configmap full-cluster-state
  • Deployment cattle-cluster-agent and DeamonSet cattle-node-agent in namespace cattle-system
    • kubectl -n cattle-system get deploy cattle-cluster-agent
    • kubectl -n cattle-system get ds cattle-node-agent

Hosted Kubernetes

  • ServiceAccount named kontainer-engine in namespace cattle-system
    • kubectl -n cattle-system get sa kontainer-engine
  • No cluster state stored as Configmap called full-cluster-state in namespace kube-system

Imported clusters

  • Deployment cattle-cluster-agent and DeamonSet cattle-node-agent in namespace cattle-system
    • kubectl -n cattle-system get deploy cattle-cluster-agent
    • kubectl -n cattle-system get ds cattle-node-agent
  • No ServiceAccount named kontainer-engine in namespace cattle-system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment