arun9theja / External-DNS-Setup-Kubernetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

External-DNS-Setup-Kubernetes

Pre-Requisites

- EKS-Cluster Setup
- Application Load Balancer

EKS-Cluster Setup:

EKS Cluster Setup

ALB-Ingress-Controller Setup:

ALB Ingress Controller

External DNS Setup

Create policy for External-DNS using below JSON content:

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

image

Create Iam Role and attach Policy and service account:

 eksctl create iamserviceaccount \
    --name external-dns \
    --region us-east-1 \
    --namespace default \
    --cluster eksdemo \
    --attach-policy-arn arn:aws:iam::136962450893:policy/external-DNS \
    --approve \
    --override-existing-serviceaccounts

Verify the Service Account:

kubectl get sa external-dns

image

Search eks-addonrole in IAM and check if that role has external-DNS access policy. 
if so choose and update the same in external-dns.yml file
(arn:aws:iam::136962450893:role/eksctl-eksdemo-addon-iamserviceaccount-defau-Role1-XXXX)

Open Deploy-ExternalDNS.yml file replce external-dns role arn:

annotations: eks.amazonaws.com/role-arn: arn:aws:iam::136962450893:role/eksctl-eksdemo-addon-iamserviceaccount-defau-Role1-13NJMLQ2DIXII

Deploy External-dns yaml file

kubectl get sa external-dns
kubectl apply -f external-dns.yml

image image

REmove record A in Route53 and refresh:

image

Now delete ingress1.yml and apply ,

image

image

image

About