pingcap / pingcap/tidb-operator
Allow to specify TLS CAs outside of -pd-cluster-secret
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 540
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 18
Description
Feature Request
Is your feature request related to a problem? Please describe:
We use tidb-operator to run TiKV cluster w/o TiDB layer. Our clients are deployed to a separate k8s cluster. It is not safe to share private key of root CA, so our clients have a separate root CA. Now I have to provider PD/TiKV with combined ca.crt from client and server. We rely on cert-manager.io to generate and rotate certificates as recommended on https://docs.pingcap.com/tidb-in-kubernetes/stable/enable-tls-between-components#using-cert-manager, but it does not allow to add an additional ca.crt in the generated secrets.
Describe the feature you'd like:
Allow to specify a separate secret for root CA to override ca.crt from -pd-cluster-secret. Or allow security/cacert-path to take precedence of secrete instead of blindly overriding it in https://github.com/pingcap/tidb-operator/blob/62b11ad37ddd3482dfec519770d6c65011e24d6d/pkg/manager/member/pd_member_manager.go#L836-L841 so that it is possible to mount and configure it separately
Describe alternatives you've considered:
- Use security/cacert-path in CR, but it is gets overridden by
-pd-cluster-secretmount. - Use
additionalVolumeMountin CR withsubPathto mount a different ca.crt under/var/lib/pd-tls, but k8s forbids mounting to the same path - Add client root CA to
/etc/ssl/certs/ca-certificates.crton the pod (system trust store), but PD and TiKV doesn't seem honoring it. - Put combined
ca.crtinto secret for the cert-manager.ioIssuer, but cert-mahager.ioCertificatedoes not include it in the generated certificate secrete.
The only alternative I can see is not using cert-manager.io, but generate secrete manually, however then I will have to implement in infrastructure to rotate certificates.
Teachability, Documentation, Adoption, Migration Strategy:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at pkg/manager/member/pd_member_manager.go around lines 836-841 and trace how -pd-cluster-secret mounts ca.crt and how security/cacert-path is handled in the CR. Review the PD/TiKV TLS configuration described in the issue. Done means a separate root-CA secret or a working precedence path can be configured without overriding the intended CA.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- infrastructure, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100