.. _ingress: Ingress ------- By now you should have created a :ref:`deployment` that creates 1 or more pods and grouped by a :ref:`service` to a single IP address. An `ingress `_ exposes the **service** to the outside world. In addition, it provides routing by DNS names. You may have many pods that accept calls on HTTPS port 443. An ingress checks the URL that was used to get to the cluster. The ingress uses the URL to route the request to the appropriate server. Typically, an AWS load balancer is pointing to a target group that contains all worker nodes. A DNS entry is created that would route traffic to our domain, for example: ** *.dev.sandbox.simoncomputing.com**. All traffic would be routed to the worker nodes, where an **ingress controller** will determine which service to route traffic to based on the complete URL address. Here is an example YAML file describing an ingress:: apiVersion: extensions/v1beta1 kind: Ingress metadata: name: tomcat-ing-dev spec: rules: - host: tomcat.dev.sandbox.simoncomputing.com http: paths: - path: / backend: serviceName: tomcat-svc-dev servicePort: 8080 tls: - hosts: - dev.sandbox.simoncomputing.com Here is an example of creating a deployment, service and ingress: .. code-block:: python from k9.helper import ( set_default_namespace, create_namespace, create_secret, ) # create namespace set_default_namespace("ingress-unit-test") create_namespace() # create secret secret_name = "tomcat-dev" secrets = { 'url': 'https://some/url', 'password': 'My1SecretPassword', 'username': 'postgres' } create_secret(secret_name, secrets) # create deployment body = read_yaml('tomcat-deploy-dev.yml') create_deployment(body) # create service body = read_yaml('tomcat-svc-dev.yml') create_service(body) # create ingress body = read_yaml('../test/tomcat-ing-dev.yml') create_ingress(body) .. autofunction:: k9.exts.list_ingress .. autofunction:: k9.exts.ingress_exists .. autofunction:: k9.exts.get_ingress .. autofunction:: k9.exts.create_ingress .. autofunction:: k9.exts.delete_ingress