k3s-oci-cluster icon indicating copy to clipboard operation
k3s-oci-cluster copied to clipboard

Added support for traefik2

Open garutilorenzo opened this issue 2 years ago • 1 comments

Added support for traefik2

garutilorenzo avatar Oct 21 '22 14:10 garutilorenzo

I have tested this with the base config, and it appears stable, although I have done no further testing as yet :)

  install_traefik2          = true
  install_nginx_ingress     = false
  install_certmanager       = false
  install_argocd            = false
  install_longhorn          = false

Also tested as follows with cert manager referring the the nginx-ingress and longhorn fails with the same error every time (unrelated)

  install_traefik2          = true
  install_nginx_ingress     = false
  install_certmanager       = true
  install_argocd            = true
  install_longhorn          = true

mannp avatar Oct 21 '22 16:10 mannp

Hi @mannp,

I think this PR would be useless. From the doc I read:

If Traefik is not disabled K3s versions 1.20 and earlier will install Traefik v1, while K3s versions 1.21 and later will install Traefik v2 if v1 is not already present.

So from k3s version 1.21 traefik v2 is installed by default.

garutilorenzo avatar Oct 24 '22 08:10 garutilorenzo

Hi @garutilorenzo does that mean that the default install works with this Oracle cluster?

I'd understood proxy mode was enabled and a NodePort rather than a LB is used in your PR, as well as routing from the Oracle loadbalancer.

I am not clear if those things are true with the default k3s traefik install?

mannp avatar Oct 24 '22 09:10 mannp

Ok @mannp, now with the last commits:

  • traefik2 will not be installed (installed by default by k3s)
  • traefik2 will be configured in proxy portocol mode
  • traefik2 svc will listen on ingress_controller_http_nodeport and ingress_controller_https_nodeport

garutilorenzo avatar Oct 24 '22 12:10 garutilorenzo

Added variable disable_ingress default to False. So to get traefik2 installed and configured only install_nginx_ingress set to false is needed.

garutilorenzo avatar Oct 24 '22 12:10 garutilorenzo

  install_nginx_ingress     = false
  install_certmanager       = false
  install_argocd            = true
  install_longhorn          = true

Only metrics, coredns and localpathprovisioner are in kube-system / deployements.

It doesn't appear that any traefik is installed with fresh pull or the repo and pr-27.

mannp avatar Oct 24 '22 14:10 mannp

Fixed

root@inst-xgoau-k3s-servers:~# kubectl get pods -n kube-system
NAME                                      READY   STATUS      RESTARTS   AGE
coredns-d76bd69b-ww8ms                    1/1     Running     0          97s
helm-install-traefik-crd-lzqcr            0/1     Completed   0          97s
helm-install-traefik-mnb5r                1/1     Running     0          43s
local-path-provisioner-6c79684f77-62fkt   1/1     Running     0          97s
metrics-server-7cd5fcb6b7-p7sw8           1/1     Running     0          97s

garutilorenzo avatar Oct 25 '22 08:10 garutilorenzo

@mannp Never mind. I found a problem using the default installation. I will revert the latest commit

garutilorenzo avatar Oct 25 '22 13:10 garutilorenzo

Okay @garutilorenzo, I pulled and then couldn't clear the cluster config with terraform destroy, so never tried.

Are you planning on merging the previous commits or still testing? Basic tests for me had it working fine.

I was unable to route cloudflared directly to traefik2 internal ip, but that was probably outside the scope of your changes.

mannp avatar Oct 25 '22 13:10 mannp