Posts

Showing posts from August, 2021

Rank in MySql

sql_query = ( "WITH latest AS (" " SELECT rev.*," " RANK() OVER (PARTITION BY rev.product_api_id " " ORDER BY published_at DESC" " ) rank_published_at" " FROM product_api_setting_revisions rev" " WHERE product_api_id IN :product_api_ids" " AND status != 'draft'" ")" "SELECT * FROM latest WHERE rank_published_at = 1;" )

How to scale pod in Kubernetes

 https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics

set command in bash programming

 https://www.tutorialdocs.com/article/set-command-in-bash.html

The difference between ReplicaSet and ReplicaController Deployment, Service, Pod

1. Pod là thành phần đơn giản nhất: Nó như là 1 unit mà sẽ khởi chạy container Trong 1 pod có thể chạy nhiều containers và share chung 1 network apiVersion : batch/v1 kind : Job metadata : name : hello spec : template : # This is the pod template spec : containers : - name : hello image : busybox command : [ 'sh' , '-c' , 'echo "Hello, Kubernetes!" && sleep 3600' ] restartPolicy : OnFailure # The pod template ends here 2. Tiếp theo để 1 pod chạy trên 1 port có thể giao tiếp với các pod khác trong 1 cluster thì cần phải expose nó như 1 service -> Service ra đời để mapping port của Pod ra port service mà các Pod khác có thể connect được với nhau apiVersion : v1 kind : Service metadata : name : my-service spec : selector : app : MyApp ports : - protocol : TCP port : 80 targetPort : 9376 3. Vậy để quản lý việc nhân bản Pod khi scale...

byte, int, rune in Golang

byte <=> uint8  rune <=> int32