[
https://issues.apache.org/jira/browse/KNOX-3364?focusedWorklogId=1027079&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1027079
]
ASF GitHub Bot logged work on KNOX-3364:
----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Jun/26 13:02
Start Date: 26/Jun/26 13:02
Worklog Time Spent: 10m
Work Description: hanicz opened a new pull request, #1282:
URL: https://github.com/apache/knox/pull/1282
…oad aliases from k8s secrets. Install jq in the container as well.
[KNOX-3364](https://issues.apache.org/jira/browse/KNOX-3364) - Bootstrap
Knox aliases from labeled Kubernetes Secrets on container startup
## What changes were proposed in this pull request?
Helper function to load Knox aliases from labeled Kubernetes Secrets. Uses
the pod's mounted ServiceAccount token to list Secrets in the pod's namespace
that carry KNOX_ALIAS_LABEL and feeds the names to `knoxcli create-k8s-alias`,
so aliases are restored on every pod restart. Skips silently when no
ServiceAccount token is mounted (non-k8s runs); logs a warning and continues on
API errors so Knox startup isn't blocked by transient cluster issues. Requires:
jq in the image; the pod's ServiceAccount must have list on Secrets in its
namespace.
- Installs jq on the container
## How was this patch tested?
Tested on a local kind cluster
Secrets:
```
---
apiVersion: v1
kind: Secret
metadata:
name: stringdatasecret
namespace: knox
labels:
knox.apache.org/alias: "true"
type: Opaque
stringData:
alias.name: my-alias2
topology: sandbox
alias.value: s3cr3t
---
apiVersion: v1
kind: Secret
metadata:
name: datasecret
namespace: knox
labels:
knox.apache.org/alias: "true"
type: Opaque
data:
alias.name: bXktYWxpYXM=
alias.value: czNjcjN0
```
`./bin/knoxcli.sh list-alias --cluster __gateway,sandbox`
Issue Time Tracking
-------------------
Worklog Id: (was: 1027079)
Remaining Estimate: 0h
Time Spent: 10m
> Bootstrap Knox aliases from labeled Kubernetes Secrets on container startup
> ---------------------------------------------------------------------------
>
> Key: KNOX-3364
> URL: https://issues.apache.org/jira/browse/KNOX-3364
> Project: Apache Knox
> Issue Type: New Feature
> Components: docker, Startup Scripts
> Affects Versions: 2.1.0
> Reporter: Tamás Hanicz
> Assignee: Tamás Hanicz
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)