Programming/IaC

[IaC] GKE configuration

Hayley Shim 2023. 10. 28. 17:46

안녕하세요, [gcp] GKE Implementation & CLI Configuration 를 참고해 terraform으로 GKE를 구성한 내용을 정리한 글입니다.

사전작업

  • API 활성화 : Compute Engine API, Kubernetes Engine API 활성화
  • Cloud APIs : Cloud APIs are exposed as network API services to customers, such as Cloud Pub/Sub API. Each Cloud API typically runs on one or more subdomains of googleapis.com, such as pubsub.googleapis.com, and provides both JSON HTTP and gRPC interfaces to clients over public internet and Virtual Private Cloud (VPC) networks. Clients can send HTTP and gRPC requests to Cloud API endpoints directly or by using client libraries.

GKE 설정

 
  • service account : Service accounts are accounts that do not represent a human user. They provide a way to manage authentication and authorization when a human is not directly involved, such as when an application needs to access Google Cloud resources. Service accounts are managed by IAM.
  • default service accounts : When you enable or use some Google Cloud services, they create user-managed service accounts that enable the service to deploy jobs that access other Google Cloud resources. These accounts are known as default service accounts
  • hashicorp : google_container_node_pool
 

자원 생성 확인

$ gcloud container clusters get-credentials [GKE Cluster name] --region [region] --project [Project ID]
Fetching cluster endpoint and auth data.
kubeconfig entry generated for my-gke-cluster.
  • “node-pools”의 정보를 조회합니다.
$ gcloud container node-pools list --cluster="[GKE Cluster name]" --project="[Project ID]" --region="[region]"NAME          MACHINE_TYPE  DISK_SIZE_GB  NODE_VERSION
my-node-pool  e2-medium     100           1.22.12-gke.2300$ kubectl get nodes
NAME                                            STATUS    AGE       VERSION
gke-my-gke-cluster-my-node-pool-20040ef3-z3f7   Ready     19m       v1.22.12-gke.2300
gke-my-gke-cluster-my-node-pool-9d9fb95e-lqbq   Ready     19m       v1.22.12-gke.2300
gke-my-gke-cluster-my-node-pool-e8d66354-sqj6   Ready     19m       v1.22.12-gke.2300

참고

 

blog migration project

written in 2022.10.22

https://medium.com/techblog-hayleyshim/iac-gke-configuration-348ccf8451c7

'Programming > IaC' 카테고리의 다른 글

[IaC] Terraform state -상태파일격리  (0) 2023.10.28
[IaC] Terraform state -상태파일공유  (0) 2023.10.28
[IaC] Terraform Syntax-GCP  (0) 2023.10.28
[IaC] Terraform Syntax-AWS  (1) 2023.10.28
Terraform  (0) 2023.10.28