It's easier than you might think!
We will use this service as an example
Run it and check
curl localhost:8080/status
FROM adoptopenjdk/openjdk14
EXPOSE 8080
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} cloud.jar
ENTRYPOINT ["java","-jar","/cloud.jar"]
git clone https://github.com/JavaAsASecondLanguage/JavaAsASecondLanguage.git
cd cloud
Build project with gradle
./gradlew clean assemble
Build image. Note that gcr.io/made2020/ inside tag indicates that image will be pushed to project’s image repository
docker build . --tag gcr.io/made2020/cloud-sample:1.0
Push image to local repository
docker push gcr.io/made2020/cloud-sample:1.0
https://console.cloud.google.com/kubernetes/workload?cloudshell=true&project=made2020
workloads
https://console.cloud.google.com/kubernetes/workload?cloudshell=true&project=made2020
services and Ingress