Skip to content

nine-docs/terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform 실행

1. 로컬에 Terraform 설치

2. Terraform 적용

2.1. terraform init

  • Terraform 프로젝트 루트에서 terraform init 명령 실행
    • 이 명령을 실행하면
      Terraform이 AWS Provider 플러그인을 다운로드한다.
  • 실행 확인
    $ ls -a
    ./   .terraform/          eks.tf      variables.tf
    ../  .terraform.lock.hcl  outputs.tf  vpc.tf
  • .terraform 등이 생성된 것 확인

2.2. terraform plan

  • Terrform 프로젝트 root 에서 terraform plan 명령 실행

2.3. AWS에 자원 생성

terraform apply -auto-approve

2.4. 생성된 EKS 클러스터와 kubectl 연결

  • 기본적으로 kubectl get nodes 같은 명령을 실행해보면 실행이 되지 않음.

  • 다음 명령을 실행하고 다시해보면 잘 될것임

    aws eks update-kubeconfig --region **ap-northeast-2** --name **ninedocs-eks-cluster**
    • 이 명령을 실행하면 ~/.kube/config 파일이 EKS 클러스터에 맞게 설정된다.
  • 설정 확인

    kubectl config view
  • kubectl 확인

    $ kubectl get nodes
    NAME                                               STATUS   ROLES    AGE    VERSION
    ip-192-168-0-51.ap-northeast-2.compute.internal    Ready    <none>   9m1s   v1.31.4-eks-aeac579
    ip-192-168-1-249.ap-northeast-2.compute.internal   Ready    <none>   9m5s   v1.31.4-eks-aeac579
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages