-
Notifications
You must be signed in to change notification settings - Fork 560
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
make healthchecks optional #33
Conversation
I removed the files from k8s/.base and autogenerate them now in .gen via the Makefiles.
|
infrastructure/kctf/base/Makefile
Outdated
@@ -170,6 +172,18 @@ ${CLUSTER_GEN}/image-pushed: ${CLUSTER_GEN}/image-tagged | |||
# LOCAL_DOCKER doesn't need to be pushed | |||
touch $@ | |||
|
|||
.maybe-healthcheck: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we know if HEALTHCHECK is true since the beginning, could we instead do:
ifeq ($(HEALTCHECK),true)
.healtcheck-maybe: .healthcheck-enabled
else
.healthcheck-maybe: .healthcheck-disabled
endif
https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_7.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL, I'm using ifeq everywhere now
echo "skipping deployment: DEPLOY=\"$${DEPLOY}\"" | ||
fi | ||
endif | ||
|
||
stop: .cluster-config | ||
for resource_type in deployment service hpa; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI (since you removed the ifs and you only have for loops left):
instead of a bash for loop here, I think you could have a Makefile for loop.
$(foreach resource,deployment service hpa,kubectl get $(resource) && kubectl delete $(resource))
https://www.gnu.org/software/make/manual/html_node/Foreach-Function.html
You can make this more elegant (example) if readability was a concern.
Another option is to use xargs like this:
echo deployment service hpa | xargs echo "kubectl get {} && kubectl delete {}" | sh
And a few other ways. Not the most elegant, however, so up to you.
This and below would allow you to avoid bash mode.
a bunch of hacky changes to make it optional to deploy healthchecks
PTAL