You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:description: Learn how to enable TLS encryption for your OPA cluster to secure client connections.
3
+
4
+
TLS encryption for securing client connections to the OPA server can be configured in the `OpaCluster` resource. When enabled, OPA serves requests over HTTPS instead of HTTP.
5
+
6
+
== Overview
7
+
8
+
TLS encryption in OPA is disabled by default. To enable it, you need to:
9
+
10
+
1. Create a `SecretClass` that provides TLS certificates
11
+
2. Reference the `SecretClass` in your `OpaCluster` custom resource
12
+
13
+
The operator integrates with the xref:secret-operator:index.adoc[Secret Operator] to automatically provision and mount TLS certificates into the OPA pods.
14
+
15
+
== Configuration
16
+
17
+
=== Creating a SecretClass
18
+
19
+
First, create a `SecretClass` that will provide TLS certificates. Here's an example using xref:secret-operator:secretclass.adoc#backend-autotls[autoTls]:
20
+
21
+
[source,yaml]
22
+
----
23
+
apiVersion: secrets.stackable.tech/v1alpha1
24
+
kind: SecretClass
25
+
metadata:
26
+
name: opa-tls
27
+
spec:
28
+
backend:
29
+
autoTls:
30
+
ca:
31
+
autoGenerate: true
32
+
secret:
33
+
name: opa-tls-ca
34
+
namespace: default
35
+
----
36
+
37
+
This SecretClass uses the autoTls backend, which automatically generates a Certificate Authority (CA) and signs certificates for your OPA cluster.
38
+
39
+
Similarly, you can also use xref:secret-operator:secretclass.adoc#backend[other backends] supported by Secret Operator.
40
+
41
+
=== Enabling TLS in OpaCluster
42
+
43
+
Once you have a SecretClass, enable TLS in your OpaCluster by setting the `.spec.clusterConfig.tls.serverSecretClass` field:
44
+
45
+
[source,yaml]
46
+
----
47
+
kind: OpaCluster
48
+
name: opa-with-tls
49
+
spec:
50
+
clusterConfig:
51
+
tls:
52
+
serverSecretClass: opa-tls # <1>
53
+
----
54
+
<1> Reference the SecretClass created above
55
+
56
+
== Discovery ConfigMap
57
+
58
+
The operator automatically creates a discovery ConfigMap, with the same name as the OPA cluster, that contains the connection URL for your cluster. When TLS is enabled, this ConfigMap will contain an HTTPS URL and the SecretClass name:
0 commit comments