본문 바로가기

Terraform42

[AWS EKS] CoreDNS Addon을 FARGATE로 띄우기 (w. Terraform) # 0. 서론eks의 모든 노드들을 카펜터로 띄우기 시작했다.카펜터가 아닌 노드가 없기 때문에 karpenter 자체는 fargate로 띄워야만 했다.여기까지는 managed node group > karpenter로 마이그레이션하다가 알게 된 것이고.. 카펜터만 띄우는 설정으로 새로 클러스터를 띄우다보니 coredns가 karpenter보다 먼저 떠야 한다는 것을 알게 되었다.(카펜터도 내부 dns에 의존하는 무언가가 있나보다. 더 자세히 알아보진 않았다.) 따라서 karpenter와 마찬가지로 coredns도 fargate로 띄우도록 설정을 변경하게 되었다.이 때 필요한 과정을 terraform으로 설명하겠다. # 1. coredns fargate profile 생성loc.. 2024. 4. 28.
[AD/AWS Directory Service/Terraform] Admin User 비밀번호 만료 우선 내 환경은 AWS Directory Service - Microsoft AD 를 사용해 AD를 구축해둔 상태이다. 해당 AD를 컨트롤하기 위해 Controller 서버도 띄워두었고, User를 쉽게 만들기 위해 Terraform 에서 ldap Provider를 사용해 붙고 있었다. 그런데 어느 날, Error: error binding: LDAP Result Code 49 "Invalid Credentials": 80090308: LdapErr: DSID-0C090569, comment: AcceptSecurityContext error, data 532, v4563 라는 에러가 뜨면서 plan이 실패했다. Controller 서버에 RDP 접속도 안되었다. 근데 이 때 나온 에러는 비밀번호가 만료.. 2024. 3. 21.
[Terraform Associate (003)] 2024-02-17 합격 후기 https://www.credly.com/badges/797fde64-28d6-4dd8-b59d-2ff7a1ab2309/public_url HashiCorp Certified: Terraform Associate (003) was issued by HashiCorp to Sumin Hong.Earners of the HashiCorp Certified: Terraform Associate certification know the basic concepts, skills, and use cases associated with open source HashiCorp Terraform. They understand and can utilize Terraform according to the certificat.. 2024. 2. 18.
[EKS/Terraform] Secondary IP 줄이기 with Terraform # 현상 18개 파드가 존재하는 10.10.0.218 노드가 있다. 그러나 해당 노드엔 2개 eni / eni포함 총 60개의 ip가 붙어있다.... 다른 노드들도 사용하는 파드들에 비해 상당히 많은 ip들을 갖고 있었고, 이로 인해 서브넷에 가용 ip가 부족해졌다. # 분석 https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI Elastic network interfaces - Amazon Elastic Compute Cloud For EC2 instances in an IPv6-only subnet, if you attach a secondary network interface to the instanc.. 2024. 2. 6.
[Terraform] AD User 만들기 # 사용한 프로바이더 https://registry.terraform.io/providers/l-with/ldap/latest/docs Terraform Registry registry.terraform.io terraform { required_providers { ldap = { source = "l-with/ldap" version = ">= 0.4" } } } locals { ad_server_ip = "1.1.1.1" ad_domain = "honglab.com" ad_admin_pw = "" } provider "ldap" { host = local.ad_server_ip port = 389 tls = false bind_user = "Admin@${local.ds_domain}" bind_p.. 2024. 1. 31.
[Cluster-Autoscaler] Over Provisioning with Terraform # 현상 node의 cpu / memory가 거의 대부분 점유되고 있는 상황에서도 node가 늘어나지 않고 있다. 내가 생각했을 때 CA를 사용하면 노드 리소스가 80% 이상 사용 중일 때 새로 노드 추가 ~ 뭐 이런식으로 진행될 줄 알았는데, 그게 아니었다. 노드가 새로 추가되는건 노드에 자리가 없어서 배치되지 못하는 pod가 존재할 때 … 이다. 사실 쿠버네티스 사용 목적 등을 생각하면 그게 맞다. 하지만 파드가 하나 새로 떠야되는데 그 때서야 노드 프로비저닝을 시작한다? → 느리다. → 어느정도의 over provisioning이 필요하다. # Over Provisioning https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscal.. 2023. 11. 26.
HashiConf 2023 Recap - Terraform 부분 정리 # HashiConf 2023 Recap (23.11.15) 중 Terraform 부분에 대해서만 정리함 terraform test 라는 명령이 생겼다고 한다. Preview 기능들 사용자 정의 함수?! 이건 진짜 너무너무 유용할 것 같다. 그리고 stage에 대한 관리를 지금까지 configuration code 기반이 아닌 cli 명령 기반으로 진행하고 있었는데, import, mv 블럭이 나온 것처럼 rm 블럭도 나와서 state 관리를 코드 기반으로 할 수 있게 된 것 같다. 의존성 관리가 되는 인프라 집합인 stack이란 개념도 나왔다고 한다. cloudformation이 생각난다... Stacks 지금까지 terraform plan/apply 시 될때도 있고 안될때도 있는데 (??) 그것때문에.. 2023. 11. 15.
[ArgoCD] repo-server PVC 붙이기 (w. Terraform) # argocd repo-server 란? https://argo-cd.readthedocs.io/en/stable/operator-manual/server-commands/argocd-repo-server/ Argocd repo server - Argo CD - Declarative GitOps CD for Kubernetes Argocd repo server argocd-repo-server Run ArgoCD Repository Server Synopsis ArgoCD Repository Server is an internal service which maintains a local cache of the Git repository holding the application manifests, an.. 2023. 11. 3.
[Keycloak 21/Terraform] AWS SAML 로그인 연동하기 # provider 설정 2023.10.29 - [공부/IaC] - [Terraform] Keycloak Provider 구성하기 (Keycloak 21) # 로컬 변수 설정 locals { keycloak_url = "" # keycloak 주소 keycloak_realm = "" # aws용 keycloak realm 이름 } # [keycloak] aws client 생성 resource "keycloak_saml_client" "aws" { realm_id = local.keycloak_realm client_id = "urn:amazon:webservices" idp_initiated_sso_url_name = "amazon-aws" assertion_consumer_post_url = "htt.. 2023. 10. 29.
[Terraform] Keycloak Provider 구성하기 (Keycloak 21) # 공식 문서 https://registry.terraform.io/providers/mrparkers/keycloak/latest/docs#client-credentials-grant-setup-recommended Terraform Registry registry.terraform.io 여기에 어느정도 설명은 나와있으나, 21버전/사진 과 함께 설명해본다. # Terraform용 Client 생성 키클락 내 모든 권한을 갖도록 만들 것이다. -> master realm에서 client를 만들어야 한다. Client ID만 필수로 정해주자 > 하단의 Next Capability Config도 수정해주자 Client authentication : ON Standard flow : OFF Direct ac.. 2023. 10. 29.