Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: minor kube justfile changes #3303

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 2 additions & 1 deletion frontend/cli/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ func bindAllocatorWithoutController() (*bind.BindAllocator, error) {
if err != nil {
return nil, fmt.Errorf("could not create bind allocator: %w", err)
}
// Skip initial port as it is reserved for the controller
// Skip initial ports as it is reserved for the controller and provisioner
_, _ = bindAllocator.Next() //nolint:errcheck
_, _ = bindAllocator.Next() //nolint:errcheck
return bindAllocator, nil
}
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
Loading