Git Product home page Git Product logo

kubernetes's Introduction

Context

This is a POC to demonstrate how we can package and deploy a spring boot 2 based application to k8s.

Project structure

The project consiste of the following :

  • Simple Spring boot 2 application, that expose a greeting endpoint.
  • Dockerfile manifest to build the image
  • deployment.yml manifest file for k8s resources definition (POD, SERVICE, PodDisruptionBudget)

Reference Documentation

For further reference, please consider the following sections:

Deploy the spring application to kubernetes - Steps :

  • Build the demo spring boot application - docker image

    mvn clean install
    docker build -t demo:0.1.0 .

  • Push the built docker image to your own docker repository

    docker images
    docker login
    docker push (your_repo_name)/demo-k8s:0.3.0

  • Install minikube in your computer using these instructions - https://kubernetes.io/docs/tasks/tools/install-minikube/
  • Start the minikube in your local machine

    minikube start

  • Create the deployment in kubernetes - it helps to pull the spring boot demo app docker images and deploy in K8S.

    kubectl create -f deployment.yml # your application will be deployed in kubernetes

  • View the container status

    kubectl get pods

  • To get the external Ip for accessing your application, please run

    kubectl get svc minikube tunnel

  • Access your deployed spring boot application in kubernetes

    curl (external-ip)/hello

  • To view the kubernetes setup

    minikube dashboard

kubernetes's People

Contributors

net-vinothkumar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kubernetes's Issues

expternal ip is pending after the k8s deployment

athya@ubuntu:/k8s/kubernetes$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
demo-service LoadBalancer 10.97.55.171 8081:30008/TCP 2m1s
kubernetes ClusterIP 10.96.0.1 443/TCP 19m
sathya@ubuntu:
/k8s/kubernetes$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
demo-service LoadBalancer 10.97.55.171 8081:30008/TCP 2m28s
kubernetes ClusterIP 10.96.0.1 443/TCP 19m
sathya@ubuntu:~/k8s/kubernetes$ kubectl get svc minikube tunnel
Error from server (NotFound): services "minikube" not found
Error from server (NotFound): services "tunnel" not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.