I created a service in k8s cluster which is on aws cloud
apiVersion: v1
kind: Service
metadata:
name: widget-svc
labels:
app: widget-test
spec:
type: LoadBalancer
ports:
- port: 3000
nodePort: 30003
protocol: TCP
selector:
app: widget-test
My deployment.yml:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: widget-deploy
spec:
replicas: 10
template:
metadata:
labels:
app: widget-test
spec:
containers:
- name: widget-pod
image: xxxxx/xxx:xxx
ports:
- containerPort: 3000
I can access the service through loadbalancer endpoint on port 3000 but when i create a dns name for the loadbalancer in route 53, I can't access service through DNS name.
The configured CNAME a301877583cad11e8b74b0ab1dd411bf-51616161.us-east-2.elb.amazonaws.com
does not exist:
$ dig widgetdock.yupl.us
; <<>> DiG 9.10.6 <<>> widgetdock.yupl.us
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 42278
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;widgetdock.yupl.us. IN A
;; ANSWER SECTION:
widgetdock.yupl.us. 300 IN CNAME a301877583cad11e8b74b0ab1dd411bf-51616161.us-east-2.elb.amazonaws.com.
;; AUTHORITY SECTION:
us-east-2.elb.amazonaws.com. 60 IN SOA ns-1076.awsdns-06.org. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 60
;; Query time: 73 msec
;; SERVER: 172.31.254.1#53(172.31.254.1)
;; WHEN: Thu Apr 26 15:22:30 CEST 2018
;; MSG SIZE rcvd: 212
See the status: NXDOMAIN
which means this domain does not exist.
I solved this, the issue is with the security group rules for the load balancer. after allowing security group rules, it's working fine