-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: BPFMAN_IMG & BPFMAN_AGENT_IMG to overwrite image
The bpfman-operator is setup to allow BPFMAN_IMG to overwrite the default bpfman image, and BPFMAN_AGENT_IMG to overwrite the bpfman-agent image. However, the Makefile is leveraging kustomize. kustomize can replace an image string in a yaml when it knows the k8s object layout, but these images are passed via a ConfigMap, which is opaque data. So the current implementation doesn't work. kustomize does have a ConfigMapGenrator, which can replace the contents of a ConfigMap. The change is to: * Change the kustomization.yaml to use a `configMapGenerator`. * Use `sed` to replace the default images with those passed in (or just the default image if none were passed in). The `kustomize edit set image` command doesn't work. The `sed` command is changing the file content, so rename kustomization.yaml to kustomization.yaml.env and piped the changes to kustomization.yaml. * Add kustomization.yaml to .gitignore so changes aren't tracked by git. Signed-off-by: Billy McFall <[email protected]>
- Loading branch information
Showing
4 changed files
with
29 additions
and
17 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
resources: | ||
- config.yaml | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
# Patch the config.yaml to change bpfman and bpfman-agent image and tag. | ||
# Because it is of "kind: ConfigMap", the data is opaque and kustomize can't | ||
# update image magically. | ||
configMapGenerator: | ||
- behavior: merge | ||
literals: | ||
- bpfman.image=quay.io/bpfman/bpfman:latest | ||
- bpfman.agent.image=quay.io/bpfman/bpfman-agent:latest | ||
name: config | ||
namespace: kube-system |