I see guides like this where setting up an Nginx Ingress (with ssl) requires you enter the host, i.e. echo1.example.com
. I don't understand how you would be able to use the host specified if you didn't have the IP address (in your DNS, how would you know where to piont echo.example.com
?).
When I set up an ingress like this, echo.example.com
would show up as the ingress ADDRESS
, so I don't know the IP. If I don't specify it, the ADDRESS
is just empty. With this, how am I suppose to know what IP I'm suppose to point my domain name?
I'm running on GKE.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: echo-ingress
annotations:
kubernetes.io/ingress.class: nginx
certmanager.k8s.io/cluster-issuer: letsencrypt-staging
spec:
tls:
- hosts:
- echo1.example.com
- echo2.example.com
secretName: letsencrypt-staging
rules:
- host: echo1.example.com
http:
paths:
- backend:
serviceName: echo1
servicePort: 80
- host: echo2.example.com
http:
paths:
- backend:
serviceName: echo2
servicePort: 80
The IPs of your Kubernetes nodes should be considered ephemeral. Do not point hostnames at them for purposes of hosting websites and services.
You can not specify the IP Adress that's going to be assigned by GKE. The IP is assigned automatically from google's IP Block.
You have to create the Ingress Resource, wait till the IP is assigned and then add the IP to your DNS.
If you want to automatically create a proper DNS entry which is pointing to your Ingress IP you should have look into: https://github.com/kubernetes-incubator/external-dns