Skip to content

Commit 2e971b5

Browse files
committed
chore(example): how to use custom TLS certificates
An example on how to use custom TLS certificates with PostgreSQL. Signed-off-by: Zoran Regvart <[email protected]>
1 parent 3ff7952 commit 2e971b5

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
# This DeploymentRuntimeConfig will mount files embedded in a Secret to the
3+
# provider Pod, this allows accessing those files as paths on in the options,
4+
# e.g. when using custom TLS CA certificates or keys
5+
apiVersion: pkg.crossplane.io/v1beta1
6+
kind: DeploymentRuntimeConfig
7+
metadata:
8+
name: postgres-custom-tls
9+
spec:
10+
deploymentTemplate:
11+
spec:
12+
selector: {}
13+
template:
14+
spec:
15+
containers:
16+
- name: package-runtime
17+
volumeMounts:
18+
- mountPath: /certs/postgres
19+
name: postgresql-tls
20+
readOnly: true
21+
volumes:
22+
- name: postgresql-tls
23+
secret:
24+
# Name of the secret containing the files
25+
secretName: postgresdb-postgresql-crt
26+
defaultMode: 420
27+
---
28+
# The DeploymentRuntimeConfig must be referenced in the Provider configuration
29+
# for it to be effective
30+
apiVersion: pkg.crossplane.io/v1
31+
kind: Provider
32+
metadata:
33+
name: provider-sql
34+
spec:
35+
runtimeConfigRef:
36+
name: postgres-custom-tls
37+
package: xpkg.upbound.io/crossplane-contrib/provider-sql:v0.13.0
38+
---
39+
# The configuration can now point to the /certs/postgres/ca.crt, ca.crt being
40+
# the key in the postgresdb-postgresql-crt Secret referenced above
41+
apiVersion: postgresql.sql.crossplane.io/v1alpha1
42+
kind: ProviderConfig
43+
metadata:
44+
name: default
45+
spec:
46+
sslRootCert: /certs/postgres/ca.crt
47+
credentials:
48+
source: PostgreSQLConnectionSecret
49+
connectionSecretRef:
50+
namespace: default
51+
name: postgresdb-creds

0 commit comments

Comments
 (0)