## Create a cluster using cluster API in AWS (CAPA) In order to create a cluster in an installation using the new cluster API in aws environment you can follow these simple steps: ### Create yaml files - Create a template for a yaml file using `kubectl gs template cluster` command. An example of the command would be: ``` kubectl gs template cluster --provider capa --organization YOUR_ORG > cluster.yaml ``` You can check all the available paramaters in the [command reference]({{< relref "/ui-api/kubectl-gs/template-cluster" >}}) - This command will return several objects that you need to create in your management cluster to create your cluster. You can now edit the file to include your preferred options. ``` yaml --- apiVersion: v1 data: values: | aws: {} bastion: {} clusterName: brhf3 controlPlane: replicas: 3 machinePools: - instanceType: m5.xlarge maxSize: 10 minSize: 3 name: machine-pool0 rootVolumeSizeGB: 300 network: availabilityZoneUsageLimit: 3 organization: YOUR_ORG kind: ConfigMap metadata: creationTimestamp: null labels: YOUR_ORG.io/cluster: brhf3 name: brhf3-userconfig namespace: org-YOUR_ORG --- apiVersion: application.YOUR_ORG.io/v1alpha1 kind: App metadata: labels: app-operator.YOUR_ORG.io/version: 0.0.0 name: brhf3 namespace: org-YOUR_ORG spec: catalog: cluster config: configMap: name: "" namespace: "" secret: name: "" namespace: "" kubeConfig: context: name: "" inCluster: true secret: name: "" namespace: "" name: cluster-aws namespace: org-YOUR_ORG userConfig: configMap: name: brhf3-userconfig namespace: org-YOUR_ORG version: 0.9.2 --- apiVersion: v1 data: values: | clusterName: brhf3 organization: YOUR_ORG kind: ConfigMap metadata: creationTimestamp: null labels: YOUR_ORG.io/cluster: brhf3 name: brhf3-default-apps-userconfig namespace: org-YOUR_ORG --- apiVersion: application.YOUR_ORG.io/v1alpha1 kind: App metadata: labels: app-operator.YOUR_ORG.io/version: 0.0.0 name: brhf3-default-apps namespace: org-YOUR_ORG spec: catalog: cluster config: configMap: name: "" namespace: "" secret: name: "" namespace: "" kubeConfig: context: name: "" inCluster: true secret: name: "" namespace: "" name: default-apps-aws namespace: org-YOUR_ORG userConfig: configMap: name: brhf3-default-apps-userconfig namespace: org-YOUR_ORG version: 0.5.4 ``` ## Creating the cluster Applying this files to the management cluster is enough to create the cluster. When this happens cluster operator takes control and creates the necessary resources for the new workload cluster. ``` kubectl apply -f cluster.yaml ``` You can check that the cluster has been properly created using `kubectl get clsuters` in the management cluster. ``` kubectl get clusters -n org-YOUR_ORG NAME PHASE AGE VERSION brhf3 Provisioned 10m ```