Posts

Github actions workflow

Work flow with trigger events name : BETA - Deploy Timesheet XXX service to K8S cluster on : push : branches : - beta paths-ignore : - 'api/**' - 'deployment/XXX-api/**' - '.github/workflows/api-**' jobs : BATCH-deployment-pipeline : name : Run batch deployment pipeline with the beta env uses : ./.github/workflows/xxx-deployment-pipeline.yml with : env : beta module-name : xxx namespace : XXX-batch-beta service-name : XXX-batch chart-path : deployment/XXX-batch/chart cluster-url : https://vks.com/v1/qwrehdfagsfhgbx branch : ${{github.ref}} secrets : harbor-pass : ${{ secrets.HARBOR_PASS }} vks-sa-token : ${{ secrets.VKS_SA_TOKEN }} redis-pass : ${{ secrets.XXX_REDIS_PASS }}             mysql-pass : ${{ secrets.XXX_MYSQL_PASS }}   ...

Check logs when happening errors in the process of creating container

  kubectl -n timesheet-batch-beta describe pod timesheet-batch-deployment-86db85f8cb-hkrlt

ERROR: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

  sudo chmod 666 /var/run/docker.sock Ref

Redis pubsub and reactive programming

 https://github.com/jonashackt/spring-reactive-redis-messaging

Assign pods to nodes

 https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/

How to understand Prometheus query

http_requests_total{environment="testing",method="GET"} = 1 http_requests_total{environment="development",method="GET"} = 2 http_requests_total{environment="staging",method="GET"} = 1 Nếu bạn muốn hiển thị 1 metric là tổng số request GET thì chỉ cần đơn giản thực hiện query sau sum (http_requests_total{method="GET"}) sum (http_requests_total{method="GET"}) without(environment) sum (http_requests_total{method="GET"}) by(method)

Check logs in docker container

watch -n 0 "docker logs mycontainer"