-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webhook: adding support for adding pod group labels
Problem: we need every pod object coming into the cluster to be part of a group. Solution: This change adds logic to the mutating webhook to add the labels that indicate the group name and size. We can eventually add flexibility here. I also realize that we can easily watch for job objects first, and add the group size/name to the pod template. This will be much more efficient to then not have to add to the individual pods that are part of a larger job. With this approach I was able to create a fluence scheduled pod, and then see my labels added! It does not do anything beyond that. I am also adding a nice script that makes it easy to build, load, and install fluence freshly, otherwise you will use all your internet data for the month in like, two days. Do not do that :P Signed-off-by: vsoch <[email protected]>
- Loading branch information
Showing
7 changed files
with
137 additions
and
176 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Before running this, you should: | ||
# 1. create the kind cluster (needs more than one node, fluence does not scheduler to the control plane) | ||
# 2. Install cert-manager | ||
# 3. Customize the script to point to your registry if you intend to push | ||
|
||
REGISTRY="${1:-ghcr.io/vsoch}" | ||
HERE=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
ROOT=$(dirname ${HERE}) | ||
|
||
# Go to the script directory | ||
cd ${ROOT} | ||
|
||
# These build each of the images. The sidecar is separate from the other two in src/ | ||
make REGISTRY=${REGISTRY} SCHEDULER_IMAGE=fluence SIDECAR_IMAGE=fluence-sidecar CONTROLLER_IMAGE=fluence-controller | ||
|
||
# This is what it might look like to push | ||
# docker push ghcr.io/vsoch/fluence-sidecar && docker push ghcr.io/vsoch/fluence-controller && docker push ghcr.io/vsoch/fluence:latest | ||
|
||
# We load into kind so we don't need to push/pull and use up internet data ;) | ||
kind load docker-image ${REGISTRY}/fluence-sidecar:latest | ||
kind load docker-image ${REGISTRY}/fluence-controller:latest | ||
kind load docker-image ${REGISTRY}/fluence:latest | ||
|
||
# And then install using the charts. The pull policy ensures we use the loaded ones | ||
cd ${ROOT}/upstream/manifests/install/charts | ||
helm uninstall fluence || true | ||
helm install \ | ||
--set scheduler.image=${REGISTRY}/fluence:latest \ | ||
--set scheduler.sidecarPullPolicy=Never \ | ||
--set scheduler.pullPolicy=Never \ | ||
--set controller.pullPolicy=Never \ | ||
--set controller.image=${REGISTRY}/fluence-controller:latest \ | ||
--set scheduler.sidecarimage=${REGISTRY}/fluence-sidecar:latest \ | ||
fluence as-a-second-scheduler/ |
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
Oops, something went wrong.