3.2-healthcheck-readiness

command
v0.0.0-...-e665a74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 21 Imported by: 0

README

Healthcheck Readiness

  1. Slides service healthcheck

  2. Open directory

cd /root/automation-technology/chapter03-deploy-scale-services/3.2-healthcheck-readiness
  1. Register for https://hub.docker.com

  2. Create public repository call [your-docker-repository-name]/automation-technology

  3. Make sure you are logged in with your docker account

docker login
username:
password:
  1. Update file deploy.sh change
DOCKER_REPOSITORY=
to
DOCKER_REPOSITORY=[your-docker-repository-name]
  1. Run command (deploy.sh will be the file used to build your project, especially when it integrate with ci/cd)
./deploy.sh
  1. Run command
cd k8s
  1. Run command to start databases
kubectl apply -f 00-databases/.

Wait until redis is 1/1 Running

  1. Run command
kubectl get po -n healthcheck
NAME                     READY   STATUS    RESTARTS   AGE
redis-577d58dd6c-c6595   1/1     Running   0          3m55s
  1. Run command to start application
kubectl apply -f 01-application/.
  1. Run command to make sure all services is Running
kubectl get po -n healthcheck
register-api-758f494ccd-7xqmx   1/1     Running   0          109s
register-api-758f494ccd-gbtdg   1/1     Running   0          109s
  1. Run command
curl -X POST "http://kubernetes.docker.internal/citizen"
{"status":"success"}
  1. Run command
watch "microk8s kubectl get po -n healthcheck"
  1. Open other terminal and Run command to kill redis
cd /root/automation-technology/chapter03-deploy-scale-services/3.2-healthcheck-readiness/k8s/00-databases
kubectl delete -f 01-redis.yml
  1. Wait to see service healthcheck fail Notice RESTARTS will increase

  2. Run command to get redis back

kubectl apply -f 01-redis.yml
  1. Wait to see service come back

  2. Explain healthcheck endpoint in sourcecode

  3. Run command

kubectl delete ns healthcheck

Documentation

Overview

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL