Getting Started
Verified against
v0.9.1. Commands assume a running Kubernetes cluster,kubectlpointed at it, plushelmv3 andgiton your machine.
Prerequisites
- A Kubernetes cluster you can reach with
kubectl(the host that will run Clusterpedia). helmv3,git, andkubectlinstalled locally.- Credentials (a kubeconfig, or an apiserver URL plus a token or client certificate) for at least one member cluster you want to import.
Install
The official install path uses the Helm chart, which depends on the Bitnami PostgreSQL subchart. Clone the chart and resolve its dependencies first.
git clone https://github.com/clusterpedia-io/clusterpedia-helm.git
helm dependency build ./clusterpedia-helmA first working setup
Install Clusterpedia with the default PostgreSQL storage. Set
installCRDs=trueso thePediaClusterCRD is created, and pin the database to a node so its PersistentVolume binds.bashhelm install clusterpedia ./clusterpedia-helm \ --namespace clusterpedia-system \ --create-namespace \ --set installCRDs=true \ --set persistenceMatchNode=<your-node-name>Wait for the components to come up. You should see the apiserver, the clustersynchro-manager, the controller-manager, and the PostgreSQL pod.
bashkubectl -n clusterpedia-system get podsDescribe a member cluster as a
PediaCluster. Save this aspediacluster.yaml, filling in the apiserver address and credentials for the cluster you are importing.yamlapiVersion: cluster.clusterpedia.io/v1alpha2 kind: PediaCluster metadata: name: cluster-example spec: apiserver: "https://10.30.43.43:6443" caData: tokenData: syncResources: - group: apps resources: - deployments - group: "" resources: - podsApply it to register the cluster and start synchronization.
bashkubectl apply -f pediacluster.yamlConfirm the cluster is being synced. The
STATUScolumn should report the synchro running.bashkubectl get pediaclusters
Verify it works
Clusterpedia registers as an Aggregated API, so you can query it through your existing kubeconfig. List the resource API groups it serves:
kubectl get --raw "/apis/clusterpedia.io/v1beta1/resources/apis/apps" | jqTo search Deployments across every imported cluster, query the Clusterpedia resource endpoint and read the items it returns:
kubectl get --raw "/apis/clusterpedia.io/v1beta1/resources/apis/apps/v1/deployments" | jq '.items | length'Where to go next
- Installation for production storage choices and high availability.
- Import Clusters for authentication options and automatic import from platforms such as Karmada.
- Sync Cluster Resources for selecting which resources to collect, including
syncAllCustomResources.