garutilorenzo / k3s-oci-cluster

Deploy a Kubernetes cluster for free, using k3s and Oracle always free resources
https://garutilorenzo.github.io/deploy-kubernetes-for-free-oracle-cloud
GNU General Public License v3.0
225 stars 79 forks source link

Added support for traefik2 #27

Closed garutilorenzo closed 1 year ago

garutilorenzo commented 1 year ago

Added support for traefik2

mannp commented 1 year ago

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
garutilorenzo commented 1 year ago

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.

mannp commented 1 year ago

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?

garutilorenzo commented 1 year ago

Ok @mannp, now with the last commits:

garutilorenzo commented 1 year ago

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

mannp commented 1 year ago
  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.

garutilorenzo commented 1 year ago

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 commented 1 year ago

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

mannp commented 1 year ago

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.