Skip to content

Commit

Permalink
chore: minor kube justfile changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Nov 4, 2024
1 parent 65a66c1 commit 9ca4bb6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
15 changes: 8 additions & 7 deletions deployment/Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ start: setup full-deploy

rm: teardown

full-deploy: build-controller build-runner build-provisioner setup-cluster
full-deploy: build-controller build-runner build-provisioner setup-istio-cluster
#!/bin/bash
kubectl rollout restart deployment ftl-controller || true # if this exists already restart it to get the latest image
just apply || sleep 5 # wait for CRDs to be created, the initial apply will usually fail
Expand All @@ -40,14 +40,15 @@ setup-registry:

setup-cluster: setup-registry
#!/bin/bash
bash -c "cd ../ && just chart dep-update"
if [ -z "$(k3d cluster list | grep ftl)" ]; then
k3d cluster create ftl --api-port 6550 -p "8892:80@loadbalancer" -p "8891:80@loadbalancer" -p "8893:80@loadbalancer" --agents 2 \
--registry-use {{registry_full}} \
--registry-config '{{mirrors}}'
fi
kubectl config set-context --current --namespace=default

install-istio: setup-cluster
setup-istio-cluster: setup-cluster
#!/bin/bash
if [ -z "$(kubectl get namespace | grep istio-system)" ]; then
kubectl create namespace istio-system
Expand All @@ -58,7 +59,7 @@ install-istio: setup-cluster
fi
kubectl label namespace default istio-injection=enabled --overwrite

setup: setup-registry setup-cluster
setup: setup-registry setup-istio-cluster

teardown-registry:
k3d registry delete {{registry_short}}
Expand All @@ -72,7 +73,7 @@ apply:
kubectl delete job --ignore-not-found=true ftl-dbmig-latest
helm upgrade --install ftl ../charts/ftl -f values.yaml

deploy-version version: setup-cluster install-istio
deploy-version version: setup-istio-cluster
helm repo add ftl https://tbd54566975.github.io/ftl-charts --force-update
helm upgrade --install ftl ftl/ftl --version={{version}} -f values-release.yaml || sleep 5 # wait for CRDs to be created, the initial apply will usually fail
helm upgrade --install ftl ftl/ftl --version={{version}} -f values-release.yaml
Expand Down Expand Up @@ -112,17 +113,17 @@ build-executables:
cd ../ && GOARCH=amd64 GOOS=linux CGO_ENABLED=0 just build ftl-controller ftl-runner ftl-initdb ftl ftl-provisioner ftl-provisioner-cloudformation
cp ../build/release/* ./docker-build/

build-controller: build-executables setup-registry setup-cluster
build-controller: build-executables setup-registry setup-istio-cluster
docker build --platform linux/amd64 -t ftl-controller:latest -f Dockerfile.controller.test .
docker tag ftl-controller:latest {{registry_local}}/ftl-controller:latest
docker push {{registry_local}}/ftl-controller:latest

build-runner: build-executables setup-registry setup-cluster
build-runner: build-executables setup-registry setup-istio-cluster
docker build --platform linux/amd64 -t ftl-runner:latest -f Dockerfile.runner.test .
docker tag ftl-runner:latest {{registry_local}}/ftl-runner:latest
docker push {{registry_local}}/ftl-runner:latest

build-provisioner: build-executables setup-registry setup-cluster
build-provisioner: build-executables setup-registry setup-istio-cluster
docker build --platform linux/amd64 -t ftl-provisioner:latest -f Dockerfile.provisioner.test .
docker tag ftl-provisioner:latest {{registry_local}}/ftl-provisioner:latest
docker push {{registry_local}}/ftl-provisioner:latest
Expand Down
6 changes: 1 addition & 5 deletions internal/integration/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,7 @@ func run(t *testing.T, actionsOrOptions ...ActionOrOption) {
if opts.kube {
// This command will build a linux/amd64 version of FTL and deploy it to the kube cluster
Infof("Building FTL and deploying to kube")
err = ftlexec.Command(ctx, log.Debug, rootDir, "just", "chart", "dep-update").RunBuffered(ctx)
assert.NoError(t, err)
err = ftlexec.Command(ctx, log.Debug, filepath.Join(rootDir, "deployment"), "just", "setup-cluster").RunBuffered(ctx)
assert.NoError(t, err)
err = ftlexec.Command(ctx, log.Debug, filepath.Join(rootDir, "deployment"), "just", "install-istio").RunBuffered(ctx)
err = ftlexec.Command(ctx, log.Debug, filepath.Join(rootDir, "deployment"), "just", "setup-istio-cluster").RunBuffered(ctx)
assert.NoError(t, err)

skipKubeFullDeploy := os.Getenv("SKIP_KUBE_FULL_DEPLOY") == "true"
Expand Down

0 comments on commit 9ca4bb6

Please sign in to comment.