In this example we deploy the NGINX Ingress Controller (edge) as a Deployment using the NGINX Ingress Operator for NGINX Open Source.
Have the NGINX Ingress Operator deployed in your cluster. Follow installation steps. If you would like to use TransportServers, refer to this section for additional pre-requisites.
-
Create a new namespace for our Ingress Controller instance:
kubectl create -f ns.yaml
-
Create a new NginxIngressController resource that defines our NGINX Ingress Controller instance (Note: If using Openshift, change the
image.tag
toedge-ubi
):kubectl create -f nginx-ingress-controller.yaml
This will deploy an NGINX Ingress Controller instance using a Deployment in the my-nginx-controller
namespace.
-
Check if all resources were deployed:
kubectl -n my-nginx-ingress get all NAME READY STATUS RESTARTS AGE pod/my-nginx-ingress-controller-666854fb5f-f67fs 1/1 Running 0 3s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/my-nginx-ingress-controller NodePort 10.103.105.52 <none> 80:30298/TCP,443:32576/TCP 3s NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/my-nginx-ingress-controller 1/1 1 1 4s NAME DESIRED CURRENT READY AGE replicaset.apps/my-nginx-ingress-controller-666854fb5f 1 1 1 4s
For more information about how to configure the NGINX Ingress Controller, check the official documentation.
-
Delete the NginxIngressController:
kubectl delete -f nginx-ingress-controller.yaml
-
Delete the namespace:
kubectl delete namespace my-nginx-ingress
TransportServers provide support for TCP/UDP but are in active development and provided as a preview feature. A GlobalConfiguration resource is used to specify the TCP/UDP listeners and is required by TransportServers. To use TransportServers, you must create a GlobalConfiguration resource after creating the namespace and before starting the Operator.
Step 1. namespace
Step 2. global configuration <--- in this order
Step 3. ingress controller
...
kubectl apply -f global-configuration.yaml
Then update the NginxIngressController to use the GlobalConfiguration by adding the following config to nginx-ingress-controller.yaml
globalConfiguration: my-nginx-ingress/nginx-configuration
For more information, check the official documentation.