diff --git a/theia-extensions/k8s-app/build-all-and-deploy-to-k8s.sh b/theia-extensions/k8s-app/build-all-and-deploy-to-k8s.sh new file mode 100755 index 000000000..ad10e575c --- /dev/null +++ b/theia-extensions/k8s-app/build-all-and-deploy-to-k8s.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -e + +# Create k8s cluster using 'kind' +kind create cluster +export KUBECONFIG="$(kind get kubeconfig-path --name="kind")" +kubectl cluster-info + +cd docker-boot-dev + +# Build the 'theia-spring-boot' package +./create-theia-boot-pkg.sh + +# Then build it into a docker image +docker build -t theia-spring-boot . + +# If using a 'kind' cluster, we must upload the image to the k8s cluster +kind load docker-image theia-spring-boot + +cd .. + +# Deploy to the cluster +./deploy_theia_k8s.sh + +# Expose the app on localhost +echo "Exposing theia-spring-boot deployment on http://localhost:3000" +until kubectl port-forward deployment/theia-spring-boot 3000:3000; do + echo "Problem forwarding port, still waiting for container to start?" + sleep 10 + echo "Retrying" +done \ No newline at end of file diff --git a/theia-extensions/k8s-app/deploy.yml b/theia-extensions/k8s-app/deploy.yml index 8845d6949..dda7fcc99 100644 --- a/theia-extensions/k8s-app/deploy.yml +++ b/theia-extensions/k8s-app/deploy.yml @@ -32,8 +32,8 @@ spec: fsGroup: 3000 containers: - name: theia-spring-boot - # image: theia-spring-boot - image: theia-spring-boot:java_ls_started + image: theia-spring-boot + # image: theia-spring-boot:java_ls_started # Image pull policy `Never` is needed to pull from local Docker Daemon imagePullPolicy: Never ports: