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`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to