Skip to content

Instantly share code, notes, and snippets.

@jparrill
Last active November 23, 2022 16:59
Show Gist options
  • Save jparrill/b676ccb522a1fb8e89c1661840658c3a to your computer and use it in GitHub Desktop.
Save jparrill/b676ccb522a1fb8e89c1661840658c3a to your computer and use it in GitHub Desktop.
Generate Migration HC Environment

Create Migration Environment

Create Clusters

Dev will be the Source Management Cluster

/Users/jparrill/RedHat/RedHat_Engineering/hypershift/repos/hypershift/bin/hypershift create cluster aws --aws-creds ~/.aws/credentials --instance-type m6i.xlarge --region us-west-1 --auto-repair --generate-ssh --name jparrill-dev --namespace jparrill --base-domain jpdv.aws.kerbeross.com --node-pool-replicas 2 --pull-secret /Users/jparrill/RedHat/RedHat_Engineering/pull_secret.json --release-image quay.io/openshift-release-dev/ocp-release:4.12.0-rc.1-x86_64; sleep 120;mkdir -p /Users/jparrill/RedHat/RedHat_Engineering/hypershift/hosted_clusters/jparrill-jparrill-dev && /Users/jparrill/RedHat/RedHat_Engineering/hypershift/repos/hypershift/bin/hypershift create kubeconfig --name jparrill-dev --namespace jparrill > /Users/jparrill/RedHat/RedHat_Engineering/hypershift/hosted_clusters/jparrill-jparrill-dev/kubeconfig

Dest will be the Destination Management Cluster

/Users/jparrill/RedHat/RedHat_Engineering/hypershift/repos/hypershift/bin/hypershift create cluster aws --aws-creds ~/.aws/credentials --instance-type m6i.xlarge --region us-west-1 --auto-repair --generate-ssh --name jparrill-dest --namespace jparrill --base-domain jpdv.aws.kerbeross.com --node-pool-replicas 2 --pull-secret /Users/jparrill/RedHat/RedHat_Engineering/pull_secret.json --release-image quay.io/openshift-release-dev/ocp-release:4.12.0-rc.1-x86_64; sleep 120; mkdir -p /Users/jparrill/RedHat/RedHat_Engineering/hypershift/hosted_clusters/jparrill-jparrill-dest && /Users/jparrill/RedHat/RedHat_Engineering/hypershift/repos/hypershift/bin/hypershift create kubeconfig --name jparrill-dest --namespace jparrill > /Users/jparrill/RedHat/RedHat_Engineering/hypershift/hosted_clusters/jparrill-jparrill-dest/kubeconfig

Install Hypershift with ExternalDNS Support

  • Dev and Dest Cluster
export KUBECONFIG=/Users/jparrill/RedHat/RedHat_Engineering/hypershift/hosted_clusters/jparrill-jparrill-dev/kubeconfig

/Users/jparrill/RedHat/RedHat_Engineering/hypershift/repos/hypershift/bin/hypershift install --oidc-storage-provider-s3-bucket-name jparrill-hosted-us-west-1 --oidc-storage-provider-s3-credentials ~/.aws/credentials --oidc-storage-provider-s3-region us-west-1 --external-dns-provider=aws --external-dns-credentials=$HOME/.aws/credentials --external-dns-domain-filter=guest.jpdv.aws.kerbeross.com --private-platform AWS --aws-private-creds ~/.aws/credentials --aws-private-region us-west-1 --platform-monitoring=OperatorOnly --enable-uwm-telemetry-remote-write --enable-ci-debug-output

export KUBECONFIG=/Users/jparrill/RedHat/RedHat_Engineering/hypershift/hosted_clusters/jparrill-jparrill-dest/kubeconfig

/Users/jparrill/RedHat/RedHat_Engineering/hypershift/repos/hypershift/bin/hypershift install --oidc-storage-provider-s3-bucket-name jparrill-hosted-us-west-1 --oidc-storage-provider-s3-credentials ~/.aws/credentials --oidc-storage-provider-s3-region us-west-1 --external-dns-provider=aws --external-dns-credentials=$HOME/.aws/credentials --external-dns-domain-filter=guest.jpdv.aws.kerbeross.com --private-platform AWS --aws-private-creds ~/.aws/credentials --aws-private-region us-west-1 --platform-monitoring=OperatorOnly --enable-uwm-telemetry-remote-write --enable-ci-debug-output

Create Hosted Cluster in Dev Management Cluster

export KUBECONFIG=/Users/jparrill/RedHat/RedHat_Engineering/hypershift/hosted_clusters/jparrill-jparrill-dev/kubeconfig

/Users/jparrill/RedHat/RedHat_Engineering/hypershift/repos/hypershift/bin/hypershift create cluster aws --aws-creds ~/.aws/credentials --instance-type m6i.xlarge --region us-west-1 --auto-repair --generate-ssh --name jparrill-hosted --namespace clusters --base-domain hc.jpdv.aws.kerbeross.com --external-dns-domain guest.jpdv.aws.kerbeross.com --node-pool-replicas 2 --pull-secret /Users/jparrill/RedHat/RedHat_Engineering/pull_secret.json --release-image quay.io/openshift-release-dev/ocp-release:4.12.0-rc.1-x86_64; sleep 120;mkdir -p /Users/jparrill/RedHat/RedHat_Engineering/hypershift/hosted_clusters/clusters-jparrill-hosted && /Users/jparrill/RedHat/RedHat_Engineering/hypershift/repos/hypershift/bin/hypershift create kubeconfig --name jparrill-hosted --namespace clusters > /Users/jparrill/RedHat/RedHat_Engineering/hypershift/hosted_clusters/clusters-jparrill-hosted/kubeconfig

Perform the Migration

To execute the migration I use this bash script which delegates the variables in this common file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment