diff --git a/deployment/Justfile b/deployment/Justfile index aae63a660b..0ce16e52e6 100755 --- a/deployment/Justfile +++ b/deployment/Justfile @@ -5,7 +5,6 @@ registry_full := "k3d-ftl-registry.localhost:5000" registry_short := "ftl-registry.localhost" registry_full_nolocal := "k3d-ftl-registry:5000" registry_local := "localhost:5000" -git_tag_hash := `git rev-parse --short HEAD` mirrors := ''' mirrors: @@ -21,7 +20,7 @@ rm: teardown full-deploy: just build-controller just build-runner - just deploy + just apply kubectl wait --for=condition=available deployment/ftl-controller --timeout=5m kubectl wait --for=condition=available deployment/ftl-runner --timeout=5m kubectl wait --for=condition=ready pod/ftl-pg-cluster-1-0 --timeout=5m @@ -46,7 +45,7 @@ teardown-cluster: teardown: teardown-cluster teardown-registry -deploy: +apply: kubectl kustomize --load-restrictor=LoadRestrictionsNone overlays/dev | kubectl apply -f - delete: @@ -83,7 +82,29 @@ build-controller: build-runner: cd .. && docker build --platform linux/amd64 -t ftl-runner:latest -f Dockerfile.runner . - docker tag ftl0/ftl-runner:latest {{registry_local}}/ftl-runner:latest + docker tag ftl-runner:latest {{registry_local}}/ftl-runner:latest docker push {{registry_local}}/ftl-runner:latest build: build-controller build-runner + +deploy path: + #!/usr/bin/env bash + set -euxo pipefail + rm -f ftl.tar.gz + COPYFILE_DISABLE=1 tar -cf ftl.tar -C .. . + export POD=$(kubectl get pods -l app=ftl-controller --no-headers | tail -1 | awk '{print $1}') + kubectl exec -it ${POD} -- apt install -y golang + kubectl exec -it ${POD} -- rm -rf /tmp/ftl/ + kubectl exec -it ${POD} -- mkdir -p /tmp/ftl/ + kubectl cp ftl.tar ${POD}:/tmp/ftl/ftl.tar + kubectl exec -it ${POD} -- tar --warning=no-unknown-keyword -tf /tmp/ftl/ftl.tar + kubectl exec -it ${POD} -- tar -xf /tmp/ftl/ftl.tar -C /tmp/ftl/ + kubectl exec -it ${POD} -- bash -c "cd /tmp/ftl && FTL_ENDPOINT=http://ftl-controller:8892 /root/ftl deploy {{path}}" + rm -f ftl.tar.gz + +ftl *args: + #!/usr/bin/env bash + set -euxo pipefail + export POD=$(kubectl get pods -l app=ftl-controller --no-headers | tail -1 | awk '{print $1}') + kubectl exec -it ${POD} -- bash -c "FTL_ENDPOINT=http://ftl-controller:8892 /root/ftl {{args}}" + diff --git a/deployment/base/db-create/kustomization.yml b/deployment/base/db-create/kustomization.yml index 85b1e81fae..4a8d4b04a8 100644 --- a/deployment/base/db-create/kustomization.yml +++ b/deployment/base/db-create/kustomization.yml @@ -1,5 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - https://raw.githubusercontent.com/reactive-tech/kubegres/v1.18/kubegres.yaml - pg-cluster.yaml diff --git a/deployment/base/kustomization.yml b/deployment/base/kustomization.yml index 06c258e6f1..7bf9934dd7 100644 --- a/deployment/base/kustomization.yml +++ b/deployment/base/kustomization.yml @@ -1,6 +1,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: +- https://raw.githubusercontent.com/reactive-tech/kubegres/v1.18/kubegres.yaml - db-create - db-migrate - ftl-controller