1. => tạo service account kubectl create serviceaccount deployer 2. => tạo binding giữa service accounts và role-admin kubectl create clusterrolebinding deployer-binding --clusterrole=cluster-admin \ --serviceaccount= default :deployer 3. => Tạo token với name deployer-secret và attach vào service account deployer kubectl apply -f - <<EOF apiVersion: v1 kind: Secret metadata: name: deployer-secret annotations: kubernetes.io/service-account.name: deployer type: kubernetes.io/ service-account-token EOF 4. => hiển thị danh sách tên các token đã được tạo ra kubectl get secrets 5. => view token value cho deployer đã tạo kubectl describe secret deployer-token-nmx8l https: //cloudhedge.io/setting-up-kubernetes-api-access-using-service-account/
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...