Skip to content

Fix k8s for example for rootCAs serversTransport - #9274

Merged
traefiker merged 1 commit into
traefik:v2.8from
ben-krieger:patch-1
Aug 24, 2022
Merged

Fix k8s for example for rootCAs serversTransport#9274
traefiker merged 1 commit into
traefik:v2.8from
ben-krieger:patch-1

Conversation

@ben-krieger

Copy link
Copy Markdown

What does this PR do?

It fixes a configuration example which doesn't match documentation.

The rootCAs (for serversTransport) secret data used the key tls.crt, but it must be either ca.crt or tls.ca according to the docs at https://doc.traefik.io/traefik/routing/providers/kubernetes-crd/#kind-serverstransport.

Motivation

I was wondering if a cert-manager.io/Certificate secret could be used to provide the CA. It didn't appear so from the example, since the leaf certificate would be used, but when I looked at the docs, it became clear that it would work as expected.

The secret data used the key "tls.crt", but it must be either "ca.crt" or "tls.ca" according to the docs at https://doc.traefik.io/traefik/routing/providers/kubernetes-crd/#kind-serverstransport.

data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
ca.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, I see in the code that we apparently use whatever's in data (as long as there's only one field) anyway, so it seems that the existing example would have worked nonetheless. And there's a comment saying we're supposed to drop that behaviour at some point.
But yeah, better be matching the doc.

@ldez ldez added status/3-needs-merge bot/light-review decreases the number of required LGTM from 3 to 1. and removed status/2-needs-review labels Aug 24, 2022
@ldez ldez added this to the 2.8 milestone Aug 24, 2022
@traefiker
traefiker merged commit dfa1f3f into traefik:v2.8 Aug 24, 2022
@traefiker traefiker removed status/3-needs-merge bot/light-review decreases the number of required LGTM from 3 to 1. labels Aug 24, 2022
@ben-krieger
ben-krieger deleted the patch-1 branch August 24, 2022 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants