I am using minikube and have created a simple nginx pod with one LoadBalancer service which is working fine. I have tried curl <my_minikube_ip>:Port and it shows me correctly
Welcome to nginx! body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; }My problem starts when I m making externalName service for this pod with externalName lets say abc.com. When I curl abc.com I believe it divert me to real abc.com
my pod yaml:
kind: Pod
apiVersion: v1
metadata:
name: myapp
labels:
app: myapp
spec:
containers:
- name: myapp
image: nginx
ports:- containerPort: 80
imagePullPolicy: IfNotPresent
- containerPort: 80
my LoadBalancer Service YAML
apiVersion: v1
kind: Service
metadata:
labels:
app: myapp
name: my-svc-lb
spec:
ports:
- port: 9000
targetPort: 80
selector:
app: myapp
type: LoadBalancer
my externalName service yaml
apiVersion: v1
kind: Service
metadata:
name: my-svc-externalname
spec:
ports:
- port: 8200
targetPort: 80
protocol: TCP
type: ExternalName
externalName: abc.com
nslookup my-svc-externalname.default.svc.cluster.local
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can’t find my-svc-externalname.default.svc.cluster.local: SERVFAIL
Can anyone help explain me what I am doing wrong and how to resolve this issue so that this externalName divert curl request to nginx pod