-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HOSTEDCP-1716: When running the HO locally it should no required a running pod #4268
Merged
openshift-merge-bot
merged 1 commit into
openshift:main
from
marcbrown2024:hypershift-operator-locally
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably worth making --control-plane-operator-image a variable