For some of my apps deployed on IBM Cloud Code Engine I am requiring a custom domain. It seems a feature is in the making. Until then, I use Traefik (https://traefik.io/traefik/) deployed to IBM Cloud with Public Cloud Foundry or the Kubernetes service as workaround. It only requires few simple steps.
- Make sure your custom domain is available to Cloud Foundry on IBM Cloud: https://cloud.ibm.com/account/cloud-foundry/. Upload SSL/TLS certificates.
- Download or clone this repo
- Download the Traefik Linux AMD64 binary and place it into the directory. See https://github.com/traefik/traefik/releases for the latest release.
- Adapt routes.yml to your Code Engine app URI and your custom domain. (Traefik route configuration)
- Adapt manifest.yml to your custom domain. (Cloud Foundry routes)
- Login to IBM Cloud, set the endpoints (ibmcloud target --cf)
- Push the app: ibmcloud cf push
Once deployed, the configured URI should serve your Code Engine app.
See the branch path-based-routing for information on how to map incoming requests to separate Code Engine apps based on the path prefix.
The following assumes that you have a Standard cluster provisioned in the IBM Cloud Kubernetes service (IKS). For my tests and deployment, I have used the VPC-based clusters.
See the branch kubernetes-deployment for the steps and required files.