2022-07-25 20:12:34 +02:00
|
|
|
##@ General
|
|
|
|
|
|
|
|
# The help target prints out all targets with their descriptions organized
|
|
|
|
# beneath their categories. The categories are represented by '##@' and the
|
|
|
|
# target descriptions by '##'. The awk commands is responsible for reading the
|
|
|
|
# entire set of makefiles included in this invocation, looking for lines of the
|
|
|
|
# file as xyz: ## something, and then pretty-format the target and help. Then,
|
|
|
|
# if there's a line with ##@ something, that gets pretty-printed as a category.
|
|
|
|
# More info on the usage of ANSI control characters for terminal formatting:
|
|
|
|
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
|
|
|
|
# More info on the awk command:
|
|
|
|
# http://linuxcommand.org/lc3_adv_awk.php
|
|
|
|
|
|
|
|
help: ## Display this help.
|
|
|
|
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
|
|
|
|
|
|
|
|
##@ Setup
|
|
|
|
|
2022-11-29 14:16:04 +01:00
|
|
|
up: ## Create a local K3D development cluster.
|
|
|
|
@k3d cluster create interfacer-swkit --config k3s-dev.yaml
|
2022-07-25 20:12:34 +02:00
|
|
|
|
2022-11-29 14:16:04 +01:00
|
|
|
down: ## Delete the local K3D development cluster
|
|
|
|
@k3d cluster delete interfacer-swkit
|
2022-07-25 20:12:34 +02:00
|
|
|
|
|
|
|
##@ Lint
|
|
|
|
|
|
|
|
lint: yaml-lint markdown-lint ## Lint all input files.
|
|
|
|
|
|
|
|
yaml-lint: ## Lint all YAML files.
|
2022-07-30 21:19:44 +02:00
|
|
|
@yamllint -f auto .
|
2022-07-25 20:12:34 +02:00
|
|
|
|
|
|
|
markdown-lint: ## Lint all Markdown files.
|
2022-07-30 21:19:44 +02:00
|
|
|
@mdl .
|
2022-07-26 13:02:32 +02:00
|
|
|
|
|
|
|
manifest-lint: ## Lint the Kubenetes manifest.
|
2022-07-30 21:19:44 +02:00
|
|
|
@kubectl kustomize overlays/dev --enable-helm | kubeconform -ignore-missing-schemas -strict
|
2022-07-25 20:12:34 +02:00
|
|
|
|
|
|
|
##@ Build
|
|
|
|
|
2022-07-30 21:19:44 +02:00
|
|
|
doc: ## Build the documentation using mkdocs.
|
|
|
|
mkdocs build
|
|
|
|
|
2022-07-27 17:25:36 +02:00
|
|
|
manifest: ## Build Kubernetes manifest using Kustomize and Helm.
|
2022-07-30 21:19:44 +02:00
|
|
|
@kubectl kustomize overlays/dev --enable-helm
|
2022-07-25 20:12:34 +02:00
|
|
|
|
2022-11-29 14:16:04 +01:00
|
|
|
deploy: deploy-dev ## Apply the manifest to the local Kubernetes development cluster.
|
|
|
|
|
|
|
|
deploy-dev: ## Apply the manifest to the local Kubernetes development cluster.
|
2022-07-30 21:19:44 +02:00
|
|
|
@kubectl kustomize overlays/dev/ --enable-helm | kubectl apply --server-side=true -f -
|
2022-07-25 20:12:34 +02:00
|
|
|
|
2022-11-29 14:16:04 +01:00
|
|
|
deploy-prod: ## Apply the manifest to the Kubernetes production cluster.
|
|
|
|
@kubectl kustomize overlays/prod/ --enable-helm | kubectl apply --server-side=true -f -
|
|
|
|
|
|
|
|
remove: ## Remove the namespaces from the Kubernetes cluster.
|
|
|
|
@kubectl delete namespaces \
|
|
|
|
cert-manager \
|
|
|
|
gitea \
|
|
|
|
interfacer-core \
|
|
|
|
interfacer-webpresence
|
|
|
|
|
2022-07-27 17:25:36 +02:00
|
|
|
clean: down up ## Clean the local Kubernetes development cluster.
|
2022-07-25 20:12:34 +02:00
|
|
|
|
|
|
|
##@ Show
|
|
|
|
|
2022-07-30 21:19:44 +02:00
|
|
|
get: ## Get specific Kubernetes resources from all namespaces.
|
|
|
|
@kubectl get --all-namespaces $(filter-out $@, $(MAKECMDGOALS))
|
|
|
|
|
2022-07-25 20:12:34 +02:00
|
|
|
get-all: ## Get the state of all Kubernetes resources.
|
2022-07-30 21:19:44 +02:00
|
|
|
@kubectl get all --all-namespaces
|
2022-07-25 20:12:34 +02:00
|
|
|
|
2022-07-26 13:02:32 +02:00
|
|
|
get-ns: ## Get all Kubernetes namespaces.
|
2022-07-30 21:19:44 +02:00
|
|
|
@kubectl get namespaces
|
2022-07-26 13:02:32 +02:00
|
|
|
|
|
|
|
get-api: ## Get all Kubernetes api resources.
|
2022-07-30 21:19:44 +02:00
|
|
|
@kubectl api-resources
|
|
|
|
|
|
|
|
get-crd: ## Get all Kubernetes api resources.
|
|
|
|
@kubectl get crd
|
|
|
|
|
|
|
|
get-node: ## Get all Kubernetes nodes.
|
|
|
|
@kubectl get nodes -o wide
|
2022-07-26 13:02:32 +02:00
|
|
|
|
2022-07-25 20:12:34 +02:00
|
|
|
watch-all: ## Watch the state of all Kubernetes resources.
|
2022-07-30 21:19:44 +02:00
|
|
|
@watch -n 1 kubectl get all --all-namespaces
|
2022-07-26 13:02:32 +02:00
|
|
|
|
2022-07-30 21:19:44 +02:00
|
|
|
##@ Log
|
|
|
|
|
|
|
|
events: ## Show all Kubernetes cluster events.
|
|
|
|
@kubectl get events --watch --all-namespaces
|
|
|
|
|
|
|
|
%:
|
|
|
|
@true
|