TFC(Terraform Cloud) drift μλ¦Ό μ€μ
- kkumtree
2023-10-15T00:10:33+09:00
CloudNet@μμμ Terraform μ€ν°λκ° λλκ³ λμ, ν λΌνΌμ μ€μ μ΄μ μν©μ λμ νλ©΄μ λ§μ£Όν μ λ°μ μλ λ리ννΈ(drift) μν©μ λν΄ μ΄ν΄ν΄λ³΄λ μκ°μ κ°μ‘μ΅λλ€. μ°Έκ³ ) TFCμμμ Drift Detection κΈ°λ₯μ νμ¬ TFC Plus μλμ μμ μ§μλ©λλ€. 1. μ©μ΄ μ΄ν΄ν΄λ³΄κΈ° μ¬μ€μ μλ λΆν° ν λΌνΌμ μ νκ³ λμ, IaCλΌλ κ°λ μ κ½νκΈ°λ§ νμ§ μ΄μ μ μ₯μμ λ§μ£Όνμλ μλ§μ μνμ°©μ€λ€μ νν μ μ μλ¬λ‘λ§ μκ°ν΄μμμ΅λλ€. μ€ν°λμ μ°Έμ¬νλ©΄μ μ’ μ’ ‘λ리ννΈ’λΌλ λ¨μ΄λ₯Ό λ£κ³ , μ°Ύμ보λ μλΉλΆλΆμ΄ μ΄μ μνλ μν©μ΄λΌλ κ²μ μ μ μμμ΅λλ€. (1) Drift? κΈ μμ±μ μν΄ μ°Ύμλ³Έ κΈ°μ μ Driftλ λ³Έλ μ£Όνμ μμ΄μμ κ·Έκ²κ³Ό
Understanding terraform module
- kkumtree
2023-10-04T11:24:13+09:00
This week is last week of CloudNet@ group study about terraform. In this study, my personal goal is making AWS architecture only with terraform and one tfstate file. Basic knowledge about AWS resources is required. 1. Terraform without Module Before, I already met terraform for maintaining AWS in production level. But at that time, our team maintain them as folder structure which is used by terraformer # example structure $ tree .
IAM STSλ₯Ό μ΄μ©ν Terraform Cloud κΆν λΆμ¬
- kkumtree
2023-09-13T20:54:28+09:00
μ΄λ²μλ Terraform Cloudκ° μΌλ§λ μ’μμ§ λ μμ보기 μν΄, μ€ν°λμμ μ§μμ μΌλ‘ μ₯μ μ΄ κ°μ‘°λμ΄ μλ Terraform Cloudμ IAM STSλ₯Ό μ΄μ©ν κΆν λΆμ¬ λμ λ° μ μ© μ±κ³΅μ λν΄ μ¨λ³΄λ €κ³ ν©λλ€. Terraformμ μν μ μ₯μ μν΄ λ³΄ν΅ AWS S3λ₯Ό μ¬μ©νλλ°, μλ€μνΌ S3 κΈ°λ‘μ 무λ£μ§λ§, λΆλ¬μ€λ κ²μ μ λ£μ λλ€. (μ κΈ°λ κ΅μ°μ΄μ§λ§, μλ£λ μμ μ λλ€) κ·Έλμ μ€ν°λμ©μΌλ‘λ Terraformμ λΆλ¬μ¬ λλ§λ€, μν κ°μ S3λ§κ³ , λ‘컬μ μ μ₯νμλλ°μ. λ°μμλ λ ΈνΈλΆ, μ§μμλ λ°μ€ν¬νμΌλ‘ νλ €λ μ΄κ±Έ GitHubμ Private Repoμ μ μ₯ν κΉ? νλ€κ° Terraform Cloudλ₯Ό μ¨λ³΄κΈ°λ‘ νμ΅λλ€.
AWS EKS μ€ν°λ 7μ£Όμ°¨ - Automation
- kkumtree
2023-06-10T15:13:19+09:00
EKS μ€ν°λλ λ§μ§λ§ 7μ£Όμ°¨λ₯Ό λ§μ΄νμ΅λλ€. μ΄λ²μλ AWS Controller for k8s(ACK)μ fluxλ₯Ό κ°λ³κ² μ€μ΅ν΄λ³΄κ³ μλνμ λν΄ λ§λ³΄κΈ°λ₯Ό ν΄λ³΄μμ΅λλ€. μμ νμ΅ν΄λ³Έ IRSA κ°λ μΈμλ CRD(CustomResourceDefinition)μ νμ©ν©λλ€. 1. μ€μ΅νκ²½ λ°°ν¬ μ€μ΅μ μν YAMLνμΌμ΄ λ³κ²½λκ±° λ§κ³ λ 6μ£Όμ°¨μ μ μ¬ν©λλ€. curl -O https://s3.ap-northeast-2.amazonaws.com/cloudformation.cloudneta.net/K8S/eks-oneclick6.yaml # μ΄ν μ€λ΅ # CERT_ARN(ACM)μ κ²½μ°μλ /etc/profileμ νκ²½λ³μ μ μ₯μ μν΄λ¬μ # μΈμ μ΄ λ§λ£λλ©΄, λ€μ μ¬μ€μ νμ CERT_ARN=`aws acm list-certificates --query 'CertificateSummaryList[].CertificateArn[]' --output text` echo $CERT_ARN 2. ACK(AWS Controller for k8s) μΉμ½μμ μ κ·Όνμ§ μκ³ λ, AWS μλΉμ€ 리μμ€λ₯Ό μ§μ k8sμμ μ μ λ° μ¬μ©κ°λ₯ μμ: ACK 컨νΈλ‘€λ¬ μ€μΉ -> IRSA μ€μ -> AWS 리μμ€ μ»¨νΈλ‘€ κ°μ ν¨ν΄μΌλ‘ μ΄λ£¨μ΄μ Έμλλ°, Cloudformationμ μ°λ€λ³΄λ μ€κ°μ€κ° λκΈ° μκ° λ°μ (23/05/29) GA: 17κ° μλΉμ€, Preview: 10κ° μλΉμ€ 2-1.
AWS EKS μ€ν°λ 6μ£Όμ°¨ - Security
- kkumtree
2023-06-04T06:56:52+09:00
μ΄λ²μλ 보μμ μν μΈμ¦ λ° μΈκ°, κ·Έλ¦¬κ³ IRSAλ₯Ό μ€μ¬μΌλ‘ EKSμ 보μμ λν΄ νμ΅ν΄λ³΄μμ΅λλ€. kops μ€ν°λ λμλ μ λͺ°λλλ°, RBAC λΏλ§ μλλΌ λ³΅κΈ°νλ€λ³΄λ… [4-1] projected Volume [4-2] AWS Load Balancer Controller IRSA λ° LB Pod mutating μμ λ κ°μ§κ° μ€μν ννΈλ₯Ό μ°¨μ§νκ³ μμμμ μ μ μμμ΅λλ€. Network(2μ£Όμ°¨)κ° λ§€λ² λκ° μΌλΆκ° μ리μ‘νμλ€λ©΄ Securityλ 볡기νλ€κ° μ΄λ‘ μ μΌλ‘λ κ°λ¨(κ³Όμ°?)ν΄λ³΄μ¬λ μ€μ ꡬλλ°©μ μ΄ν΄ μμ²΄κ° μ΄λ°μ μλμ, μ¬ν λ¨μ§ κ±Έλ¦° λμ λ μ΄λ €μ λ κ² κ°μ΅λλ€. κ·Έ μΈ myeks-bastion-2μ μ μ μ, ν¨κ» μ§νν λλ ssh {Public IP}λ‘ μ μ μλλ κ±Έ λ΄€λλ° μ μ νΌμ ν λ μ μμ΄ λμ§μμμ΅λλ€.