Add a script that does everything needed to ...

- create a k8s cluster using 'kind'
- build theia-spring-boot
- build docker image with theia-spring-boot
- deploy it to the cluster
- expose the deployed theia app on localhost port
This commit is contained in:
Kris De Volder
2019-07-09 15:25:19 -07:00
parent f42b6763bc
commit a1b47b7366
2 changed files with 33 additions and 2 deletions

View File

@@ -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

View File

@@ -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: