-
Export your namespace env
export MY_NAMESPACE=sn-labs-$USERNAME
-
Build the guestbook app
docker build . -t us.icr.io/$MY_NAMESPACE/guestbook:v1
-
Push the image to IBM Cloud Container Registry
docker push us.icr.io/$MY_NAMESPACE/guestbook:v1
-
Verify that the image was pushed successfully.
ibmcloud cr images
-
Apply the deployment
kubectl apply -f deployment.yml
-
Open a new terminal and view your app
kubectl port-forward deployment.apps/guestbook 3000:3000
-
Autoscale the Guestbook deployment
kubectl autoscale deployment guestbook --cpu-percent=5 --min=1 --max=10
-
Check the current status
kubectl get hpa guestbook
-
Open another new terminal and enter the below command to generate load on the app to observe the autoscaling
kubectl run -i --tty load-generator --rm --image=busybox:1.35.0 --restart=Never -- /bin/sh -c "while sleep 0.01; do wget -q -O- ; done"
-
Observe the repicas increasing
kubectl get hpa guestbook --watch
-
Observe the details of the HPA
kubectl get hpa guestbook
-
Notifications
You must be signed in to change notification settings - Fork 0
License
amirn003/ibm-guestbook
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published