traefik / mesh

Traefik Mesh - Simpler Service Mesh
https://traefik.io/traefik-mesh
Apache License 2.0
2.02k stars 141 forks source link

Properly detect CoreDNS version with suffixes and bump support to CoreDNS < 1.9.0 #790

Closed 0rax closed 3 years ago

0rax commented 3 years ago

What does this PR do?

This PR:

The issue was exposed in https://github.com/traefik/mesh/issues/788 and has some checks showed that github.com/hashicorp/go-version considers suffixed version as pre-release meaning that some checks here will not be satisfied.

Example:

versionCoreDNS17 := goversion.Must(goversion.NewVersion("1.7"))
coreDNSVersion := goversion.Must(goversion.NewVersion("v1.7.0-eksbuild.1"))
fmt.Println(coreDNSVersion.LessThan(versionCoreDNS17)) // Prints true

This is an issue in two contexts:

I've fixed this issue by updating go-version to 1.3.0 which adds a new method Core which allows us to retrieve the non suffixed / pre-release version linked to the currently parsed version. One thing to keep in mind here is that the new checks would allow an alpha / beta version of CoreDNS 1.3 to be used with Mesh though there is no real solution here as go-version is unable to detect the difference between an alpha, beta, rc suffix from an eksbuild.X suffix.

After checking all changelogs since the last support version (CoreDNS-1.7.1), it doesn't look like any breaking changes were introduced preventing mesh from supporting it. This is currently being tested in a EKS cluster running Kubernetes v1.20 (Platform version eks.1) and CoreDNS v1.8.3-eksbuild.1.

This would extend support of Traefik Mesh to EKS running Kubernetes v1.20, EKS is using CoreDNS 1.8 as its default version since v1.19 (which is the current default) and has removed support for choosing CoreDNS 1.7 at deployment in v1.20.

Fixes #787 Fixes #788

How to test it

Additional Notes

I've made the choice to upgrade go-version to v1.3.0 but another solution was discussed in https://github.com/traefik/mesh/issues/788#issuecomment-849788686.

0rax commented 3 years ago

Looks like html-proofer has some issue installing. It seems that it now requires a version of ruby-ffi that is not available in Alpine Linux packages and tries to build it. I was able to fix that by adding build-base and ruby-dev to apk add so that it compiles it itself. Not sure about that fix though as it adds quite a bit of dependencies to install in docs/check.Dockerfile.

0rax commented 3 years ago

This fix has been deployed in our staging environment for 2 weeks now and has been stable. If someone is in need of it for their environment. A custom image can be built using:

make build
docker tag traefik/mesh:latest myimage:mytag
kevinpollet commented 3 years ago

/sem-approve