HDDS-14343. Apache Knox integration documentation and Docker Compose demo#490
Conversation
…demo. Document Knox configuration for Ozone UIs and HttpFS, add a runnable compose stack with browser-login fix, and link the integration from the homepage and HttpFS guide. Co-authored-by: Cursor <cursoragent@cursor.com>
|
I had Cursor follow the documented steps and verified correctness. |
chihsuan
left a comment
There was a problem hiding this comment.
Thanks for adding this guide! @jojochuang
I tested the full quickstart locally and confirmed that the Compose stack, Knox authentication, Ozone UIs, and HttpFS endpoint work as documented.
I left a few inline comments, mostly around version requirements and HttpFS identity handling. Overall, the integration looks great.
|
|
||
| **TODO:** File a subtask under [HDDS-9859](https://issues.apache.org/jira/browse/HDDS-9859) and complete this page or section. | ||
| **TODO:** Uncomment link to this page in src/pages/index.js | ||
| [Apache Knox](https://knox.apache.org/) is a reverse proxy gateway for Hadoop ecosystem REST APIs and web UIs. Knox 2.0.0 and later can proxy Ozone services, giving users a single HTTPS entry point while hiding internal cluster hostnames and ports. |
There was a problem hiding this comment.
OZONE-HTTPFS is not available in Knox 2.0.0. It was added by KNOX-2914 (apache/knox#765) after the 2.0.0 release, and the service definition first appears in the v2.1.0 tag.
Could we require Knox 2.1.0 here, or clarify that 2.0.0 supports the Ozone UIs while HttpFS proxying requires 2.1.0?
There was a problem hiding this comment.
Fixed in eb709d3. Split the intro and prerequisites: Knox 2.0.0+ for Ozone UIs (OM/SCM/Recon), Knox 2.1.0+ when proxying HttpFS (KNOX-2914).
| <<: *common-config | ||
| CORE-SITE.XML_fs.defaultFS: ofs://om | ||
| CORE-SITE.XML_httpfs.proxyuser.knoxuser.hosts: "*" | ||
| CORE-SITE.XML_httpfs.proxyuser.knoxuser.groups: "*" |
There was a problem hiding this comment.
These variables are converted into properties in core-site.xml, but Ozone HttpFS loads its server settings from httpfs-default.xml and httpfs-site.xml.
HttpFSAuthenticationFilter#getProxyuserConfiguration() reads httpfs.proxyuser.* from that HttpFS configuration, so these properties will not take effect here. Should these use the HTTPFS-SITE.XML_ prefix instead, or should the compose stack mount an httpfs-site.xml?
There was a problem hiding this comment.
Fixed in eb709d3. Added conf/httpfs-site.xml with the proxy-user settings and mount it on the HttpFS service at /opt/hadoop/etc/hadoop/httpfs-site.xml. Removed the incorrect CORE-SITE.XML_httpfs.proxyuser.* env vars and updated the doc accordingly.
|
|
||
| # Optional image that bakes the Ozone topology into the official Knox gateway | ||
| # image. The default docker-compose.yaml mounts the topology instead. | ||
| FROM apache/knox:latest |
There was a problem hiding this comment.
nit: should we consider pinning to a verified version (e.g. apache/knox:2.1.0) instead of latest, so the documented steps don't silently break on a future Knox major release?
Same for the KNOX_IMAGE_VERSION:-latest default in docker-compose.yaml.
There was a problem hiding this comment.
Fixed in eb709d3. Default KNOX_IMAGE_VERSION is now 2.1.0 in compose (still overridable via env var). The optional Dockerfile pins apache/knox:2.1.0 as well.
|
|
||
| ```bash | ||
| curl -ik -u guest:guest-password \ | ||
| "https://localhost:8443/gateway/ozone/httpfs/v1/?op=LISTSTATUS&user.name=hadoop" |
There was a problem hiding this comment.
nit: This section (general usage, above the Docker quickstart) uses https://localhost:8443 while the surrounding examples use <knox-host>. Would it make sense to use <knox-host> here too?
There was a problem hiding this comment.
Fixed in eb709d3. Updated the general-usage curl example to use https://<knox-host>:8443 for consistency.
| "https://localhost:8443/gateway/ozone/httpfs/v1/?op=LISTSTATUS&user.name=hadoop" | ||
| ``` | ||
|
|
||
| The `user.name` parameter specifies the Ozone user to impersonate. Knox authenticates the caller; HttpFS performs the operation as the proxied user. |
There was a problem hiding this comment.
I tested the compose stack locally, and the HttpFS access log shows Knox rewrites user.name to the authenticated Knox user regardless of what the client sends:
GET /webhdfs/v1/?op=LISTSTATUS&user.name=guest
This is the request HttpFS received, even though the client sent user.name=hadoop. So "The user.name parameter specifies the Ozone user to impersonate" isn't accurate in this setup.
| The `user.name` parameter specifies the Ozone user to impersonate. Knox authenticates the caller; HttpFS performs the operation as the proxied user. | |
| The `user.name` parameter specifies the Ozone user to impersonate. Knox authenticates access to the gateway, while this quickstart’s HttpFS backend uses the `user.name` query parameter through pseudo authentication. |
There was a problem hiding this comment.
Fixed in eb709d3. Replaced the impersonation paragraph with your suggested wording about Knox rewriting user.name to the authenticated Knox user.
| OZONE-SITE.XML_hdds.scm.safemode.healthy.pipeline.pct: "0" | ||
| no_proxy: om,recon,scm,s3g,httpfs,knox-ldap,knox-gateway,localhost,127.0.0.1 | ||
|
|
||
| version: "3" |
There was a problem hiding this comment.
nit: Docker Compose v2 treats the top-level version field as obsolete and ignores it with a warning. We can probably remove this.
https://docs.docker.com/reference/compose-file/version-and-name/
There was a problem hiding this comment.
Fixed in eb709d3. Removed the top-level version: "3" field.
Split Knox 2.0.0 (UIs) vs 2.1.0 (HttpFS) requirements, mount httpfs-site.xml for proxy-user settings, default Knox image to 2.1.0, and fix HttpFS impersonation wording and curl example consistency. Co-authored-by: Cursor <cursoragent@cursor.com>
Match the license comment format used by the other compose XML files so the static license CI check passes. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Merged. Thanks for review, @chihsuan |
Summary
static/compose/knox-ozone/.knoxsso.xmlwith LDAP pointed at theknox-ldapservice (default image topology useslocalhost).Jira
https://issues.apache.org/jira/browse/HDDS-14343
Test plan
pnpm buildpasses with no broken linkspnpm exec yamllint static/compose/knox-ozone/docker-compose.yamlpassesdocker compose up -d --scale datanode=1instatic/compose/knox-ozone/starts all servicesguest/guest-password?host=http://...)LISTSTATUSworks through Knox at/gateway/ozone/httpfs/v1/