wearearima / skaffold-tutorial

Skaffold demo using petclinic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Skaffold demo using petclinic


Languages

Language:Java 73.7%Language:HTML 13.6%Language:CSS 7.5%Language:TSQL 4.7%Language:Dockerfile 0.5%