Lab 11 - Ingress IKS
The IBM Kubernetes service free clusters consist of a single worker node with 2 CPU and 4 GB of memory for experimenting with Kubernetes. Unlike the fee-based service, these clusters do not include capabilities for application load balancing using ingress out-of-the-box.
Prerequisites
- Free IBM Kubernetes Cluster (IKS) - upgrade your account from Lite plan to create one. In the example commands, we'll assume that this cluster is named
mycluster
- kubectl - match your cluster API version
- Log in to IBM Cloud and configure
kubectl
using theibmcloud ks cluster config --cluster mycluster
command
Components
On the IKS cluster, you will install helm charts for a nginx ingress controller from NGINX. This lab already provides the templated yaml files so there is no need to use helm cli.
Set up the ingress controller
Only do this on a free IKS instance These steps assume facts that only apply to free IKS instances:
- a single worker where the cluster administrator can create pods that bind to host ports
- no pre-existing ingress controller or application load balancer
Using the following steps with a paid instance can cause issues. See the IBM Cloud containers documentation for information on exposing applications with the ingress/alb services for paid clusters. You have been warned
-
Install the NGINX ingress controller with
helm
using a daemonset and no service resource (which will result in a single pod that binds to ports 80 and 443 on the worker node and will skip creation of aClusterIP, LoadBalancer, or NodePort
for the daemonset). -
You can use free domain
.nip.io
to get a domain name using one of the IP Address of your worker nodes. Run this command to set your DOMAIN -
You can test the ingress controller using the
$DOMAIN
:A 404 is expected at this point because unlike the kubernetes nginx ingress, the NGINX version of the ingress controller does not create a default backend deployment.
-
To use the ingress controller deploy a sample application, expose a service.
-
Now create an Ingress resource
-
List the created ingress
-
Access your web application
The output prints the html -
Delete all the resources created