-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HOSTEDCP-1716: When running the HO locally it
should no required a running pod This PR covers the steps to run the HyperShift Operator locally without needing access to a full production environment. Fixes #HOSTEDCP-1716
- Loading branch information
Marc Brown
committed
Jul 5, 2024
1 parent
b2fe3e8
commit cc1aa3c
Showing
7 changed files
with
109 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
docs/content/contribute/run-hypershift-operator-locally.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: Run the hypershift-operator locally | ||
--- | ||
|
||
## Run the HyperShift Operator locally | ||
|
||
To run the HyperShift Operator locally, follow these steps: | ||
|
||
1. Ensure that the `KUBECONFIG` environment variable is set to a management cluster where HyperShift has not been installed yet. | ||
|
||
```shell linenums="1" | ||
export KUBECONFIG="/path/to/your/kubeconfig" | ||
``` | ||
|
||
2. Build HyperShift. | ||
|
||
!!! note | ||
|
||
`requires go v1.22+ | ||
|
||
```shell linenums="1" | ||
make build | ||
``` | ||
|
||
3. Set the necessary environment variables | ||
|
||
```shell linenums="1" | ||
export HYPERSHIFT_REGION="your-region" | ||
export HYPERSHIFT_BUCKET_NAME="your-bucket" | ||
``` | ||
|
||
!!! note | ||
|
||
`Consider setting HYPERSHIFT_REGION and HYPERSHIFT_BUCKET_NAME in your shell init script (e.g., $HOME/.bashrc). | ||
|
||
!!! note | ||
|
||
`Default values are provided for HYPERSHIFT_REGION and HYPERSHIFT_BUCKET_NAME so Step #4 will function without requiring you to export any values. | ||
|
||
4. Install HyperShift in development mode which causes the operator deployment to be deployment scaled to zero so that it doesn't conflict with your local operator process (see [Prerequisites](../getting-started.md#prerequisites)): | ||
|
||
```shell linenums="1" | ||
make hypershift-install-aws-dev | ||
``` | ||
|
||
5. Run the HyperShift operator locally. | ||
|
||
```shell linenums="1" | ||
make run-operator-locally-aws-dev | ||
``` | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
REGION="${HYPERSHIFT_REGION:-us-east-1}" | ||
BUCKET_NAME="${HYPERSHIFT_BUCKET_NAME:-hypershift-ci-oidc}" | ||
AWSCREDS="${HYPERSHIFT_AWS_CREDS:-$HOME/.aws/credentials}" | ||
|
||
# Install hypershift | ||
echo "Installing hypershift" | ||
./bin/hypershift install \ | ||
--oidc-storage-provider-s3-credentials "${AWSCREDS}" \ | ||
--oidc-storage-provider-s3-region "${REGION}" \ | ||
--oidc-storage-provider-s3-bucket-name "${BUCKET_NAME}" \ | ||
--enable-defaulting-webhook=false \ | ||
--enable-conversion-webhook=false \ | ||
--enable-validating-webhook=false \ | ||
--development=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
export METRICS_SET="Telemetry" | ||
|
||
export MY_NAMESPACE=hypershift | ||
export MY_NAME=operator | ||
|
||
REGION="${HYPERSHIFT_REGION:-us-east-1}" | ||
BUCKET_NAME="${HYPERSHIFT_BUCKET_NAME:-hypershift-ci-oidc}" | ||
AWSCREDS="${HYPERSHIFT_AWS_CREDS:-$HOME/.aws/credentials}" | ||
|
||
# Run hypershift-operator locally. | ||
echo "Running hypershift-operator locally..." | ||
./bin/hypershift-operator \ | ||
run \ | ||
--metrics-addr=0 \ | ||
--enable-ocp-cluster-monitoring=false \ | ||
--enable-ci-debug-output=true \ | ||
--private-platform=AWS \ | ||
--enable-ci-debug-output=true \ | ||
--oidc-storage-provider-s3-credentials "${AWSCREDS}" \ | ||
--oidc-storage-provider-s3-region "${REGION}" \ | ||
--oidc-storage-provider-s3-bucket-name "${BUCKET_NAME}" \ | ||
--control-plane-operator-image=quay.io/hypershift/hypershift:latest |