diff --git a/.dockerignore b/.dockerignore index 4dd9a78..deb536b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ /kubeconfig +/kubectl /join-command diff --git a/.gitignore b/.gitignore index 4dd9a78..deb536b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /kubeconfig +/kubectl /join-command diff --git a/Makefile b/Makefile index 19a15ba..76157e4 100644 --- a/Makefile +++ b/Makefile @@ -81,6 +81,17 @@ kubeconfig: $(COMPOSE) cp $(NODE_SERVICE_NAME):/etc/kubernetes/admin.conf ./kubeconfig @echo "# Run the following command by yourself:" @echo "export KUBECONFIG=$(shell pwd)/kubeconfig" +ifeq ($(shell command -v kubectl 2> /dev/null),) + @echo "# To install kubectl, run the following command too:" + @echo "make kubectl" +endif + +.PHONY: kubectl +kubectl: + $(COMPOSE) cp $(NODE_SERVICE_NAME):/usr/bin/kubectl ./kubectl + @echo "# Run the following command by yourself:" + @echo "export PATH=$(shell pwd):\$$PATH" + @echo "source <(kubectl completion bash)" .PHONY: join-command join-command: