Add kubectl.makefile

Add kubectl make commands like set-namespace and create-regcred.
This commit is contained in:
ducoterra
2021-12-05 22:13:02 -05:00
parent cf41f2e776
commit 1532f30641
2 changed files with 12 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ include .gitlab/make/helm.makefile
include .gitlab/make/kaniko.makefile
include .gitlab/make/truenas.makefile
include .gitlab/make/git.makefile
include .gitlab/make/kubectl.makefile
.PHONY: make-update
make-update:

11
make/kubectl.makefile Normal file
View File

@@ -0,0 +1,11 @@
.PHONY: set-namespace
set-namespace:
kubectl config set contexts.$(shell kubectl config current-context).namespace $(shell cat NAMESPACE)
.PHONY: create-regcred
create-regcred:
@kubectl create secret docker-registry regcred \
--docker-server=registry.ducoterra.net \
--docker-username=$(shell vault kv get -field username secret/duconet/basic-auth) \
--docker-password='$(shell vault kv get -field password secret/duconet/basic-auth)' \
--docker-email=$(shell vault kv get -field username secret/duconet/basic-auth)