๐Ÿ“—
smiley book
  • Smiley Books
  • AI
    • Readme
    • openai-whisper
      • ์ƒ˜ํ”Œ ์‹คํ–‰ํ•ด๋ณด๊ธฐ
      • GPU ์„œ๋ฒ„ ์ค€๋น„ํ•˜๊ธฐ
      • API๋กœ whisper๋ฅผ ์™ธ๋ถ€์— ์˜คํ”ˆํ•˜๊ธฐ
      • ํ”„๋กฌํ”„ํŠธ ์ง€์›
      • ์‹ค์‹œ๊ฐ„ message chat
      • ํ™”๋ฉด ์ด์˜๊ฒŒ ๋งŒ๋“ค๊ธฐ์™€ ๋กœ๊ทธ์ธ
      • ํŒŒ์ด์ฌ ๊ฐ€์ƒํ™˜๊ฒฝ
      • ์‹ค์‹œ๊ฐ„ voice chat
      • fine tunning(๋ฏธ์„ธ ์กฐ์ •) ์œผ๋กœ ์„ฑ๋Šฅ ์˜ฌ๋ฆฌ๊ธฐ
      • app์—์„œ api๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ์‹ค์‹œ๊ฐ„์œผ๋กœ ํ…์ŠคํŠธ๋กœ ๋ฐ”๊ฟ”๋ณด๊ธฐ
    • ollama - llm์„ ์‰ฝ๊ฒŒ ๋‚ด์ปด์—์„œ ์‹คํ–‰
      • ollama webui
      • ollama docker
    • stable diffusion
      • SDXL - text to image
      • SD-webui
    • ChatGPT
      • ๋‹ต๋ณ€์ด ๋Š๊ธธ๋•Œ
      • ์—ญํ• ์„ ์ •ํ•˜์ž
      • ๊ตฌ์ฒด์ ์ธ ์งˆ๋ฌธ
      • ๊ฒฐ๊ณผํ˜•ํƒœ๋ฅผ ์ง€์ •
      • ํ”„๋กฌํ”„ํŠธ๋ฅผ ์—ฌ๋Ÿฌ์ค„๋กœ ์‚ฌ์šฉํ•˜์ž.
      • ๋งˆํ‹ด ํŒŒ์šธ๋Ÿฌ ๊ธ€ ๋ฒˆ์—ญ๋ณธ
    • Prompt Engineering
    • Auto-GPT
    • Gemini
      • google ai studio
      • gemini-api
      • embedding guide
    • Huggingface
      • huggingface ์‚ฌ์šฉ๋ฒ•
      • huggingface nlp ๊ณต๋ถ€์ค‘
    • kaggle
      • download dataset
    • langchain
      • langchain์„ ๊ณต๋ถ€ํ•˜๋ฉฐ ์ •๋ฆฌ
      • basic
      • slackbot
      • rag
      • document-loader
      • website-loader
      • confluence
      • memory
      • function-call
      • langsmith
      • agent-toolkit
  • Ansible
    • templates vs files and jinja2
    • dynamic inventory
    • limit ์˜ต์…˜ ๊ฐ•์ œํ•˜๊ธฐ
    • limit ์‚ฌ์šฉํ›„ gather_fact ๋ฌธ์ œ
  • AWS
    • AWS CLI
    • EKS
      • cluster manage
      • ALB Controller
      • external-dns
      • fargate
    • ECR
    • S3
    • Certificate Manager
  • Azure
    • Azure AD OAuth Client Flow
  • Container
    • Registry
    • ๋นŒ๋“œ์‹œ์— env๊ฐ’ ์„ค์ •ํ•˜๊ธฐ
  • DB
    • PXC
      • Operator
      • PMM
      • ์‚ญ์ œ
      • GTID
      • Cross Site Replication
    • Mssql
    • Mysql
  • dotnet
    • Thread Pool
    • Connection Pool
    • Thread Pool2
  • Devops
    • Recommendation
  • GIT
    • Basic
    • Submodule
  • GitHub
    • Repository
    • GitHub Action
    • GitHub PR
    • Self Hosted Runner
    • GitHub Webhook
  • GitLab
    • CI/CD
    • CI/CD Advance
    • Ssl renew
    • CI/CD Pass env to other job
  • Go Lang
    • ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๊ตฌ์ถ•
    • multi os binary build
    • kubectl๊ฐ™์€ cli๋งŒ๋“ค๊ธฐ
    • azure ad cli
    • embed static file
    • go study
      • pointer
      • module and package
      • string
      • struct
      • goroutine
  • Kubernetes
    • Kubernetes๋Š” ๋ฌด์—‡์ธ๊ฐ€
    • Tools
    • Install with kubespray
    • Kubernetes hardening guidance
    • 11 ways not to get hacked
    • ArgoCD
      • Install
      • CLI
      • Repository
      • Apps
      • AWS ALB ์‚ฌ์šฉ
      • Notification slack
      • Backup / DR
      • Ingress
      • 2021-11-16 Github error
      • Server Config
      • auth0 ์ธ์ฆ ์ถ”๊ฐ€(oauth,OIDC)
    • Extension
      • Longhorn pvc
      • External dns
      • Ingress nginx
      • Cert Manager
      • Kube prometheus
    • Helm
      • Subchart
      • Tip
    • Loki
    • Persistent Volume
    • TIP
      • Job
      • Pod
      • Log
  • KAFKA
    • raft
  • KVM
    • kvm cpu model
  • Linux
    • DNS Bind9
      • Cert-Manager
      • Certbot
      • Dynamic Update
      • Log
    • Export and variable
    • Grep ์‚ฌ์šฉ๋ฒ•
  • Modeling
    • C4 model introduce
    • Mermaid
    • reference
  • Monitoring
    • Readme
    • 0. What is Monitoring
    • 1. install prometheus and grafana
    • 2. grafana provisioning
    • 3. grafana dashboard
    • 4. grafana portable dashboard
    • 5. prometheus ui
    • 6. prometheus oauth2
    • Prometheus
      • Metric type
      • basic
      • rate vs irate
      • k8s-prometheus
    • Grafana
      • Expolorer
    • Node Exporter
      • advance
      • textfile collector
  • Motivation
    • 3 Simple Rule
  • OPENNEBULA
    • Install(ansible)
    • Install
    • Tip
    • Windows vm
  • Reading
    • comfort zone
    • ๋ฐฐ๋ ค
    • elon musk 6 rule for insane productivity
    • Feynman Technique
    • how to interview - elon musk
    • ๊ฒฝ์ฒญ
    • Readme
  • Redis
    • Install
    • Master-slave Architecture
    • Sentinel
    • Redis Cluster
    • Client programming c#
  • SEO
    • Readme
  • Security
    • criminalip.io
      • criminalip.io
  • Stock
    • robinhood-python
  • Terraform
    • moved block
    • output
  • vault
    • Readme
  • VS Code
    • dev container
    • dev container on remote server
  • Old fashione trend
    • curity
    • MAAS
      • Install maas
      • Manage maas
      • Tip
Powered by GitBook
On this page
  • create policy
  • Create IAM Role, k8s Service Account & Associate IAM Policy
  • install external-dns
  • issue

Was this helpful?

  1. AWS
  2. EKS

external-dns

ingress์— ๋งŒ๋“ค์–ด๋‘” hostname์„ ์ž๋™์œผ๋กœ route53์— ์ถ”๊ฐ€ํ•ด์ค€๋‹ค.

namespace๋Š” default๋กœ ๊ฐ€์ •ํ•˜๊ณ  ์ง„ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค๋ฅธ๊ณณ์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ์„ค์ •ํ•ด์ฃผ์‹œ๋ฉด๋ฉ๋‹ˆ๋‹ค.

create policy

AllowExternalDNSUpdates
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["route53:ChangeResourceRecordSets"],
      "Resource": ["arn:aws:route53:::hostedzone/*"]
    },
    {
      "Effect": "Allow",
      "Action": ["route53:ListHostedZones", "route53:ListResourceRecordSets"],
      "Resource": ["*"]
    }
  ]
}

Create IAM Role, k8s Service Account & Associate IAM Policy

k8s Service Account named external-dns

# ํ™•์ธ
eksctl get iamserviceaccount --cluster cluster01

# Template
eksctl create iamserviceaccount \
    --name service_account_name \
    --namespace service_account_namespace \
    --cluster cluster_name \
    --attach-policy-arn IAM_policy_ARN \
    --approve

# Replaced name, namespace, cluster, arn
eksctl create iamserviceaccount \
--name external-dns \
--namespace default \
--cluster cluster01 \
--attach-policy-arn arn:aws:iam::530310009353:policy/AllowExternalDNSUpdates \
--approve

# ํ™•์ธ
eksctl get iamserviceaccount --cluster cluster01

kubectl get sa
# anotation์— ๋‚ด์šฉ์ด ์ž˜ ๋“ค์–ด๊ฐ“๋Š”์ง€๊ฐ€ ์ค‘์š”ํ•จ.

install external-dns

wget https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.0.0/docs/examples/external-dns.yaml

ServiceAccount ๋ถ€๋ถ„์€ ์ง€์šฐ๊ณ  (๋ฒŒ์จ ๋งŒ๋“ค์—‡๊ธฐ๋•Œ๋ฌธ)

- --domain-filter=external-dns-test.my-org.com #์ฃผ์„

- --txt-owner-id=my-identifier #์ฃผ์„

๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๋ชจ๋“  ๋„๋ฉ”์ธ์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ์ฃผ์„์ฒ˜๋ฆฌํ•˜๊ณ  ํŠน์ •ํ•œ๊ฑธ๋กœ ๋ฐ”๊พธ๋ ค๋ฉด ์œ„์ฒ˜๋Ÿผ ๋„๋ฉ”์ธ์„ ๋„ฃ์–ด์ค€๋‹ค.

my-identifier๋Š” route53์—์„œ hostid๋ฅผ ๊ฐ€์ ธ๋‹ค ๋„ฃ์œผ๋ฉด ๋œ๋‹ค.

๋‹ค ์ •๋ฆฌํ•˜๋ฉด

---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
  name: external-dns
rules:
  - apiGroups: ['']
    resources: ['services']
    verbs: ['get', 'watch', 'list']
  - apiGroups: ['']
    resources: ['pods']
    verbs: ['get', 'watch', 'list']
  - apiGroups: ['extensions']
    resources: ['ingresses']
    verbs: ['get', 'watch', 'list']
  - apiGroups: ['']
    resources: ['nodes']
    verbs: ['list']

---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: external-dns-viewer
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: external-dns
subjects:
  - kind: ServiceAccount
    name: external-dns
    namespace: default

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: external-dns
spec:
  selector:
    matchLabels:
      app: external-dns
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: external-dns
    spec:
      serviceAccountName: external-dns
      containers:
        - name: external-dns
          image: bitnami/external-dns:0.7.1
          args:
            - --source=service
            - --source=ingress
            - --provider=aws
            - --policy=upsert-only
            - --aws-zone-type=public
            - --registry=txt

์ ˆ๋Œ€ ๋ฒ„์ „์„ 0.7.1์—์„œ ๋ฐ”๊พธ์ง€ ๋ง์ž. ๋ฐ”๊พธ๋ ค๋ฉด ์—…๋ฐ์ดํŠธ๋œ ๋‚ด์šฉ์„ ํ™•์ธํ•ด์„œ policy๊ฐ€ ๋ฐ”๋€Œ์–ด์•ผํ•จ.

์ ์šฉ

kubectl apply -f external-dns.yaml

pod์˜ ๋กœ๊ทธ๋ฅผ ๋ณด์ž.

uptodate๊ฐ€ ๋œ๋‹ค. ์ด๋Ÿฌ๋ฉด ์„ฑ๊ณต

์ด์ œ ingress์—์„œ host name์„ ๋ณ€๊ฒฝํ•˜๋ฉด route53์— ์ƒ์„ฑ๋˜๋Š”๊ฒƒ์„ ๋ณผ์ˆ˜ ์žˆ๋‹ค.

policy๋Š” ๋”ฐ๋กœ ๋ณด๊ธฐ๋ฐ”๋žŒ. ๊ธฐ๋ณธ๊ฐ’์€ sync,

upsert๋Š” ์ƒˆ๋กœ์šด๊ฑด ๋„ฃ๊ณ  ๊ธฐ์กด๊ฑด ์—…๋ฐ์ดํŠธ delete๋Š” ์•ˆ๋จ.

issue

aws / idc์—์„œ ๋™์‹œ์— ์•„์ดํ”ผ๋ฅผ ์—…๋ฐ์ดํŠธํ•˜๋ฉด ์—๋Ÿฌ๊ฐ€ ๋œ๋‹ค.

์ธ๊ทธ๋ ˆ์Šค ๋ณ„๋กœ ์‚ฌ์šฉ์„ ๋ง‰์œผ๋ ค๊ณ  ํ•ด๋ดฃ๋Š”๋ฐ ์ž˜ ์•ˆ๋œ๋‹ค.

external-dns.alpha.kubernetes.io/exclude: 'true'

์ด๊ฑธ๋กœ ๊ฒ€์ƒ‰ํ•˜๋ฉด ๋‚˜์˜ค๋Š”๋ฐ ๋™์ž‘์ด ์•ˆ๋œ๋‹ค.

์•„์ดํ”ผ๋ฅผ ๋‘๊ฐœ๋ฅผ ๋„ฃ๋Š”๊ฒƒ๋„ ์ž˜ ์•ˆ๋œ๋‹ค. ํด๋ผ์šฐ๋“œ ํ”Œ๋ ˆ์–ด๋Š” 2๊ฐœ์˜ raw๋ฅผ ๋„ฃ์–ด ๋ผ์šด๋“œ๋กœ๋นˆ์„ ํ•จ.

ํŠน์ • ์•„์ดํ”ผ๋ฅผ ๋„ฃ์„๋ ค๊ณ  ํ•˜๋ฉด ์ธ๊ทธ๋ ˆ์Šค์— ๋‹ค์Œ์„ ์‚ฌ์šฉํ•œ๋‹ค.

external-dns.alpha.kubernetes.io/target: "204.16.116.99"
PreviousALB ControllerNextfargate

Last updated 1 year ago

Was this helpful?