feat(k9s): automatic danger skin for production clusters#128
Draft
feat(k9s): automatic danger skin for production clusters#128
Conversation
Co-authored-by: bdossantos <245284+bdossantos@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add awareness indicator for production clusters in k9s
feat(k9s): automatic danger skin for production clusters
Mar 11, 2026
Owner
|
@copilot is possible to achieve this via an alias or bash function ? |
Co-authored-by: bdossantos <245284+bdossantos@users.noreply.github.com>
Contributor
Author
Done in 577c8e0. Replaced if command -v k9s &>/dev/null; then
function k9s() {
local context
context="$(kubectl config current-context 2>/dev/null || true)"
if [[ -n "$context" && "${context,,}" == *prd* ]]; then
K9S_SKIN="${K9S_SKIN:-prd}" command k9s "$@"
else
command k9s "$@"
fi
}
fi
|
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.
k9s gives no visual indication when you're operating on a production cluster, making it easy to accidentally apply destructive changes.
Changes
.aliases— adds ak9sbash function that inspects the active kubectl context at launch time; if the context name containsprd(case-insensitive), it setsK9S_SKIN=prdfor that invocation before calling the real binary viacommand k9s..config/k9s/skins/prd.yml— red-tinted danger skin derived from the existing Dracula theme. Uses a dark red background (#1c0000), red borders, logo, and accent colours to make the production context immediately unmistakable..gitignore— adds!.config/k9s/skins/exception, consistent with the existing!.config/k9s/skin.ymlrule, so the new skins directory is tracked.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.