A command line tool that facilitates continuous development for Kubernetes applications.
Jib?
Maven and Gradle plugins to build container images for your Java applications.
- Change source files
- Rebuild the project
- Build a Docker container locally
- You need Dockerfile
- You need Docker installed locally
- Run the container locally
- Push the built container to a remote container registry
- Deploy the container to the dev Kubernetes cluster
- Set up port forwarding
- Access
http://localhost:<port>
- Change source files
- Rebuild the project. These steps are now gone:
Build a Docker container locallyYou need DockerfileYou need Docker installed locally
Run the container locallyPush the built container to a remote container registry
- Deploy the built container to the dev Kubernetes cluster
- Set up port forwarding
- Access
http://localhost:<port>
- Setting up Jib for Gradle:
plugins {
id 'io.spring.dependency-management' version '1.0.6.RELEASE'
id 'com.github.johnrengelman.shadow' version '4.0.0'
+ id 'com.google.cloud.tools.jib' version '0.10.0'
}
- Setting up Jib for Maven:
<plugins>
+ <plugin>
+ <groupId>com.google.cloud.tools</groupId>
+ <artifactId>jib-maven-plugin</artifactId>
+ <version>0.10.0</version>
+ </plugin>
</plugins>
- Change source files
- Access
http://localhost:<port>
No need to use kubectl
.
- Setting up Skaffold for the whole project:
apiVersion: skaffold/v1beta1
kind: Config
build:
artifacts:
- image: gcr.io/chanseok-playground-new/java-frontend
jibMaven: {}
context: java-frontend
- image: gcr.io/chanseok-playground-new/groovy-backend
jibGradle: {}
context: groovy-backend
- image: gcr.io/chanseok-playground-new/nodejs-backend
context: nodejs-backend
sync:
'*.js': .
Mono repo with 3 microservices written in different languages and frameworks.
Returns "Greetings from Node.js!"
Uses Dockerfile.
nodejs-backend/
├── Dockerfile
├── index.js
└── package.json
Returns "Greetings from Groovy!"
Uses Micronaut framework + Gradle + Jib.
groovy-backend/
├── build.gradle
└── src/main/
└── groovy/backend/
├── Application.groovy
└── WebController.groovy
Accesses the two backends.
Uses Spark web framework + Maven + Jib.
java-frontend/
├── pom.xml
└── src/main
├── java/frontend/Frontend.java
└── resources/static/index.html
The usual YAML files you will have for Kubernetes deployement:
k8s/
├── nodejs-backend.yaml
├── groovy-backend.yaml
└── java-frontend.yaml
skaffold.yaml