This is to be an interface for ACM (Advanced Cluster Management for Kubernetes) to work with Hypershift in the following use cases
Use case | ManagementCluster install | HostedCluster control plane | ACM creates Infrastructure | User brings infrastructure |
---|---|---|---|---|
(1) ManagementCluster on ACM cluster | ACM | ACM | AWS & IBM | |
(2) ManagementCluster on ManagedCluster | ManagedCluster | ACM | AWS & IBM |
Note: Only 1 is supported at this time
This allows you to create multiple Hypershift HostedClusters on the ACM cluster.
- Connect to the ACM cluster with
oc
cli - Git Clone the Hypershift repository
git clone git@github.com:openshift/hypershift.git
- Follow the README.md and build the project to get the
hypershift
cli
make build
- Use the quickstart to install the Hypershift operator with the
hypershift
cli https://hypershift-docs.netlify.app/getting-started/ CompletePrerequisites
andBefore you begin
You need to create the S3 bucket, and run thehypershift install ...
command. Ignore the rest.
- Clone this repository
- Make sure you are connected to the ACM/OCP cluster where you ran
hypershift install
and launch the controller
go run pkg/main.go
- Make sure you are connected to the ACM/OCP cluster where you ran
hypershift install
and launch the controller
oc apply -k config/deployment
This will create the service account, roles, role-bindings and deployment that runs the controller. It currently uses the image quay.io/jpacker/hypershift-deployment-controller
- In another shell, create the namespace
clusters
and set that as the default for you context - Make sure you have a copy of the AWS Provider Connection in this namespace. You can use the ACM console to create it in the
clusters
namespace. - Create a
HypershiftDeployment
resource (hd), and watch the logs. Thehd
resource will create the infrastructure in AWS if:Spec.Infrastructure.Configure: True
. Once all the AWS resources are created, it will create aHostedCluster
resource andNodePool
. You will also notice that thehd.Spec.HostedClusterSpec
andhd.Spec.NodePools[]
keys are filled in with the values that were used to create the kube resources. - You can add additional NodePools, by editing the NodePools array, and adding addional specs. The easiest way to do this is to copy the existing spec, and just change the name.
oc get hd # displays the status of Infrastructure deployment if configure: true
# NAME INFRA READY IAM READY PROVIDER REF FOUND
# sample ConfiguredAsExpected True ConfiguredAsExpected True ReferenceAsExpected True
If there is problem, looking at the HypershiftDeployment.Status.Conditions[].message
and you will see a specific error message. When destroying the infrastructure, you will see similar details on the progres of clean up.
- Make sure the controller is running
- Delete the HypershiftDeployment resource
- Make sure the controller is running
- Edit the HypershiftDeployment resource, and remove the NodePool element from the array. The controller will reconcile the result and delete the NodePool
You can customize the values for HostedCluster (bring your own) or in combination with Spec.Infrastructure.Configure: True
.
If Spec.Infrastructure.Configure: False
you must provide a complete Spec.HostedClusterSpec
and Spec.NodePools
definition. Otherwise the two resources will not successfully complete and you will not get a Hypershift cluster.
If Spec.Infrastructure.Configure: True
, but you supply values for Spec.HostedClusterSpec
and Spec.NodePools
the following will be overwritten with values from the Infrastructure build
Spec.HostedCluster:
- HostedCluster.dns
- HostedCluster.infraID
- HostedCluster.issuerURL
- HostedCluster.networking.machineCIDR
- HostedCluster.Platform.aws (The whole thing)
Spec.NodePool:
- []NodePool.Spec.clusterName (When it doesn't match the HypershiftDeployment name)
- []NodePool.Spec.platform.aws (When
nil
the entire spec will be created) - []NodePool.Spec.platform.aws.instanceProfile (When empty
""
it will be set) - []NodePool.Spec.platform.aws.securityGroups (When
nil
the security group from the infrastructure configuration is used) - []NodePool.Spec.aws.subnet (When
nil
the Private Subnet ID from the infrastructure configuration is used)