Skip to content

Commit 4c857f2

Browse files
committed
testing docs
1 parent 8ad6314 commit 4c857f2

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,30 @@ Group mappings are resolved on the NameNode and the following configuration shou
6666
## Testing
6767

6868
CRDs for spinning up test infrastructure are provided in `test/stack`. The Tiltfile will deploy these resources, build and copy the mapper to the docker image, and re-deploy the image to the running HdfsCluster.
69+
70+
The group mapping can be verified by shelling into the namenode, requesting a kerberos ticket and then calling `hdfs groups` for the namenode user:
71+
72+
```shell
73+
klist -k /stackable/kerberos/keytab
74+
kinit -kt /stackable/kerberos/keytab nn/simple-hdfs.default.svc.cluster.local@CLUSTER.LOCAL
75+
klist
76+
77+
# N.B. hadoop will replace the realm placeholder with the env-var automatically but this must be done manually if shelling into the container:
78+
export KERBEROS_REALM=$(grep -oP 'default_realm = \K.*' /stackable/kerberos/krb5.conf)
79+
cat /stackable/config/namenode/core-site.xml | sed -e 's/${env.KERBEROS_REALM}/'"$KERBEROS_REALM/g" > /stackable/config/namenode/core-site2.xml
80+
mv /stackable/config/namenode/core-site2.xml /stackable/config/namenode/core-site.xml
81+
82+
bin/hdfs groups
83+
```
84+
85+
The last command will yield something like this:
86+
```shell
87+
nn/simple-hdfs.default.svc.cluster.local@CLUSTER.LOCAL : admin superuser
88+
```
89+
and the Hadoop logs will show that the lookup has taken place:
90+
91+
```
92+
- Calling StackableGroupMapper.getGroups for user [nn]
93+
- Opa response [{"result":{"groups":{"groups":["/admin","/superuser"]},"users_by_name":{"alice":{"customAttributes":{},"groups":["/superset-admin"],"id":"af07f12c-1234-40a7-93e0-874537bdf3f5","username":"alice"},"bob":{"customAttributes":{},"groups":["/admin"],"id":"af07f12c-2345-40a7-93e0-874537bdf3f5","username":"bob"},"nn":{"customAttributes":{},"groups":["/admin","/superuser"],"id":"af07f12c-7890-40a7-93e0-874537bdf3f5","username":"nn"},"stackable":{"customAttributes":{},"groups":["/admin","/superuser"],"id":"af07f12c-3456-40a7-93e0-874537bdf3f5","username":"stackable"}}}}
94+
- Groups for [nn]: [[admin, superuser]]
95+
```

0 commit comments

Comments
 (0)