java -jar target/demo-0.0.1-SNAPSHOT.jar
docker build -t damogallagher/demo .
docker run -p 8080:8080 damogallagher/demo
docker login
docker push damogallagher/demo
Create kubernetes deployment and service yaml files
mkdir k8s
kubectl create deployment demo --image=damogallagher/demo --dry-run -o=yaml > k8s/deployment.yaml
echo --- >> k8s/deployment.yaml
kubectl create service clusterip demo --tcp=8080:8080 --dry-run -o=yaml >> k8s/deployment.yaml
cd k8s
kubectl apply -f .
Check service and deployment are running on kubernetes
Test locally using an SSH tunnel
kubectl port-forward svc/demo 8080:8080
Verify app is running on kubernetes
curl localhost:8080/actuator/health