github.com/nginxinc/kubernetes-ingress@v1.12.5/examples/complete-example/README.md (about)

     1  # Example
     2  
     3  In this example we deploy the NGINX or NGINX Plus Ingress controller, a simple web application and then configure load balancing for that application using the Ingress resource.
     4  
     5  ## Running the Example
     6  
     7  ## 1. Deploy the Ingress Controller
     8  
     9  1. Follow the [installation](https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/) instructions to deploy the Ingress controller.
    10  
    11  2. Save the public IP address of the Ingress controller into a shell variable:
    12      ```
    13      $ IC_IP=XXX.YYY.ZZZ.III
    14      ```
    15  3. Save the HTTPS port of the Ingress controller into a shell variable:
    16      ```
    17      $ IC_HTTPS_PORT=<port number>
    18      ```
    19  
    20  ## 2. Deploy the Cafe Application
    21  
    22  Create the coffee and the tea deployments and services:
    23  ```
    24  $ kubectl create -f cafe.yaml
    25  ```
    26  
    27  ## 3. Configure Load Balancing
    28  
    29  1. Create a secret with an SSL certificate and a key:
    30      ```
    31      $ kubectl create -f cafe-secret.yaml
    32      ```
    33  
    34  2. Create an Ingress resource (for Kubernetes >= 1.18, uncomment the ```ingressClassName``` field in the YAML file):
    35      ```
    36      $ kubectl create -f cafe-ingress.yaml
    37      ```
    38  
    39  ## 4. Test the Application
    40  
    41  1. To access the application, curl the coffee and the tea services. We'll use ```curl```'s --insecure option to turn off certificate verification of our self-signed
    42  certificate and the --resolve option to set the Host header of a request with ```cafe.example.com```
    43      
    44      To get coffee:
    45      ```
    46      $ curl --resolve cafe.example.com:$IC_HTTPS_PORT:$IC_IP https://cafe.example.com:$IC_HTTPS_PORT/coffee --insecure
    47      Server address: 10.12.0.18:80
    48      Server name: coffee-7586895968-r26zn
    49      ...
    50      ```
    51      If your prefer tea:
    52      ```
    53      $ curl --resolve cafe.example.com:$IC_HTTPS_PORT:$IC_IP https://cafe.example.com:$IC_HTTPS_PORT/tea --insecure
    54      Server address: 10.12.0.19:80
    55      Server name: tea-7cd44fcb4d-xfw2x
    56      ...
    57      ```
    58  
    59  1. You can view an NGINX status page, either stub_status for NGINX, or the Live Activity Monitoring Dashboard for NGINX Plus:
    60      1. Follow the [instructions](https://docs.nginx.com/nginx-ingress-controller/logging-and-monitoring/status-page/) to access the status page.
    61      1. For NGINX Plus, If you go to the Upstream tab, you'll see: ![dashboard](dashboard.png)