2022-12-28 10:20:33 +00:00
|
|
|
MANDATORY-kustomize = K8S_CONTEXT KUSTOMIZE_FOLDER NAMESPACE
|
2022-11-03 08:48:22 +00:00
|
|
|
# kustomize
|
|
|
|
#
|
|
|
|
# this uses kustomize to install stuff on k8s
|
|
|
|
|
|
|
|
start-kustomize:
|
|
|
|
@- echo "\n### starting deployment with kustomize"
|
|
|
|
@- echo "\n### setting kubernetes context to $(K8S_CONTEXT)"
|
2022-12-21 10:09:20 +00:00
|
|
|
@ kubectl config use-context $(K8S_CONTEXT)
|
2022-11-03 08:48:22 +00:00
|
|
|
|
|
|
|
@- echo "\n### editing kustomizations"
|
|
|
|
|
|
|
|
ifdef KUSTOMIZE_EDIT_NAMESPACE
|
|
|
|
@- echo "\n### setting namespace to $(K8S_NAMESPACE)"
|
2022-12-21 10:09:20 +00:00
|
|
|
@ cd $(KUSTOMIZE_FOLDER) && kustomize edit set namespace $(K8S_NAMESPACE)
|
2022-11-03 08:48:22 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# actual deployment is happening here
|
|
|
|
@- echo "\n### applying kustomizations"
|
2023-01-24 13:00:47 +00:00
|
|
|
@ cd $(KUSTOMIZE_FOLDER) && kustomize build . | envsubst | kubectl apply -n $(NAMESPACE) -f -
|
2022-11-03 08:48:22 +00:00
|
|
|
|
|
|
|
pull-kustomize:
|
|
|
|
# nop
|
|
|
|
|
|
|
|
#TODO: implement annotation
|
|
|
|
# ifeq ($KUSTOMIZE_EDIT),annotation)
|
|
|
|
# @- $(kustomize edit set annotation .....)
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#TODO: implement buildmetadata
|
|
|
|
# ifeq ($KUSTOMIZE_EDIT),buildmetadata)
|
|
|
|
# @- $(kustomize edit set buildmetadata .....)
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#TODO: implement image
|
|
|
|
# ifeq ($KUSTOMIZE_EDIT),image)
|
|
|
|
# @- $(kustomize edit set image .....)
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#TODO: implement label
|
|
|
|
# ifeq ($KUSTOMIZE_EDIT),label)
|
|
|
|
# @- $(kustomize edit set label .....)
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#TODO: implement nameprefix
|
|
|
|
# ifeq ($KUSTOMIZE_EDIT),nameprefix)
|
|
|
|
# @- $(kustomize edit set nameprefix .....)
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#TODO: implement namesuffix
|
|
|
|
# ifeq ($KUSTOMIZE_EDIT),namesuffix)
|
|
|
|
# @- $(kustomize edit set namesuffix .....)
|
|
|
|
# endif
|
|
|
|
|
|
|
|
#TODO: implement replicas
|
|
|
|
# ifeq ($KUSTOMIZE_EDIT),replicas)
|
|
|
|
# @- $(kustomize edit set replicas .....)
|
2022-12-13 14:29:36 +00:00
|
|
|
# endif
|