Skip to content
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

add a make target ('build') that runs ko build #2225

Closed
joemiller opened this issue Jul 30, 2022 · 0 comments · Fixed by #2248
Closed

add a make target ('build') that runs ko build #2225

joemiller opened this issue Jul 30, 2022 · 0 comments · Fixed by #2248
Assignees
Labels
feature New feature or request

Comments

@joemiller
Copy link

joemiller commented Jul 30, 2022

This idea came from a discussion with @jonathan-innis on the Kubernetes Slack #karpenter channel.

Proposal: Add a make build target that will run ko build to build and push the docker images. The command would run the same ko commands as the current apply task:

build:
  $(WITH_GOFLAGS) ko build -B github.com/aws/karpenter/cmd/controller
  $(WITH_GOFLAGS) ko build -B github.com/aws/karpenter/cmd/webhook

Rationale: Support development use cases where using the make apply task is not desirable because it runs a helm upgrade. You may be working on a cluster that has a helm config that differs from the default values in this repo.

In my particular case the development cluster I was working against has karpenter installed and managed by an argoCD instance with various rules and logic around the values.yaml files that are applied. All that I really needed to do to test my karpenter changes was to build/push and patch new docker images into them without any use of helm.

In my initial attempts at doing this I was using the ko build ... commands pulled out of the Makefile. This led to an incorrect webhook build because I forgot to include the GOFLAGS=-tag=$CLOUD_PROVIDER env var for ko.

Workaround: I am currently working around this by incorporating these commands into my dev workflow:

GOFLAGS="-tags=${CLOUD_PROVIDER}" ko build -B github.com/aws/karpenter/cmd/webhook -t $TAG
GOFLAGS="-tags=${CLOUD_PROVIDER}" ko build -B github.com/aws/karpenter/cmd/controller -t $TAG

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants