Skip to content

Commit 6a69be4

Browse files
committed
[docs] Document PKI configuration for multihost pipelines.
Signed-off-by: Ben Pfaff <blp@feldera.com>
1 parent d951a3c commit 6a69be4

File tree

3 files changed

+149
-21
lines changed

3 files changed

+149
-21
lines changed

crates/feldera-types/src/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ pub struct RuntimeConfig {
763763
///
764764
/// The worker threads are evenly divided among the hosts. For single-host
765765
/// deployments, this should be 1 (the default).
766+
///
767+
/// Multihost pipelines are an enterprise-only preview feature.
766768
pub hosts: usize,
767769

768770
/// Storage configuration.

docs.feldera.com/docs/architecture/enterprise.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Feldera Enterprise brings all the power of our incremental compute platform into
1818
### One Pipeline = One Pod
1919
Each Pipeline runs in its own Kubernetes Pod, resource- and fault-isolated from other pipelines and the control plane. Each Pipeline can use a **Persistent Volume** or **S3 bucket** for its storage.
2020

21+
Pipelines that run in multiple pods, to scale out resource-hungry computations across multiple machines, are a preview feature.
22+
2123
### Fine-Grained Resource Management
2224
The control plane and each Pipeline can be configured with resource reservations and limits for CPU, memory, and storage. When using Persistent Volumes for storage, Pipelines can also specify the specific storage class to use. These controls help enforce SLAs and deal with noisy neighbours in shared clusters.
2325

docs.feldera.com/docs/get-started/enterprise/https.md

Lines changed: 145 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,31 @@
33
This document describes how to configure the endpoints of Feldera components (API server, compiler,
44
runner, pipelines) to serve HTTPS in the Enterprise edition.
55

6-
- The same certificate (and thus private key) are used by all components
7-
- Authentication (e.g., mTLS) is currently not yet supported (besides for the
8-
[existing authentication methods of the API server](authentication/index.mdx))
6+
For Feldera to support HTTPS with single-host pipelines, the
7+
administrator must configure Feldera with a [wildcard
8+
certificate](#wildcard-certificate-generation) and a private key for
9+
its main DNS domain, e.g. for `*.feldera.svc.cluster.local`. The
10+
Feldera API server, compiler runner, pipeline runner, pipeline
11+
stateful sets, and other top-level components share this certificate
12+
and key.
13+
14+
For Feldera to also support HTTPS with multihost pipelines, the
15+
administrator must additionally configure Feldera with a [private CA
16+
certificate chain](#private-ca-certificate-chain-generation) and
17+
private key. This allows the Feldera pipeline runner to generate keys
18+
for multihost pipeline pods in their nested DNS domains,
19+
e.g. `<pipeline>-<ordinal>.<pipeline>.feldera.svc.cluster.local`,
20+
which a single wildcard certificate cannot cover. The generated
21+
certificates are only used for connections between Feldera components,
22+
such as between the pipeline pods and the pipeline manager, not
23+
external software.
24+
25+
:::note
26+
27+
Feldera does not support mTLS authentication. The API server supports
28+
[API authentication](authentication/index.mdx).
29+
30+
:::
931

1032
This document does not apply to the connection to the Postgres database used by the control plane,
1133
which can be [configured separately](helm-guide.md).
@@ -19,23 +41,28 @@ as it expects HTTPS. The pipelines will need to be recompiled.
1941

2042
:::
2143

22-
## Certificate
44+
## Wildcard Certificate Generation
2345

24-
A certificate and associated private key need to be generated for the relevant hostnames.
46+
To support HTTPS, the administrator must generate and install a
47+
wildcard certificate for `*.<namespace>.svc.cluster.local`, where
48+
`<namespace>` is the Kubernetes namespace in use, such as `feldera`.
2549

26-
### Certificate structure
50+
:::info
2751

28-
- The Feldera components communicate with each other in Kubernetes using the
29-
`SERVICE.NAMESPACE.svc.cluster.local` hostnames.
30-
- As such, a single certificate should be generated for the wildcard hostname
31-
`*.NAMESPACE.svc.cluster.local`
32-
- (Optional) When using `kubectl` port forwarding, it is also useful to add
33-
hostname `localhost` and/or `127.0.0.1` to the certificate
52+
When using `kubectl` port forwarding, it is also useful to add
53+
hostname `localhost` and/or `127.0.0.1` to the certificate.
54+
55+
:::
3456

35-
### Example (self-signed)
57+
Any method for generating a signed certificate is acceptable. We
58+
assume later that the certificate file is named `tls.crt` and the
59+
private key file `tls.key`. The following sections describe two ways
60+
to generate these files.
3661

37-
For example, suppose that we install Feldera in namespace `feldera` and will
38-
be using `kubectl` port forwarding.
62+
### Generating a self-signed certificate with OpenSSL
63+
64+
Suppose that we install Feldera in namespace `feldera` and will be
65+
using `kubectl` port forwarding.
3966

4067
1. Create `x509_v3.ext` to specify the SANs (Subject Alternative Names):
4168
```
@@ -57,25 +84,105 @@ be using `kubectl` port forwarding.
5784

5885
3. This will create the `tls.key` and `tls.crt` files.
5986

60-
### Not self-signed
87+
### Using a certificate signed by an external CA
6188

6289
If the certificate is not self-signed, but instead is signed by a root CA or an intermediate CA,
6390
the `tls.crt` should contain the complete bundle of the entire chain up until the root certificate
6491
authority. As such, it should contain multiple `-----BEGIN CERTIFICATE----- (...) -----END CERTIFICATE-----`
6592
sections, starting with the leaf certificate and ending with the root certificate. The `tls.key`
6693
should only contain the single private key of the leaf certificate.
6794

95+
## Private CA Certificate Chain Generation
96+
97+
To support HTTPS for multihost pipelines, the administrator must
98+
additionally configure Feldera with a private CA certificate chain and
99+
private key. This allows the Feldera pipeline runner to generate keys
100+
for multihost pipeline pods in their nested DNS domains,
101+
e.g. `<pipeline>-<ordinal>.<pipeline>.feldera.svc.cluster.local`,
102+
which a single wildcard certificate cannot cover.
103+
104+
The private CA certificate chain can be and should be separate from
105+
any other PKI, because it is used only for connections between Feldera
106+
components, such as between the pipeline pods and the pipeline
107+
manager, not external software.
108+
109+
Any method for generating a private CA certificate chain is
110+
acceptable. We assume later that the CA certificate chain file is
111+
named `private_ca.crt` and the private key file `private_ca.key`. The
112+
section below describes one way to generate these files.
113+
114+
### Generating a private CA with OpenSSL
115+
116+
1. Create `root_x509_v3.ext` to specify options for the root private CA:
117+
118+
```
119+
[x509_v3]
120+
basicConstraints = CA:TRUE,pathlen:1
121+
```
122+
123+
2. Create `intermediate_x509_v3.ext` to specify options for the
124+
intermediate private CA:
125+
126+
```
127+
[x509_v3]
128+
basicConstraints = CA:TRUE,pathlen:0
129+
```
130+
131+
3. Generate the root CA with `openssl`:
132+
133+
```
134+
openssl req -x509 -newkey rsa:4096 -nodes \
135+
-keyout private_root_tls.key -out private_root_tls.crt -days 365 \
136+
-subj '/CN=FelderaTest Private Root CA' \
137+
-config root_x509_v3.ext -extensions x509_v3
138+
```
139+
140+
4. Generate and sign the intermediate CA with `openssl`:
141+
142+
```
143+
openssl req -new -newkey rsa:4096 -nodes \
144+
-keyout private_intermediate_tls.key -out private_intermediate_tls.csr \
145+
-subj '/CN=FelderaTest Intermediate CA'
146+
openssl x509 -req \
147+
-in private_intermediate_tls.csr -CA private_root_tls.crt -CAkey private_root_tls.key \
148+
-CAcreateserial -out private_intermediate_tls.crt \
149+
-days 360 -sha256 \
150+
-extfile intermediate_x509_v3.ext -extensions x509_v3
151+
```
152+
153+
5. Produce the secret to install into Kubernetes:
154+
155+
```
156+
cat private_intermediate_tls.crt private_root_tls.crt > private_ca.crt
157+
cat private_intermediate_tls.key > private_ca.key
158+
```
159+
68160
## Configure Kubernetes
69161

70-
1. Create the Kubernetes TLS Secret (e.g., in namespace `feldera`, and named `feldera-https-config`)
71-
with the local `tls.key` and `tls.crt` files:
162+
1. Create the Kubernetes TLS secret for `tls.key` and `tls.crt` files
163+
from [wildcard certificate
164+
generation](#wildcard-certificate-generation):
165+
72166
```
73-
kubectl create -n feldera secret tls feldera-https-config --key tls.key --cert tls.crt
167+
kubectl create -n <namespace> secret tls feldera-https-config --key tls.key --cert tls.crt
74168
```
169+
75170
The secret (i.e., certificate and key) will be mounted as a directory with corresponding files
76171
by each of the Feldera component (API server, compiler, runner, pipelines) pods.
77172

78-
2. Provide in the Helm installation the reference for the `httpsSecretRef` value.
173+
2. To additionally support multihost pipelines, create a Kubernetes
174+
TLS secret for `private_ca.key` and `private_ca.crt` from [private
175+
CA certificate chain
176+
generation](#private-ca-certificate-chain-generation):
177+
178+
```
179+
kubectl create -n <namespace> secret tls feldera-ca-config --key private_ca.key --cert private_ca.crt
180+
```
181+
182+
3. Provide in the Helm installation the reference for the
183+
`httpsSecretRef` and, for multihost support, `caSecretRef`, value.
184+
185+
If you did not create the private CA for multihost pipeline support:
79186

80187
- **Via file `values.yaml`:**
81188
```
@@ -89,7 +196,24 @@ should only contain the single private key of the leaf certificate.
89196
--set httpsSecretRef="feldera-https-config"
90197
```
91198
92-
3. (Optional) Port forward:
199+
If you did create the private CA for multihost pipeline support:
200+
201+
202+
- **Via file `values.yaml`:**
203+
```
204+
httpsSecretRef: "feldera-https-config"
205+
caSecretRef: "feldera-ca-config"
206+
```
207+
208+
- **In the command:**
209+
```
210+
helm upgrade --install feldera \
211+
... \
212+
--set httpsSecretRef="feldera-https-config" \
213+
--set caSecretRef="feldera-ca-config"
214+
```
215+
216+
4. (Optional) Port forward:
93217
```
94218
kubectl port-forward -n feldera svc/feldera-api-server 8080:8080
95219
```

0 commit comments

Comments
 (0)