---
tags: Discussion
---
# Airshipctl Cluster List
[TOC]
## Definitions:
### What is a Site:
* Its a physical location
* Defines a repo
* Represents collection of clusters
* Will include a properly managed cluster-map
* https://github.com/airshipit/airshipctl/blob/master/manifests/phases/cluster-map.yaml
**CLUSTER-MAP.YAML**
```yaml
---
apiVersion: airshipit.org/v1alpha1
kind: ClusterMap
metadata:
labels:
airshipit.org/deploy-k8s: "false"
name: main-map
map:
target-cluster:
parent: ephemeral-cluster
ephemeral-cluster: {}
workload-cluster:
..
```
```json
TenantA/<phasecp>
<...namespace: tenantA_ns..>
TenantA/<phaseworkers>
TenantA/<phasewprkloads>
```
### What is a Cluster:
* An entity that has its own kubeconfig?
* An entity that has its own kubernetes api?
* A cluster-map will have an entry for each of this clusters
* Each cluster will have a cluster object for CAPI.
## What does this command do
Presumption: This command will only lists cluster for which teh MAnifest?
Document set has been previously pulled onto teh local filesystem.
* Iterate over the airshipctl config
Manifests map[string]*Manifest `json:"manifests"`
* For each, Manifests
* If it's in the filesystem
* Collect the document bundle for the current manifest represented structure,
* Collect the cluster-map
* Validate that each cluster listed in the cluster map has a capi cluster object.
* List the cluster with some sort of indication of management/target vs workload.
* The output might be a tree structure. And the root of the tree is the management cluster
* If its not in the filesystem
* Will log an error for Manifest repos that are not in the filesystem.
## GAPS/ASSUMPTIONS
Assumptions that the docoument set interaction is sufficient for this.
* GAPS : ClusterMAp will be manually managed at first. It will include the cluster name + teh target namespace where its artiofacts wil be created
* Future we can automate generation using the document set. Future issue post v2.