This project will show you how to setup kubernetes cluster by kubeadm , deploy spring boot micro service, and how to debug your code
See Setup Kubernetes By Kubeadm
- create cluster role
kubectl create clusterrolebinding admin --clusterrole=cluster-admin --serviceaccount=default:default
- Init mongodb
kubectl apply -f kubernetes/mongodb
- build projects
mvn clean install
- build docker images
bash build.sh
- push docker images
bash push.sh
Please skip this step if you run locally - deploy to cluster
kubectl apply -f kubernetes/projects
- deploy ingress
kubectl apply -f kubernetes/ingress.yaml
- configure host
runkubectl cluster-info
to getcluster_ip
add host to/etc/hosts
with:<cluster_ip> micro.info
-
Init Data:
curl -d '{"id":1,"id":1,"name":"company name","address":"company address"}' -H 'Content-Type:application/json' shawn.info/organization/
curl -d '{"organizationId":1,"id":1,"name":"department name"}' -H 'Content-Type:application/json' shawn.info/department/
curl -d '{"organizationId":1,"departmentId":1,"id":1,"name":"employee"}' -H 'Content-Type:application/json' shawn.info/employee/
. -
check result:
curl micro.info/employee/1
.curl micro.info/department/1
.curl micro.info/department/organization/1/with-employees
OS X
brew cask install osxfuse
brew install datawire/blackbird/telepresence
Ubuntu 16.04 or later
curl -s https://packagecloud.io/install/repositories/datawireio/telepresence/script.deb.sh | sudo bash
sudo apt install --no-install-recommends telepresence
for other OS, See More
- generate env.json
telepresence --swap-deployment <service in k8s> --env-json service.env.json
- load env in IDEA
you will need to install the Env File plugin. load theservice.env.json
generated above - debug your code as usual
Refer To: Using Telepresence with IntelliJ
Click Here to check the samples
Click Here