Microk8s Traefik add-on configuration

Hi,

I’m currently testing microk8s/microceph/rook on a 3 nodes cluster and it’s amazing!

I’m trying to add a pair of ingressRouteTCP to my setup, for a non-http service but I can’t find where I’m supposed to add the new entryPoints for Traefik.

Any idea?

Ah, diving into microk8s with Traefik sounds like a cool adventure! It’s great to hear that you’re having a blast with microk8s, microceph, and rook on your cluster. :smile:

For adding ingressRouteTCP for non-HTTP services in Traefik within microk8s, you’re right; you’ll need to configure new entryPoints. Typically, this involves editing the Traefik configuration, which might be slightly different in microk8s due to its encapsulated nature.

Here’s a general approach to tackle this:

  1. Check Traefik Add-on Config: First, check if the Traefik add-on is enabled with microk8s enable traefik. I’m guessing you’ve done this since you’re looking into adding ingressRouteTCP.
  2. Configuration Location: For microk8s, Traefik’s configuration might be managed through its add-on service or through ConfigMaps in Kubernetes. You might not find traditional Traefik config files lying around.
  3. Customize Configurations: To add new entryPoints, you would typically need to customize the Traefik configuration. In a standard Kubernetes setup, you’d do this by editing the Traefik ConfigMap or deployment YAML to include your additional entryPoints. In microk8s, this might involve editing the Traefik deployment or service within the kube-system namespace.
  4. Editing the ConfigMap: If microk8s manages Traefik configuration through a ConfigMap, you can edit it using:

bashCopy code

microk8s kubectl edit configmap <traefik-configmap-name> -n kube-system

Here, you’d add your entryPoints under the traefik.toml or traefik.yml configurations, depending on the format used.
5. Applying ingressRouteTCP: Once your entryPoints are configured, you can define your IngressRouteTCP resources as usual, pointing them to the new entryPoints.
6. Restart Traefik: After updating configurations, you might need to restart the Traefik pod for changes to take effect. This can be done by deleting the current Traefik pod and letting the deployment spin up a new one.

If you’re not seeing where to place these configurations directly, it might be worth checking the microk8s documentation or forums for specifics on customizing add-ons. Sometimes, the community or official docs have neat little tricks or tips for these kinds of customizations.

Keep in mind that microk8s encapsulates a lot of complexity to make things simpler, so the traditional ways of doing things in a vanilla Kubernetes environment might be a bit different here.

How do we determine the traefik config map name?