pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.23k stars 498 forks source link

TiDB Cluster/Client TLS support implementation in TiDB Operator #1855

Closed weekface closed 4 years ago

weekface commented 4 years ago

To support various certificate issuers and methods, for example: user-defined certificates, K8s builtin CA system or cert-manager, we will refactor the TiDB Cluster/Client TLS feature with new API and new usage.

First, we will change the Cluster/Client TLS API to:

tlsCluster:
  enabled: true

tidb:
  tlsClient:
    enabled: true

That is all the whole API we needed.

If the user set tlsCluster.enabled to true, then tidb-operator will assume that there are several Secrets named with: <cluster-name>-pd-cluster-secret, <cluster-name>-tikv-cluster-secret, <cluster-name>-tidb-cluster-secret, <cluser-name>-cluster-client-secret and other TiDB components's Secrets are created.

Each Secret data should have three keys: tls.crt, tls.key and ca.crt:

apiVersion: v1
kind: Secret
metadata:
  name: <secret-name>
data:
  tls.crt: <base64 decoded certificate data>
  tls.key: <base64 decode key data>
  ca.crt: <base64 decode ca data>

These Secrets can be created by the use manually, by K8s builtin CA system or by cert-manager. PD/TiKV/TiDB/... will use these Secrets to start server.

tidb-operator will not supply these certificates automatically.

There are several tasks:

Low priority or do not do issues:

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days