Skip to content

Repository files navigation

Sample Spring Boot Docker Microservice

This repository contains a sample Spring Boot microservice that can be containerized using Docker and deployed to a Kubernetes cluster. The deployment process is automated using GitHub Actions workflows.

Prerequisites

Make sure you have the following tools installed before proceeding:

Getting Started

  1. Clone this repository:

    git clone git@github.com:mustafaguc/kube-app.git
  2. Navigate to the project directory:

    cd kube-app
  3. Build the Docker image:

    docker build -t my-kube-app .
  4. Run the Docker container locally:

    docker run -p 8080:8080 my-kube-app
  5. Open your web browser and navigate to http://localhost:8080 to confirm that the microservice is running.

  6. Make changes and push the code. Github Action will build app and push a docker image to your ghcr.io docker registry

Docker Image

The Docker image for this microservice is hosted on ghcr.io : my-kube-app

ghcr.io/{username}/{app-name}:latest

Github Registry and Secrets on Kubernetes Cluster

  • Add Github Docker Registry (ghcr.io) and create secrets on your Kubernetes Cluster
  • Configure Kubernetes context value in .github/workflows/gradle.yml according to your Kubernetes cluster context

Kubernetes Deployment

The Kubernetes deployment, service and ingress manifests are located in the kubernetes directory. Modify the project.yaml file with your specific configurations.

Deploy to Kubernetes Cluster

Whole process is performed by Github Action flow. No need to deploy the microservice manually. Add a KUBECONFIG repository secret that stores your kubernetes cluster configuration from repository-secret

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages