Skip to content

Commit 3fc9756

Browse files
authored
chore: refactor non-docs examples (#912)
1 parent c5b3047 commit 3fc9756

File tree

6 files changed

+47
-70
lines changed

6 files changed

+47
-70
lines changed
File renamed without changes.
File renamed without changes.

examples/entra-static-nifi-policies/entra-redirect-uri.png renamed to docs/modules/nifi/assets/images/entraid/entra-redirect-uri.png

File renamed without changes.

examples/entra-static-nifi-policies/README-entra-example.md renamed to docs/modules/nifi/pages/usage_guide/entraid.adoc

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,47 @@
1-
# Examples
1+
= EntraID
2+
:description: Configure Apache NiFi to use EntraID for authentication and authorization.
23

3-
## Overview
4+
== Overview
45

5-
This note provides some explanatory information when running the EntraID example.
66
This example demonstrates how to provide a static set of RBAC permissions for users that are fetched from an EntraID backend.
77
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.
88
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.
99

10-
## Cluster
10+
xref:attachment$entraid-nifi.yaml[Download] the complete manifest of all objects created by this example and edit it according to the description in the next sections.
11+
12+
== Cluster
1113

1214
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.
1515

16-
```text
16+
Creates a new Kind cluster named `stackable-data-platform`.
17+
18+
[source,bash]
19+
----
1720
kind create cluster --name stackable-data-platform
21+
----
22+
23+
Install the latest Stackable Data Platform operators.
24+
25+
[source,bash]
26+
----
1827
stackablectl operator install commons secret listener nifi
19-
```
28+
----
2029

21-
## Prerequisites
30+
== Prerequisites
2231

2332
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.
2433

2534
Create a dedicated namespace in which to run the example:
2635

27-
```text
36+
[source,bash]
37+
----
2838
kubectl create namespace nifi
29-
```
39+
----
3040

3141
Apply a secret containing the following fields necessary for EntraID connectivity:
3242

33-
```yaml
34-
---
43+
[source,yaml]
44+
----
3545
apiVersion: v1
3646
kind: Secret
3747
metadata:
@@ -46,61 +56,67 @@ stringData:
4656
initial.admin.uuid: <ADMIN-UUID> # the Entra Admin user UUID
4757
initial.group.uuid: <GROUP-UUID> # the initial group UUID
4858
discovery.url: https://login.microsoftonline.com/<DIRECTORY-ID>/v2.0/.well-known/openid-configuration
49-
```
59+
----
5060

5161
Apply the NiFi cluster resource:
5262

53-
```text
63+
[source,bash]
64+
----
5465
kubectl apply -f examples/entra_nifi.yaml -n nifi
55-
```
66+
----
5667

57-
## Usage
68+
== Usage
5869

5970
Once the cluster is running, you will need to make a note of the listener endpoint.
6071
This can be found by inspecting the listener class:
6172

62-
```text
73+
[source,bash]
74+
----
6375
kubectl get listeners/test-nifi-node -n nifi -o yaml | yq '[.status][0] | ("https://" + .ingressAddresses[0].address + ":" + .nodePorts.https)'
64-
```
76+
----
6577

6678
which yields e.g.
6779

68-
```text
80+
[source,text]
81+
----
6982
https://172.19.0.3:31131
70-
```
83+
----
7184

7285
The web endpoint for app running against Entra needs to be updated with this endpoint as the prefix i.e.
7386

74-
![EntraID Web URI](entra-redirect-uri.png)
87+
image:entraid/entra-redirect-uri.png[EntraID Web URI]
7588

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.
89+
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 initial admin) and then redirected back to the NiFi UI.
7790
The UI opens up on a writable canvas, in this case with the UUID `ea060c65-019a-1000-766b-0854b414d37e`:
7891

79-
![NiFi canvas](canvas.png)
92+
image:entraid/canvas.png[NiFi canvas]
8093

8194
The initial admin has immediate access as the static `authorizations.xml` file provided via the ConfigMap defined this:
8295

83-
```xml
96+
[source,xml]
97+
----
8498
<policy identifier="c8d5a9ba-0199-1000-0000-00003d66cc46" resource="/data/process-groups/root" action="W">
8599
<user identifier="${env:INITIAL_ADMIN_UUID}"/>
86100
</policy>
87-
```
101+
----
88102

89103
and the `root` part of this has been updated with the actual root process group:
90104

91-
```xml
105+
[source,xml]
106+
----
92107
<policy identifier="c8d5a9ba-0199-1000-0000-00003d66cc46" resource="/data/process-groups/ea060c65-019a-1000-766b-0854b414d37e" action="W">
93108
<user identifier="${env:INITIAL_ADMIN_UUID}"/>
94109
</policy>
95-
```
110+
----
96111

97112
This requires that the following be set:
98113

99-
```yaml
114+
[source,yaml]
115+
----
100116
configOverrides:
101117
nifi.properties:
102118
...
103119
nifi.process.group.root.placeholder: "root"
104-
```
120+
----
105121

106122
so that it is clear which placeholder - if any - should be patched.

docs/modules/nifi/partials/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*** xref:nifi:usage_guide/operations/pod-placement.adoc[]
2323
*** xref:nifi:usage_guide/operations/pod-disruptions.adoc[]
2424
*** xref:nifi:usage_guide/operations/graceful-shutdown.adoc[]
25+
** xref:nifi:usage_guide/entraid.adoc[]
2526
* xref:nifi:troubleshooting/index.adoc[]
2627
* xref:nifi:reference/index.adoc[]
2728
** xref:nifi:reference/crds.adoc[]

examples/simple-cluster/simple-nifi-cluster.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)