Skip to content

Commit 4ff5496

Browse files
authored
docs: Add an example with Entra as backend (#877)
* example with Entra as backend * removed file-based example * added readme * bump example to 2.6.0 * added purpose comment * revert changes to sources.json * use placeholders for initial admin and group UUIDs * reworked examples folder
1 parent 48f6787 commit 4ff5496

File tree

5 files changed

+411
-0
lines changed

5 files changed

+411
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Examples
2+
3+
## Overview
4+
5+
This note provides some explanatory information when running the EntraID example.
6+
This example demonstrates how to provide a static set of RBAC permissions for users that are fetched from an EntraID backend.
7+
The user- and group-identifiers are those used by EntraID, but other UUIDs - such as for the policy identifiers - are automatically generated when required by Apache NiFi or are honoured if UUIDs (which are unique, after all) are provided.
8+
It is often helpful if the initial (or "root") process group is readable by the initial admin, and the NiFi code has been patched to make this possible.
9+
10+
## Cluster
11+
12+
Create a new local cluster (e.g. with [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/) and the [stackablectl tool](https://github.com/stackabletech/stackablectl)).
13+
This creates a cluster named `stackable-data-platform`.
14+
Install the operators required by the example.
15+
16+
```text
17+
kind create cluster --name stackable-data-platform
18+
stackablectl operator install commons secret listener nifi
19+
```
20+
21+
## Prerequisites
22+
23+
This example assumes that an EntraID backend is available and that an Application (in this example, Nifi-Entra-Test) has been configured with a web redirect URI.
24+
25+
Create a dedicated namespace in which to run the example:
26+
27+
```text
28+
kubectl create namespace nifi
29+
```
30+
31+
Apply a secret containing the following fields necessary for EntraID connectivity:
32+
33+
```yaml
34+
---
35+
apiVersion: v1
36+
kind: Secret
37+
metadata:
38+
name: oidc-secret
39+
stringData:
40+
auth.endpoint: https://login.microsoftonline.com
41+
directory.id: <DIRECTORY-ID>
42+
client.id: <CLIENT-ID>
43+
client.secret: <CLIENT-SECRET>
44+
filter.prefix: <FILTER-PREFIX> # e.g. Nifi-Entra
45+
initial.admin: <INIT-ADMIN> # an existing EntraID user
46+
initial.admin.uuid: <ADMIN-UUID> # the Entra Admin user UUID
47+
initial.group.uuid: <GROUP-UUID> # the initial group UUID
48+
discovery.url: https://login.microsoftonline.com/<DIRECTORY-ID>/v2.0/.well-known/openid-configuration
49+
```
50+
51+
Apply the NiFi cluster resource:
52+
53+
```text
54+
kubectl apply -f examples/entra_nifi.yaml -n nifi
55+
```
56+
57+
## Usage
58+
59+
Once the cluster is running, you will need to make a note of the listener endpoint.
60+
This can be found by inspecting the listener class:
61+
62+
```text
63+
kubectl get listeners/test-nifi-node -n nifi -o yaml | yq '[.status][0] | ("https://" + .ingressAddresses[0].address + ":" + .nodePorts.https)'
64+
```
65+
66+
which yields e.g.
67+
68+
```text
69+
https://172.19.0.3:31131
70+
```
71+
72+
The web endpoint for app running against Entra needs to be updated with this endpoint as the prefix i.e.
73+
74+
![EntraID Web URI](entra-redirect-uri.png)
75+
76+
Paste this endpoint into the browser and you will be directed to the Azure portal login portal (to enter the credentials for the user designated as the intiial admin) and then redirected back to the NiFi UI.
77+
The UI opens up on a writable canvas, in this case with the UUID `ea060c65-019a-1000-766b-0854b414d37e`:
78+
79+
![NiFi canvas](canvas.png)
80+
81+
The initial admin has immediate access as the static `authorizations.xml` file provided via the ConfigMap defined this:
82+
83+
```xml
84+
<policy identifier="c8d5a9ba-0199-1000-0000-00003d66cc46" resource="/data/process-groups/root" action="W">
85+
<user identifier="${env:INITIAL_ADMIN_UUID}"/>
86+
</policy>
87+
```
88+
89+
and the `root` part of this has been updated with the actual root process group:
90+
91+
```xml
92+
<policy identifier="c8d5a9ba-0199-1000-0000-00003d66cc46" resource="/data/process-groups/ea060c65-019a-1000-766b-0854b414d37e" action="W">
93+
<user identifier="${env:INITIAL_ADMIN_UUID}"/>
94+
</policy>
95+
```
96+
97+
This requires that the following be set:
98+
99+
```yaml
100+
configOverrides:
101+
nifi.properties:
102+
...
103+
nifi.process.group.root.placeholder: "root"
104+
```
105+
106+
so that it is clear which placeholder - if any - should be patched.
42.5 KB
Loading
94.3 KB
Loading

0 commit comments

Comments
 (0)