Skip to content

wearearima/skaffold-tutorial

This branch is up to date with master.

Folders and files

NameName
Last commit message
Last commit date
Jan 31, 2020
Feb 21, 2018
Jun 1, 2019
Mar 20, 2020
Oct 16, 2015
Mar 11, 2019
Jun 21, 2019
Apr 23, 2020
Apr 24, 2020
Jan 3, 2020
Apr 24, 2020
Jan 31, 2020
Jan 31, 2020
Apr 23, 2020
Apr 24, 2020
Apr 24, 2020
Apr 23, 2020
Apr 23, 2020

Repository files navigation

Skaffold tutorial

About this project

This project is cloned from Spring PetClinic and its purpose is to showcase how Skaffold works.

Requirements

  • skaffold CLI installed
  • Docker daemon installed
  • Kubernetes cluster access and kubectl set up to use it (minikube or docker-desktop will do)

Getting started

First, choose your building type. I've made examples for Dockerfile and Jib. There are others too, so go ahead and read more about them here if you are interested.


Dockerfile

To build the application using Dockerfile, first rename the corresponding Skaffold configuration to skaffold.yaml:

cp skaffold.yaml skaffold.yaml.old; cp skaffold.yaml.dockerfile skaffold.yaml

Jib

To build the application using Jib, first rename the corresponding Skaffold configuration to skaffold.yaml:

cp skaffold.yaml skaffold.yaml.old; cp skaffold.yaml.jib skaffold.yaml

Next, run skaffold dev and watch the application get built and deployed to Kubernetes. Once it's ready, the output will be automatically redirected to our terminal.

Note: If it's your first time building it, it may take a while, as Maven has to download all the dependencies. In my experience, it usually takes around 10-15 minutes.

To watch changes get deployed live, open another terminal and run this:

echo '<!-- -->' >> src/main/resources/templates/vets/vetList.html

You should be able to access the application at localhost:8080.

Documentation

You can access the official Skaffold documentation here.