Install and configure NGINX Ingress Controller
You can use NGINX as the ingress controller for your MOSTLY AI deployment. NGINX makes it possible to assign a LoadBalancer IP address to your cluster. You can then assign a Fully Qualified Domain Name (FQDN) to the IP address and make the MOSTLY AI web application accessible to your users in your organization.
- Install NGINX. Learn how to install NGINX in your Kubernetes cluster.
- Configure NGINX. Learn the configuration steps required to use NGINX as the ingress controller for your MOSTLY AI deployment.
Install NGINX
Install the NGINX ingress controller to assign a LoadBalancer IP address to your cluster. You can then assign a FQDN to the IP address and make the MOSTLY AI web application accessible to your users in your organization.
Steps
-
Add the helm chart repository for the Ingress NGINX Controller.
shellhelm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
You should see the following result:
"ingress-nginx" has been added to your repositories
-
Install the Ingress NGINX Controller.
shellhelm install nginx-ingress ingress-nginx/ingress-nginx
Result
The Ingress NGINX Controller is now installed for your GKE cluster. You might see a result similar to the output below.
Note the line that indicates that you are now waiting for the LoadBalancer IP to be available and a suggested command to check the status of when the IP is available.
NAME: nginx-ingress
LAST DEPLOYED: Thu Sep 28 01:35:44 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
The ingress-nginx controller has been installed.
It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status by running 'kubectl --namespace default get services -o wide -w nginx-ingress-ingress-nginx-controller'
An example Ingress that makes use of the controller:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example
namespace: foo
spec:
ingressClassName: nginx
rules:
- host: www.example.com
http:
paths:
- pathType: Prefix
backend:
service:
name: exampleService
port:
number: 80
path: /
# This section is only required if TLS is to be enabled for the Ingress
tls:
- hosts:
- www.example.com
secretName: example-tls
If TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided:
apiVersion: v1
kind: Secret
metadata:
name: example-tls
namespace: foo
data:
tls.crt: <base64 encoded cert>
tls.key: <base64 encoded key>
type: kubernetes.io/tls
What’s next
To check if cluster ingress IP address has been assigned, run the following command:
kubectl --namespace default get services -o wide -w nginx-ingress-ingress-nginx-controller
If your IP is assigned, you will see it under the EXTERNAL-IP
column. The EXTERNAL-IP
value below is masked on purpose.
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
nginx-ingress-ingress-nginx-controller LoadBalancer 10.48.12.255 34.140.40.*** 80:31623/TCP,443:32105/TCP 4m41s app.kubernetes.io/component=controller,app.kubernetes.io/instance=nginx-ingress,app.kubernetes.io/name=ingress-nginx
You can now use your ingress IP and assign it to the domain name that you intend to use for your MOSTLY AI cluster.
Configure NGINX
Define NGINX as the ingress controller and then enable the required ingress
annotations.
Steps
- In the
values.yaml
file, assign theingressClassName
to benginx
under_customerInstallation.deploymentSettings
.values.yaml_customerInstallation: ... deploymentSettings: ... ingressClassName: &ingressClassName nginx ...
- Enable the ingress annotations under
global.ingress.annotations
.values.yamlglobal: ingress: annotations: nginx.ingress.kubernetes.io/proxy-body-size: 10240m nginx.ingress.kubernetes.io/proxy-buffer-size: 128k nginx.org/proxy-connect-timeout: 3000s nginx.org/proxy-read-timeout: 3000s nginx.org/client-max-body-size: 3000m # annotations: {}
What’s next
Continue with the MOSTLY AI Helm chart configuration in the related deployment guide. You can then deploy MOSTLY AI.