Prerequisites
To complete this tutorial,kubectl and helm must be installed. You can follow the official installation guides available on the Kubernetes website and Helm website
You’ll also need an active domain and access to the control panel for managing DNS records in order to complete this guide.
Creating a Kubernetes Cluster
If you don’t have a Kubernetes cluster yet, you can create one using Ubicloud. Follow the instructions in the Quickstart Guide to set up your cluster and configurekubectl to access it.
Installing the required addons
You’ll need an email to register yourself with letsencrypt.gatewayHTTPRoute solver, which tells cert-manager to use the Gateway API for HTTP-01 challenges.
Create a Gateway
First, create aCNAME record with your DNS provider pointing *.somesubdomain.yourdomain.com to the domain listed in the “Service URL” in the Overview page of your Kubernetes cluster in Ubicloud console. Feel free to use any subdomain that best suits your setup.
gateway-nginx will appear in the default namespace. This Service is of type LoadBalancer, and the EXTERNAL-IP column will display a domain that resolves to the IPs of your worker nodes.
You can see this service using the command below
certificateRefs field points to a Kubernetes Secret named hello-world-tls where the TLS certificate and private key will be stored. This Secret doesn’t exist yet — cert-manager will create it in the next step.
You can monitor the certificate status with:
READY column shows True before proceeding.
Deploy the application, Service, and HTTPRoute
Now deploy a simple NGINX web server, expose it as a Service, and create an HTTPRoute to route external HTTPS traffic to it.- Deployment: Runs an NGINX container that serves the default welcome page on port 80.
- Service: Exposes the Deployment inside the cluster so that the HTTPRoute can forward traffic to it.
- HTTPRoute: Attaches to the Gateway’s
httpslistener (viasectionName: https) and routes all requests forhello-world.<your-domain>to thehello-world-service. This is the resource that connects your external HTTPS traffic all the way to your application pods.