Code Monkey home page Code Monkey logo

springboot-kubernetes-youtube-series's Introduction

springboot-kubernetes-youtube-series

Code for "SpringBoot + Kubernetes Tutorial" YouTube Series https://www.youtube.com/playlist?list=PLuNxlOYbv61h66_QlcjCEkVAj6RdeplJJ

NOTE: The original code that is explained in the YouTube video series is available in the youtube-video-version branch. The code in the main branch is updated to use the latest versions of the dependencies.

How to run?

$ git clone https://github.com/sivaprasadreddy/springboot-kubernetes-youtube-series.git
$ cd springboot-kubernetes-youtube-series
$ ./run.sh start
$ ./run.sh stop

$ ./run.sh start_infra
$ ./run.sh stop_infra
  • To start only dependent services
$ ./run.sh start_infra
$ ./run.sh stop_infra

Running on Kubernetes

$ cd springboot-kubernetes-youtube-series
$ cd kind
$ ./create-cluster.sh
$ cd ../
$ kubectl apply -f k8s/

Kubernetes Useful commands

Pods

kubectl get pods
kubectl get all
kubectl run bookmarker-api --image=sivaprasadreddy/bookmarker-api --restart=Never --port=8080 --labels=env=dev,version=1.0
kubectl get all
kubectl describe pods bookmarker-api
kubectl delete pods bookmarker-api

kubectl run bookmarker-api --image=sivaprasadreddy/bookmarker-api --restart=Never --port=8080 --labels=env=dev,version=1.0 --dry-run=client -o yaml > pod.yaml
kubectl apply -f pod.yaml
kubectl logs bookmarker-api -f
kubectl exec -it bookmarker-api -- /bin/sh
kubectl delete -f pod.yaml

kubectl get ns
kubectl create ns dev
kubectl run bookmarker-api --image=sivaprasadreddy/bookmarker-api --restart=Never --port=8080 -n dev -o yaml --dry-run=client > pod.yaml

kubectl get pods -n dev
kubectl delete ns dev

Deployments

kubectl create deployment bookmarker-api-deploy --image=sivaprasadreddy/bookmarker-api
kubectl create deployment bookmarker-api-deploy --image=sivaprasadreddy/bookmarker-api --dry-run=client -o yaml > deployment.yaml
kubectl describe deployments.apps/bookmarker-api-deploy
kubectl rollout history deployments bookmarker-api-deploy
kubectl scale deployment bookmarker-api-deploy --replicas=3

kubectl set image deployment bookmarker-api-deploy bookmarker-api=sivaprasadreddy/bookmarker-api:1.1
kubectl rollout status deployment bookmarker-api-deploy

kubectl rollout undo deployment bookmarker-api-deploy --to-revision=1

ConfigMaps & Secrets

kubectl create configmap db-config --from-literal=db_host=postgres --from-literal=db_name=appdb
kubectl create configmap db-config --from-env-file=config.env
kubectl create configmap db-config --from-file=config.txt
kubectl create configmap db-config --from-file=app-config
kubectl describe configmaps db-config
kubectl get configmaps db-config -o yaml

kubectl create secret generic db-creds --from-literal=pwd=s3cret
kubectl create secret generic db-creds --from-env-file=secret.env
kubectl create secret generic ssh-key --from-file=id_rsa=~/.ssh/id_rsa
echo -n 's3cret!' | base64
kubectl get secret db-creds

Services

  • ClusterIP: Exposes the Service on a cluster-internal IP. Only reachable from within the cluster.
  • NodePort: Exposes the Service on each node's IP address at a static port. Accessible from outside of the cluster.
  • LoadBalancer: Exposes the Service externally using a cloud provider's load balancer.
  • ExternalName: Maps a Service to a DNS name.
kubectl expose deployment bookmarker-api-deploy --port=8080 --target-port=8080 --type=NodePort

springboot-kubernetes-youtube-series's People

Contributors

rajadilipkolli avatar renovate[bot] avatar sivaprasadreddy avatar

Stargazers

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

Watchers

 avatar  avatar

springboot-kubernetes-youtube-series's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose-app.yml
docker-compose.yml
  • postgres 16-alpine
dockerfile
bookmarker-api/Dockerfile
  • eclipse-temurin 17.0.11_9-jre-focal
bookmarker-api/Dockerfile.layered
  • eclipse-temurin 17.0.11_9-jre-focal
  • eclipse-temurin 17.0.11_9-jre-focal
bookmarker-ui-nextjs/Dockerfile
  • node 20-alpine
  • node 20-alpine
  • node 20-alpine
github-actions
.github/workflows/build-api.yml
  • actions/checkout v4
  • actions/setup-java v4
.github/workflows/build-ui.yml
  • actions/checkout v4
  • actions/setup-node v4
maven
bookmarker-api/pom.xml
  • org.springframework.boot:spring-boot-starter-parent 3.3.1
  • org.zalando:problem-spring-web-starter 0.29.1
  • com.google.cloud.tools:jib-maven-plugin 3.4.3
maven-wrapper
bookmarker-api/.mvn/wrapper/maven-wrapper.properties
  • maven 3.9.8
npm
bookmarker-ui-nextjs/package.json
  • axios ^1.0.0
  • bootstrap ^5.2.0
  • next ^14.2.4
  • react ^18.3.1
  • react-dom ^18.3.1
  • @testing-library/jest-dom ^6.1.4
  • @testing-library/react ^14.1.2
  • @types/node 20.14.7
  • @types/react 18.3.3
  • @types/react-dom 18.3.0
  • eslint 9.5.0
  • eslint-config-next ^14.2.4
  • jest ^29.7.0
  • jest-environment-jsdom ^29.7.0
  • typescript 4.9.5

  • Check this box to trigger a request for Renovate to run again on this repository

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.