Skip to content

Commit 2d27027

Browse files
committed
docs: ClusterTrustBundle Support in BackendTLSPolicy (envoyproxy#6714)
Signed-off-by: zirain <zirain2009@gmail.com>
1 parent 84aa9ce commit 2d27027

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

site/content/en/latest/tasks/security/backend-tls.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,35 @@ Store the cert/key in a Secret:
5959
kubectl create secret tls example-cert --key=www.example.com.key --cert=www.example.com.crt
6060
```
6161

62-
Store the CA Cert in another Secret:
62+
Store the CA Cert in different ways:
63+
64+
{{< tabpane text=true >}}
65+
{{% tab header="ConfigMap" %}}
6366

6467
```shell
6568
kubectl create configmap example-ca --from-file=ca.crt
6669
```
6770

71+
{{% /tab %}}
72+
73+
{{% tab header="ClusterTrustBundle" %}}
74+
75+
Save and apply the following resource to your cluster:
76+
77+
```shell
78+
apiVersion: certificates.k8s.io/v1beta1
79+
kind: ClusterTrustBundle
80+
metadata:
81+
name: example-ca
82+
spec:
83+
trustBundle: |
84+
[content from ca.crt]
85+
```
86+
87+
{{% /tab %}}
88+
89+
{{< /tabpane >}}
90+
6891
## Setup TLS on the backend
6992

7093
Patch the existing quickstart backend to enable TLS. The patch will mount the TLS certificate secret into the backend as volume.
@@ -159,7 +182,7 @@ Note: SectionName is an optional field that specifies the name of the port in th
159182
If the target is a [Backend] resource, the `sectionName` field should be set to the port number of the backend.
160183

161184
{{< tabpane text=true >}}
162-
{{% tab header="Apply from stdin" %}}
185+
{{% tab header="ConfigMap" %}}
163186

164187
```shell
165188
cat <<EOF | kubectl apply -f -
@@ -184,11 +207,11 @@ EOF
184207
```
185208

186209
{{% /tab %}}
187-
{{% tab header="Apply from file" %}}
188-
Save and apply the following resource to your cluster:
189210

190-
```yaml
191-
---
211+
{{% tab header="ClusterTrustBundle" %}}
212+
213+
```shell
214+
cat <<EOF | kubectl apply -f -
192215
apiVersion: gateway.networking.k8s.io/v1alpha3
193216
kind: BackendTLSPolicy
194217
metadata:
@@ -204,8 +227,9 @@ spec:
204227
caCertificateRefs:
205228
- name: example-ca
206229
group: ''
207-
kind: ConfigMap
230+
kind: ClusterTrustBundle
208231
hostname: www.example.com
232+
EOF
209233
```
210234

211235
{{% /tab %}}

0 commit comments

Comments
 (0)