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

use ko for function-controller development deployment #5613

Merged
merged 18 commits into from Sep 18, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 13 additions & 10 deletions components/function-controller/Makefile
Expand Up @@ -68,7 +68,7 @@ install:

# Uninstall CRDs from cluster
uninstall:
kubectl apply -f config/crds/serverless_v1alpha1_function.yaml
kubectl delete -f config/crds/serverless_v1alpha1_function.yaml

# Generate manifests e.g. CRD, RBAC etc.
manifests:
Expand All @@ -81,16 +81,14 @@ ifeq ($(shell uname -s),Darwin)
sedbackupflag +=
endif

deploy: manifests install bin/kustomize
@echo "updating kustomize image patch file for manager resource"
cp ./config/default/manager_image_patch.yaml{,.bak}
sed $(sedbackupflag)'' -e 's@image: .*@image: $(IMG)@' ./config/default/manager_image_patch.yaml
bin/kustomize build config/default | kubectl apply -f -
mv ./config/default/manager_image_patch.yaml{.bak,}
deploy: manifests install bin/kustomize ko
bin/kustomize build config/default | ko apply -f -
antoineco marked this conversation as resolved.
Show resolved Hide resolved

removewebhook:
-kubectl delete mutatingwebhookconfigurations.admissionregistration.k8s.io function-webhook.serverless.kyma-project.io

undeploy: uninstall bin/kustomize
kubectl delete -f config/crds
bin/kustomize build config/default | kubectl delete -f -
undeploy: uninstall removewebhook bin/kustomize ko
bin/kustomize build config/default | ko delete -f -

# Build the docker image
.PHONY: docker-build
Expand Down Expand Up @@ -127,3 +125,8 @@ export GOBIN := $(GOPATH)/src/$(PKG)/bin
.PHONY: bin/kustomize
bin/kustomize:
@go install ./vendor/sigs.k8s.io/kustomize

.PHONY: ko
ko:
@go get -u github.com/google/ko/cmd/ko