KNOX-3364: New loadAliasesFromK8sSecrets method in entrypoint.sh to l…#1282
Open
hanicz wants to merge 1 commit into
Open
KNOX-3364: New loadAliasesFromK8sSecrets method in entrypoint.sh to l…#1282hanicz wants to merge 1 commit into
hanicz wants to merge 1 commit into
Conversation
…oad aliases from k8s secrets. Install jq in the container as well.
Test Results28 tests 28 ✅ 3s ⏱️ Results for commit 9651977. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…oad aliases from k8s secrets. Install jq in the container as well.
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.How was this patch tested?
Tested on a local kind cluster, tested by just running without k8s, tested with no secrets, tested with different labels
Secrets:
./bin/knoxcli.sh list-alias --cluster __gateway,sandbox