Skip to content

data-henrik/codeengine_traefik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Engine custom domain with Cloud Foundry or Kubernetes service and Traefik

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.

Instructions for Cloud Foundry

  1. Make sure your custom domain is available to Cloud Foundry on IBM Cloud: https://cloud.ibm.com/account/cloud-foundry/. Upload SSL/TLS certificates.
  2. Download or clone this repo
  3. Download the Traefik Linux AMD64 binary and place it into the directory. See https://github.com/traefik/traefik/releases for the latest release.
  4. Adapt routes.yml to your Code Engine app URI and your custom domain. (Traefik route configuration)
  5. Adapt manifest.yml to your custom domain. (Cloud Foundry routes)
  6. Login to IBM Cloud, set the endpoints (ibmcloud target --cf)
  7. Push the app: ibmcloud cf push

Once deployed, the configured URI should serve your Code Engine app.

Path-based routing

See the branch path-based-routing for information on how to map incoming requests to separate Code Engine apps based on the path prefix.

Instructions for Kubernetes service (WIP)

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.