Skip to content

This repository is a simple demo which deployment spring-boot application on kubernetes cluster.

Notifications You must be signed in to change notification settings

SalemNabeelSalem/spring-boot-application-deployed-on-kubernetes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-application-deployed-on-kubernetes

This is a simple demo which deployment spring-boot application on kubernetes cluster.

Deployment Steps From CLI:

  • Start the k8s cluster.

  • minikube start
  • Create our first pod.

    kubectl create deployment k8s-demo --image=isalemnabeel/k8s-demo
    kubectl get pods
    kubectl get deployments
    kubectl describe pod k8s-demo
  • Lunch k8s dashboard.

    minikube dashboard
  • Lunch k8s tunnel.

    minikube tunnel
  • Expose Deployment.

    kubectl expose deployment k8s-demo-deployment --name=k8s-demo-service --port=9409 --target-port=9409 --type=LoadBalancer
  • Open your browser:

    http://localhost:9409/lucky-day


Deployment Steps From Yaml File [k8s-demo-deployment.yaml]:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: k8s-demo-deployment
  labels:
    app: k8s-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: k8s-demo
  template:
    metadata:
      labels:
        app: k8s-demo
    spec:
      containers:
      - name: k8s-demo
        image: isalemnabeel/k8s-demo
        ports:
        - containerPort: 9409
kubectl apply -f k8s-demo-deployment.yaml
  • Lunch k8s dashboard.

    minikube dashboard
  • Lunch k8s tunnel.

    minikube tunnel
  • Expose Deployment.

    kubectl expose deployment k8s-demo-deployment --name=k8s-demo-service --port=9409 --target-port=9409 --type=LoadBalancer
  • Open your browser:

    http://localhost:9409/lucky-day

About

This repository is a simple demo which deployment spring-boot application on kubernetes cluster.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published