Read the article.
Read the article.
-
Login to your cloud provider account and download kubeconfig of your cluster.
-
Create a namespace -
kubectl create namespace app
-
Create a deployment -
kubectl apply -f templates/deployment.yaml
-
Create a service of type LoadBalancer -
kubectl apply -f templates/service.yaml
-
Get the LB service's external IP address using the command -
kubectl get services -n app
-
Interact with the bookstore application running in your Kubernetes cluster using REST APIs. Examples given below.
Create a Book : $ curl -vvv -X POST http://{{External-IP-Of-Service}}/books -H 'Content-Type: application/json' -d '{"title": "Start with Why","author": "Simon Sinek"}'
Get book details for book ID : $ curl -v http://{{External-IP-Of-Service}}/books/2
List all books : $ curl -vvv http://{{External-IP-Of-Service}}/books
Update a book's details by book ID : $ curl -vvv -X PATCH http://{{External-IP-Of-Service}}/books/2 -d '{"title":"Infinite Game"}'
Delete a book by book ID : $ curl -vvv -X DELETE http://{{External-IP-Of-Service}}/books/4