Code for "SpringBoot + Kubernetes Tutorial" YouTube Series
Code for "SpringBoot + Kubernetes Tutorial" YouTube Series https://www.youtube.com/playlist?list=PLuNxlOYbv61h66_QlcjCEkVAj6RdeplJJ
NOTE: The original code explained in the YouTube video series is available in the
youtube-video-version
branch. The code in themain
branch is updated to use the latest versions of the dependencies.
$ 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
$ ./run.sh start_infra
$ ./run.sh stop_infra
$ cd springboot-kubernetes-youtube-series
$ cd kind
$ ./create-cluster.sh
$ cd ../
$ kubectl apply -f k8s/
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
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
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
kubectl expose deployment bookmarker-api-deploy --port=8080 --target-port=8080 --type=NodePort