Images for changes merged into main are automatically built through the metal3-io org on quay.io. It is also easy to set up your own builds to test images from branches in your development fork.
-
Fork
metal3-io/baremetal-operator
on GitHub. -
Set up your account on quay.io.
-
Link your repository from step 1 to quay.io by following the instructions to "Create New Repository" from https://quay.io/repository/
- Enter the quay.io repository name. It is good practice to use the same name as the github repo.
- Make the repository public.
- Select "Link to a GitHub Repository Push" option at the bottom of the screen.
- Click "Create Public Repository"
- When prompted, authenticate to GitHub to allow quay.io to see your repositories.
- Select the GitHub organization, usually your personal repo org.
- Select the repository from the list. If you have a lot of repos, it may help to type part of the name into the filter box to reduce the length of the list.
- Click "Continue"
- Configure your trigger. Selecting "Trigger for all branches and tags" allows you to build images from branches automatically, and is good for a developer configuraiton.
- Click "Continue"
- Enter the Dockerfile name:
build/Dockerfile
- Enter the "context" where Docker will run the build. This is
usually
/
, to indicate the root of your repository. - Click "Continue"
- Skip setting up a robot account and click "Continue" again.
- Click "Continue" again (yes, 3 times in a row).
- At this point, quay.io adds an ssh key to your repository.
- Click the "Return to ..." link.
-
Test a build
- Click "Start New Build"
- Click "Run Trigger Now" in the modal popup
- Select "main" from the list of branches.
- Click "Start Build"
- At this point you may have to refresh your browser to see the build because the UI seems to cache pretty aggressively.
-
Create a dev deployment file that uses your image instead of the one from the metal3-io organization.
-
Copy
deploy/operator.yaml
todeploy/dev-operator.yaml
. -
Edit
deploy/dev-operator.yaml
and change theimage
setting so it points to your account on quay.io. Builds from main will have the default "latest" tag, but in order to test from a branch you will need to modify the image name to include the branch at the end, like this:quay.io/dhellmann/baremetal-operator:update-operator-deployment
-
-
Launch the deployment by applying the new file.
-
Make sure you have run the setup steps to set up the service account, role, and mapping.
-
Apply the new deployment:
kubectl apply -f deploy/dev-operator.yaml
-
To monitor the operator, use kubectl get pods
to find the pod name for
the deployment (it will start with baremetal-operator
) and then use
kubectl log -f $podname
to see the console log output.