Skip to content

Commit

Permalink
selfsigned tls cert created by cert-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
cofyc committed Mar 10, 2020
1 parent 15b9eda commit 95e3666
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/selfsigned-tls/selfsigned-ca.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: selfsigned-ca-cert
spec:
secretName: selfsigned-ca-cert
commonName: "certmanager"
isCA: true
issuerRef:
name: selfsigned-issuer
kind: Issuer
7 changes: 7 additions & 0 deletions examples/selfsigned-tls/selfsigned-cert-issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: cert-manager.io/v1alpha2
kind: Issuer
metadata:
name: selfsigned-cert-issuer
spec:
ca:
secretName: selfsigned-ca-cert
6 changes: 6 additions & 0 deletions examples/selfsigned-tls/selfsigned-issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: cert-manager.io/v1alpha2
kind: Issuer
metadata:
name: selfsigned-issuer
spec:
selfSigned: {}
30 changes: 30 additions & 0 deletions examples/selfsigned-tls/tidb-client-cert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: tidb-client-cert
spec:
secretName: tidb-client-cert
subject:
organizationalUnits:
- "TiDB Operator"
organization:
- "PingCAP"
duration: "8760h" # 364 days
commonName: "basic-tidb"
dnsNames:
- basic-tidb.default
- basic-tidb.default.svc
- basic-tidb-peer.default
- basic-tidb-peer.default.svc
- "*.basic-tidb-peer.default"
- "*.basic-tidb-peer.default.svc"
- "localhost"
ipAddresses:
- "127.0.0.1"
- "::1"
usages:
- "client auth"
- "server auth"
issuerRef:
name: selfsigned-cert-issuer
kind: Issuer
29 changes: 29 additions & 0 deletions examples/selfsigned-tls/tidb-cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: pingcap.com/v1alpha1
kind: TidbCluster
metadata:
name: basic
spec:
version: v3.0.8
timezone: UTC
pvReclaimPolicy: Delete
pd:
baseImage: pingcap/pd
replicas: 3
requests:
storage: "1Gi"
config: {}
tikv:
baseImage: pingcap/tikv
replicas: 3
requests:
storage: "1Gi"
config: {}
tidb:
baseImage: pingcap/tidb
replicas: 2
service:
type: ClusterIP
config: {}
tlsClient:
enabled: true
secretName: tidb-client-cert

0 comments on commit 95e3666

Please sign in to comment.