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
This tutorial demonstrates the following steps: Reserve a static external IP address for your application. Configure either Service or Ingress resources to use the static IP. Update DNS records of your domain name to point to your application.
When you use an ingress controller and ingress rules, a single IP address can be used to route traffic to multiple services in a Kubernetes cluster. This article shows you how to deploy the NGINX ingress controller in an Azure Kubernetes Service (AKS) cluster.
1. Overview on Kubernetes Ingress Kubernetes offers an ingress resource and controller that is designed to expose Kubernetes services to the outside world. It can do the following: Ingresses do not work like other Services in Kubernetes. Just creating the Ingress itself will do nothing. You need two additional components:
You can register a domain name through Google Domains or another domain registrar of your choice if you do not have one. Note: This tutorial uses the built-in GKE Ingress Controller and does not apply to the NGINX Ingress Controller. This tutorial demonstrates the following steps: Visit the Kubernetes Engine page in the Google Cloud Console.
Specify Local IP Address for Port Forwarding. Listen on port 8080 on the localhost using the defined IP, forward to port 5762 in the pod: kubectl port-forward --address localhost,10.153.40.102 pod/mongo-db-r3pl1ka3 8080:5762.
If you choose to expose your application using an Ingress , which creates an HTTP (S) Load Balancer, you must reserve a global static IP address . Regional IP addresses do not work with Ingress.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With