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
Copy file name to clipboardExpand all lines: deploy/helm/opa-operator/crds/crds.yaml
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@ spec:
27
27
clusterConfig:
28
28
default:
29
29
listenerClass: cluster-internal
30
+
tls: null
30
31
userInfo: null
31
32
description: Global OPA cluster configuration that applies to all roles and role groups.
32
33
properties:
@@ -47,6 +48,16 @@ spec:
47
48
- external-unstable
48
49
- external-stable
49
50
type: string
51
+
tls:
52
+
description: TLS encryption settings for the OPA server. When configured, OPA will use HTTPS (port 8443) instead of HTTP (port 8081). Clients must connect using HTTPS and trust the certificates provided by the configured SecretClass.
53
+
nullable: true
54
+
properties:
55
+
serverSecretClass:
56
+
description: Name of the SecretClass which will provide TLS certificates for the OPA server.
57
+
type: string
58
+
required:
59
+
- serverSecretClass
60
+
type: object
50
61
userInfo:
51
62
description: Configures how to fetch additional metadata about users (such as group memberships) from an external directory service.
:description: Learn how to enable TLS encryption for your OPA cluster to secure client connections.
3
+
4
+
TLS encryption for securing connections between clients and the OPA server can be configured in the `OpaCluster` resource. When TLS is enabled, OPA will serve 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` specification
12
+
13
+
The operator integrates with the xref:secret-operator:index.adoc[Secret Operator] to automatically provision and mount TLS certificates to 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