diff --git a/README.md b/README.md index 32c405b35..4b5b24a9c 100644 --- a/README.md +++ b/README.md @@ -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.\ diff --git a/docs/aws/hosted-control-plane.md b/docs/aws/hosted-control-plane.md new file mode 100644 index 000000000..7fbd8b765 --- /dev/null +++ b/docs/aws/hosted-control-plane.md @@ -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 -o go-template='{{.spec.network.vpc.id}}' +``` + +**Subnet ID** + +```bash + kubectl get awscluster -o go-template='{{(index .spec.network.subnets 0).resourceID}}' +``` + +**Availability zone** + +```bash + kubectl get awscluster -o go-template='{{(index .spec.network.subnets 0).availabilityZone}}' +``` + +**Security group** +```bash + kubectl get awscluster -o go-template='{{.status.networkStatus.securityGroups.node.id}}' +``` + +**AMI id** + +```bash + kubectl get awsmachinetemplate -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*