Skip to content

Commit

Permalink
Merge pull request #124 from a13x5/HMC-106
Browse files Browse the repository at this point in the history
Add docs on aws-hosted-cp temlate
  • Loading branch information
Kshatrix authored Aug 2, 2024
2 parents 726df37 + ab84c5d commit 7cc8f2f
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ kubectl get template -n hmc-system -o go-template='{{ range .items }}{{ if eq .s

For details about the `Template system` in HMC, see [Templates system](docs/templates/main.md#templates-system).

If you want to deploy hostded control plate template, make sure to check additional notes on [Hosted control plane](docs/aws/hosted-control-plane.md).

2. Create the file with the `Deployment` configuration:

> Substitute the parameters enclosed in angle brackets with the corresponding values.\
Expand Down
79 changes: 79 additions & 0 deletions docs/aws/hosted-control-plane.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Hosted control plane (k0smotron) deployment

## Prerequisites

- Management Kubernetes cluster (v1.28+) deployed on AWS with HMC installed on it
- Default storage class configured on the management cluster
- VPC id for the worker nodes
- Subnet ID which will be used along with AZ information
- AMI id which will be used to deploy worker nodes

Keep in mind that all control plane components for all managed clusters will
reside in the management cluster.

## Networking

The networking resources in AWS which are needed for a managed cluster can be
reused with a management cluster.

If you deployed your AWS Kubernetes cluster using Cluster API Provider AWS (CAPA)
you can obtain all the necessary data with the commands below:

**VPC ID**

```bash
kubectl get awscluster <cluster name> -o go-template='{{.spec.network.vpc.id}}'
```

**Subnet ID**

```bash
kubectl get awscluster <cluster name> -o go-template='{{(index .spec.network.subnets 0).resourceID}}'
```

**Availability zone**

```bash
kubectl get awscluster <cluster name> -o go-template='{{(index .spec.network.subnets 0).availabilityZone}}'
```

**Security group**
```bash
kubectl get awscluster <cluster name> -o go-template='{{.status.networkStatus.securityGroups.node.id}}'
```

**AMI id**

```bash
kubectl get awsmachinetemplate <cluster name>-worker-mt -o go-template='{{.spec.template.spec.ami.id}}'
```

If you want to use different VPCs/regions for your management or managed clusters
you should setup additional connectivity rules like [VPC peering](https://docs.aws.amazon.com/whitepapers/latest/building-scalable-secure-multi-vpc-network-infrastructure/vpc-peering.html).


## HMC Deployment manifest

With all the collected data your `Deployment` manifest will look similar to this:

```yaml
apiVersion: hmc.mirantis.com/v1alpha1
kind: Deployment
metadata:
name: aws-hosted-cp
spec:
template: aws-hosted-cp
config:
vpcID: vpc-0a000000000000000
region: us-west-1
publicIP: true
subnets:
- id: subnet-0aaaaaaaaaaaaaaaa
availabilityZone: us-west-1b
amiID: ami-0bfffffffffffffff
instanceType: t3.medium
securityGroupIDs:
- sg-0e000000000000000
```
*Note: in this example we're using us-west-1 region, but you should use the region of your VPC*

0 comments on commit 7cc8f2f

Please sign in to comment.