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:
31
theia-extensions/k8s-app/build-all-and-deploy-to-k8s.sh
Executable file
31
theia-extensions/k8s-app/build-all-and-deploy-to-k8s.sh
Executable 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
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user