mamachanko / carvel-demo

A simple Spring Boot application that gets packaged for k8s with the Carvel toolsuite

Home Page:https://hub.docker.com/repository/docker/mamachanko/carvel-demo-bundle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Carvel demo

A simple Spring Boot application that gets packaged for k8s with the Carvel toolsuite

Installation

Assuming you have a local k8s cluster with an Ingress Controller configured, deploy and test with:

impkg pull --bundle mamachanko/carvel-demo-bundle --output carvel-demo

ytt `# render the template` \
  --file "carvel-demo/k8s.yml" \
  --file "carvel-demo/values.yml" \
  | kbld `# resolve the image references` \
    --file - \
    --file "carvel-demo/.imgpkg/images.yml" \
    | kapp deploy `# apply to cluster`\
      --diff-changes \
      --app "carvel-demo" \
      --file -

curl -iv localhost

Check values.yml for configuration options.

The pipeline

Inputs

  1. tag to build with (defaults to gitCommit)
  2. promotion tag (defaults to latest)

Outputs

Steps

  1. Build and push
    • builds and pushes the docker image with tag by using kbld
    • pushes a bundle with tag containing k8s manifests and a reference to the docker image with imgpkg
  2. Consume
    • pulls the bundle with tag by using imgpkg
  3. Test
    • renders the k8s manifests with ytt
    • resolve the image to the one reference in .imgpk/images.yaml with kbld
    • deploys with kapp
    • tests the deployment
  4. Promote
    • pushes the bundle with tag latest
    • *-dirty tags cannot be promoted

Try for yourself

./pipeline.sh [tag=$gitCommit] [promotionTag=latest]

Uses gitCommit as a default tag strategy.

For example:

# Git commit is abcdef and workspace is clean
./pipeline.sh
# same as
./pipeline.sh abcdef latest

# Git commit is abcdef and workspace is dirty
./pipeline.sh
# same as
./pipeline.sh abcdef-dirty latest

# Go wild
./pipeline.sh this-is-a-just-test omg-version-1

About

A simple Spring Boot application that gets packaged for k8s with the Carvel toolsuite

https://hub.docker.com/repository/docker/mamachanko/carvel-demo-bundle

License:MIT License


Languages

Language:Shell 89.8%Language:Java 10.2%