Skip to content

Instantly share code, notes, and snippets.

@jmervine
Created December 19, 2018 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmervine/5c0cdf69664be7275e2bc17c84bdf50c to your computer and use it in GitHub Desktop.
Save jmervine/5c0cdf69664be7275e2bc17c84bdf50c to your computer and use it in GitHub Desktop.
UPDATE_TYPE ?= sts
STS ?=
indexers: ## Select indexer as actionable StatefultSet
indexers:
$(eval STS := indexer)
@echo "Set indexer as actionable StatefulSet"
indexer: indexers
index: indexers
searchers: ## Select search as actionable StatefultSet
searchers:
$(eval STS := search)
@echo "Set search as actionable StatefulSet"
searcher: searchers
search: searchers
update: ## Perform rolling update on selected actionable StatefulSet
update:
@if test -z "$(STS)"; then \
echo "ERROR: Please provide a StatefulSet to update: 'make <sts> update'."; \
else \
echo "kubectl patch $(UPDATE_TYPE) $(STS) -p '{\"spec\":{\"updateStrategy\":{\"type\":\"RollingUpdate\"}}}'"; \
kubectl patch $(UPDATE_TYPE) $(STS) -p '{"spec":{"updateStrategy":{"type":"RollingUpdate"}}}'; \
fi
.PHONY: indexers indexer index searchers searcher search update
@jmervine
Copy link
Author

doesn't work as expected, revisit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment