@@ -15,8 +15,18 @@ CONTAINER_SOURCES := $(shell find var/container)
1515HELM_SOURCES := $(shell find var/helm)
1616HELM_TARGET := dist/mrmat-python-api-fastapi-$(VERSION ) .tgz
1717
18- # Can be either 'sidecar' or 'ambient'
19- ISTIO := ambient
18+ # My cluster names default to the hostname they run on
19+ CLUSTER_NAME := $(shell hostname -s)
20+ # Can be either 'istio-sidecar' or 'istio-ambient'
21+ MESH := istio-ambient
22+ # Can be 'ingress', 'gateway-api' or 'istio'
23+ EDGE := gateway-api
24+
25+ # How the container then connects to its datastore
26+ API_DB_URL ="sqlite:////data/db.sqlite3"
27+
28+ # All of this can be overridden by the include in ~/etc/api-secrets.mk
29+ -include ~/etc/secrets.mk
2030
2131all : python container helm
2232python : $(PYTHON_TARGET )
@@ -27,32 +37,37 @@ $(PYTHON_TARGET): $(PYTHON_SOURCES)
2737
2838$(HELM_TARGET ) : $(HELM_SOURCES ) container
2939 helm package \
30- --app-version " $( VERSION) " \
3140 --version $(VERSION ) \
41+ --app-version " $( VERSION) " \
3242 --destination dist/ \
3343 var/helm
44+ helm push dist/mrmat-python-api-fastapi-$(VERSION ) .tgz oci://localhost:5001/charts
3445
35- container : $(PYTHON_TARGET ) $(CONTAINER_SOURCES )
46+ container : $(CONTAINER_SOURCES ) $(PYTHON_TARGET )
3647 docker build \
3748 -f var/container/Dockerfile \
3849 -t localhost:5001/mrmat-python-api-fastapi:$(VERSION ) \
50+ --build-arg GIT_SHA=$(GIT_SHA ) \
3951 --build-arg MRMAT_VERSION=$(VERSION ) \
4052 --build-arg WHEEL=$(PYTHON_TARGET ) \
4153 $(ROOT_PATH )
4254 docker push localhost:5001/mrmat-python-api-fastapi:$(VERSION )
4355
4456helm-install : $(HELM_TARGET )
4557 kubectl create ns mpafastapi || true
46- if test " $( ISTIO ) " == " sidecar" ; then kubectl label --overwrite ns mpafastapi istio-injection=true; fi
47- if test " $( ISTIO ) " == " ambient" ; then kubectl label --overwrite ns mpafastapi istio.io/dataplane-mode=ambient; fi
58+ if test " $( MESH ) " == " istio- sidecar" ; then kubectl label --overwrite ns mpafastapi istio-injection=true; fi
59+ if test " $( MESH ) " == " istio- ambient" ; then kubectl label --overwrite ns mpafastapi istio.io/dataplane-mode=ambient; fi
4860 helm upgrade \
4961 mrmat-python-api-fastapi \
5062 ${HELM_TARGET} \
5163 --install \
5264 --wait \
5365 --force \
5466 --namespace mpafastapi \
55- --set istio=$(ISTIO )
67+ --set cluster.name=$(CLUSTER_NAME ) \
68+ --set cluster.mesh=$(MESH ) \
69+ --set edge.kind=$(EDGE ) \
70+ --set config.db_url=$(API_DB_URL )
5671
5772helm-uninstall :
5873 helm delete -n mpafastapi mrmat-python-api-fastapi
0 commit comments