- Install Git
- Install Maven
- Install Docker
- EKS Cluster
git clone https://github.com/VamsiTechTuts/kubernetes.git
cd kubernetes/spring-boot-postgresql/
mvn clean install -DskipTests=true
docker build -t vamsitechtuts/springbootpostgresrestapidemo .
docker login
docker push vamsitechtuts/springbootpostgresrestapidemo
echo -n "postgresadmin" | base64
echo -n "admin123" | base64
kubectl apply -f postgres-secrets.yml
kubectl apply -f postgres-storage.yaml
kubectl apply -f postgres-deployment.yaml
kubectl apply -f postgres-service.yaml
kubectl create configmap hostname-config --from-literal=postgres_host=$(kubectl get svc postgres -o jsonpath="{.spec.clusterIP}")
kubectl apply -f springboot-deployment.yml
kubectl apply -f springboot-service.yml
kubectl get secrets
kubectl get configmaps
kubectl get pv
kubectl get pvc
kubectl get deploy
kubectl get pods
kubectl get svc
Now Goto Loadbalancer and check whether service comes Inservice or not, If it comes Inservice copy DNS Name of Loadbalancer and Give in POSTMAN App
http://a64d28d4626484b2687437bb81935d71-65005852.us-west-2.elb.amazonaws.com:8080/questions
select raw and Json format with in the Body section
{
"title": "Which country you belongs too?",
"description": "I am from India..."
}
http://a64d28d4626484b2687437bb81935d71-65005852.us-west-2.elb.amazonaws.com:8080/questions
http://:8080/questions/{questionId}/answers
http://a64d28d4626484b2687437bb81935d71-65005852.us-west-2.elb.amazonaws.com:8080/questions/1000/answers
select raw and Json format with in the Body section
{
"text": "I am an Indian"
}
http://a64d28d4626484b2687437bb81935d71-65005852.us-west-2.elb.amazonaws.com:8080/questions/1000/answers
You can Test other API also.........
kubectl delete deploy spring-boot-postgres-sample postgres
kubectl delete svc spring-boot-postgres-sample postgres
kubectl delete pvc postgres-pv-claim
kubectl delete pv postgres-pv-volume
kubectl delete secrets postgres-secrets
kubectl delete configmaps hostname-config