Skip to content

Commit

Permalink
fix: kubernetes builds native deploy (#2136)
Browse files Browse the repository at this point in the history
  • Loading branch information
gak authored Jul 24, 2024
1 parent d736bdc commit 7483d86
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
29 changes: 25 additions & 4 deletions deployment/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -46,7 +45,7 @@ teardown-cluster:

teardown: teardown-cluster teardown-registry

deploy:
apply:
kubectl kustomize --load-restrictor=LoadRestrictionsNone overlays/dev | kubectl apply -f -

delete:
Expand Down Expand Up @@ -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}}"
1 change: 0 additions & 1 deletion deployment/base/db-create/kustomization.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions deployment/base/kustomization.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7483d86

Please sign in to comment.