티스토리 뷰
안녕하세요, [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
- Node machine type : Each node is of a standard Compute Engine machine type. The default type is e2-medium. You can select a different machine type when you create a cluster.
자원 생성 확인
- gcloud CLI를 통해 credential 정보를 저장합니다.
- gcloud container clusters get-credentials
$ 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
- 실습 코드 : Github repo
참고
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 |
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- k8s calico
- S3
- gcp serverless
- 파이썬
- AWS
- GCP
- cni
- controltower
- 혼공단
- GKE
- IaC
- terraform
- AI
- autoscaling
- OS
- operator
- NFT
- SDWAN
- EKS
- handson
- k8s cni
- 혼공챌린지
- PYTHON
- 도서
- NW
- 혼공파
- security
- cloud
- VPN
- k8s
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함