3 minutes read featured in kotlin weekly issue #170
This is a follow up blog post of my earlier post Continuous Delivery to Kubernetes with jib, skaffold and ktor. The sample source code repository remains the same: https://github.com/lotharschulz/ktorjib.
Use Case
The main use case also remains the same:
Whenever source code changes, skaffold applies the changes to the Kubernetes cluster almost instantly.
Why a follow up post?
I prepared a talk and there a updates available for some technologies used:
- Kotlin 1.3.50
- Ktor 1.2.5
- Jib 1.6.1 (jib gradle plugin)
- Java 12 – By default, Jib uses distroless/java as the base image. (source)
- Skaffold v0.39.0
Update considerations
Kotlin
Updating Kotlin was rather easy: just define the kotlin version in the gradle build script.
Java & Jib
Update to Java 12, in more detail to
java.sourceCompatibility = JavaVersion.VERSION_12
Changing the java version as above requires a Java12 Jib Gradle plugin base image :
from { image = "openjdk:12" }
The Jib default base image contains OpenJDK 8 (gcr.io/distroless/java:8) or 11 (gcr.io/distroless/java:11) and its dependencies out of the box, so Java 11 support would not require a specific base image as shown above. Based on jib#2015 that is listed in the upcoming version changelog I assume Jib Java 13/14 support is eventually coming,
Skaffold & Jib
The skaffold binary update caused a _skaffoldFailIfJibOutOfDate issue. Updating jib resolved that issue.
Ktor & Netty
After I updated the ktor version, I experienced a NativeLibraryLoader error similar to ktor#1203. I followed this workaround and created a logback descriptor to suppress the error message.
Screen cast
skaffold dev
in the left pane – skaffold watching for code changes and applying those./web.sh
in the upper right pane – the script checks the service endpoint for code changes becoming effective. The script assumes kubernetes runs on (minikube)[link auf zeile ip=$(minikube ip) ] and the web kubernetes service is already deployed.- changing code in the lower right pane
screen cast Auto Deploy Kotlin Applications to Kubernetes w/o Dockerfiles
Skaffold is now GA