Updated k9s config
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -28,3 +28,7 @@
|
||||
/home/.kube/*
|
||||
!/home/.kube/clusters/.gitkeep
|
||||
!/home/.kube/switch-config.yaml
|
||||
|
||||
/home/.k9s/benchmarks
|
||||
/home/.k9s/clusters
|
||||
/home/.k9s/screen-dumps
|
||||
|
@@ -34,3 +34,6 @@ export DOCKER_HOST=$(docker context inspect --format='{{.Endpoints.docker.Host}}
|
||||
|
||||
# Brew - Prevent updating all packages when installing a new one
|
||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||
|
||||
# k9s
|
||||
export K9S_CONFIG_DIR="$HOME/.k9s"
|
||||
|
11
home/.k9s/aliases.yaml
Normal file
11
home/.k9s/aliases.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
aliases:
|
||||
dp: deployments
|
||||
sec: v1/secrets
|
||||
jo: jobs
|
||||
cr: clusterroles
|
||||
crb: clusterrolebindings
|
||||
ro: roles
|
||||
rb: rolebindings
|
||||
np: networkpolicies
|
||||
cl: cluster.x-k8s.io/v1beta1/clusters
|
||||
app: application.giantswarm.io/v1alpha1/apps
|
43
home/.k9s/config.yaml
Normal file
43
home/.k9s/config.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
k9s:
|
||||
liveViewAutoRefresh: false
|
||||
screenDumpDir: ${HOME}/.k9s/screen-dumps
|
||||
refreshRate: 2
|
||||
maxConnRetry: 5
|
||||
readOnly: false
|
||||
noExitOnCtrlC: false
|
||||
ui:
|
||||
enableMouse: false
|
||||
headless: false
|
||||
logoless: true
|
||||
crumbsless: false
|
||||
reactive: true
|
||||
noIcons: false
|
||||
skin: default
|
||||
skipLatestRevCheck: false
|
||||
disablePodCounting: false
|
||||
shellPod:
|
||||
image: busybox:1.35.0
|
||||
namespace: default
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
tty: true
|
||||
imageScans:
|
||||
enable: false
|
||||
exclusions:
|
||||
namespaces: []
|
||||
labels: {}
|
||||
logger:
|
||||
tail: 5000
|
||||
buffer: 50000
|
||||
sinceSeconds: 0
|
||||
fullScreen: false
|
||||
textWrap: false
|
||||
showTime: false
|
||||
thresholds:
|
||||
cpu:
|
||||
critical: 90
|
||||
warn: 80
|
||||
memory:
|
||||
critical: 90
|
||||
warn: 80
|
@@ -1,26 +0,0 @@
|
||||
k9s:
|
||||
refreshRate: 2
|
||||
maxConnRetry: 5
|
||||
enableMouse: false
|
||||
headless: false
|
||||
logoless: true
|
||||
crumbsless: false
|
||||
readOnly: false
|
||||
noIcons: false
|
||||
logger:
|
||||
tail: 5000
|
||||
buffer: 50000
|
||||
sinceSeconds: 0
|
||||
fullScreenLogs: false
|
||||
textWrap: false
|
||||
showTime: false
|
||||
currentContext:
|
||||
currentCluster:
|
||||
clusters: []
|
||||
thresholds:
|
||||
cpu:
|
||||
critical: 90
|
||||
warn: 80
|
||||
memory:
|
||||
critical: 90
|
||||
warn: 80
|
216
home/.k9s/plugins.yaml
Normal file
216
home/.k9s/plugins.yaml
Normal file
@@ -0,0 +1,216 @@
|
||||
plugins:
|
||||
sshnode:
|
||||
shortCut: s
|
||||
description: SSH via Teleport
|
||||
dangerous: false
|
||||
scopes:
|
||||
- nodes
|
||||
background: false
|
||||
command: bash
|
||||
args:
|
||||
- -c
|
||||
- tsh ssh root@cluster=$(echo "$CONTEXT" | rev | cut -d'-' -f1 | rev),node=$(echo "$NAME" | cut -d '.' -f 1)
|
||||
|
||||
aws:
|
||||
shortCut: w
|
||||
description: Open AWS Console
|
||||
dangerous: false
|
||||
scopes:
|
||||
- clusters
|
||||
- awsclusters
|
||||
background: false
|
||||
command: bash
|
||||
args:
|
||||
- -c
|
||||
- open "https://signin.aws.amazon.com/switchrole?account=$(kubectl --context ${CONTEXT} get awsclusterroleidentity $(kubectl --context ${CONTEXT} get awsclusters -n ${NAMESPACE} ${NAME} -o json | jq -r '.spec.identityRef.name') -o json | jq -r '.spec.roleARN | split(":")[4]')&roleName=GiantSwarmAdmin&displayName=${CONTEXT}+-+${NAME}"
|
||||
|
||||
clusterapps:
|
||||
shortCut: a
|
||||
description: List Apps
|
||||
dangerous: false
|
||||
scopes:
|
||||
- clusters
|
||||
background: false
|
||||
command: sh
|
||||
args:
|
||||
- -c
|
||||
- "viddy -n 5s 'kubectl get apps -n $NAMESPACE | grep $NAME'"
|
||||
|
||||
tree:
|
||||
shortCut: t
|
||||
description: Show Tree
|
||||
dangerous: false
|
||||
scopes:
|
||||
- clusters
|
||||
background: false
|
||||
command: sh
|
||||
args:
|
||||
- -c
|
||||
- "viddy -n 15s 'kubectl tree -n $NAMESPACE clusters.v1beta1.cluster.x-k8s.io $NAME'"
|
||||
|
||||
values:
|
||||
shortCut: v
|
||||
description: Show Values
|
||||
dangerous: false
|
||||
scopes:
|
||||
- clusters
|
||||
- apps
|
||||
background: false
|
||||
command: sh
|
||||
args:
|
||||
- -c
|
||||
- "kubectl get -o yaml cm ${NAME}-chart-values -n giantswarm | less"
|
||||
|
||||
# kubectl-blame by knight42
|
||||
# Annotate each line in the given resource's YAML with information from the managedFields to show who last modified the field.
|
||||
# Source: https://github.com/knight42/kubectl-blame
|
||||
# Install via:
|
||||
# krew: `kubectl krew install blame`
|
||||
# go: `go install github.com/knight42/kubectl-blame@latest`
|
||||
blame:
|
||||
shortCut: b
|
||||
confirm: false
|
||||
description: "Blame"
|
||||
scopes:
|
||||
- all
|
||||
command: sh
|
||||
background: false
|
||||
args:
|
||||
- -c
|
||||
- "kubectl-blame $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT | less"
|
||||
|
||||
# Suspends/Resumes a cronjob
|
||||
toggleCronjob:
|
||||
shortCut: Shift-S
|
||||
confirm: true
|
||||
scopes:
|
||||
- cj
|
||||
description: Toggle to suspend or resume a running cronjob
|
||||
command: kubectl
|
||||
background: true
|
||||
args:
|
||||
- patch
|
||||
- cronjobs
|
||||
- $NAME
|
||||
- -n
|
||||
- $NAMESPACE
|
||||
- --context
|
||||
- $CONTEXT
|
||||
- -p
|
||||
- '{"spec" : {"suspend" : $!COL-SUSPEND }}'
|
||||
|
||||
# Flux
|
||||
reconcile-git:
|
||||
shortCut: Shift-R
|
||||
confirm: false
|
||||
description: Flux reconcile
|
||||
scopes:
|
||||
- gitrepositories
|
||||
command: bash
|
||||
background: false
|
||||
args:
|
||||
- -c
|
||||
- >-
|
||||
flux
|
||||
reconcile source git
|
||||
--context $CONTEXT
|
||||
-n $NAMESPACE $NAME
|
||||
| less -K
|
||||
reconcile-hr:
|
||||
shortCut: Shift-R
|
||||
confirm: false
|
||||
description: Flux reconcile
|
||||
scopes:
|
||||
- helmreleases
|
||||
command: bash
|
||||
background: false
|
||||
args:
|
||||
- -c
|
||||
- >-
|
||||
flux
|
||||
reconcile helmrelease
|
||||
--context $CONTEXT
|
||||
-n $NAMESPACE $NAME
|
||||
| less -K
|
||||
reconcile-helm-repo:
|
||||
shortCut: Shift-R
|
||||
description: Flux reconcile
|
||||
scopes:
|
||||
- helmrepositories
|
||||
command: bash
|
||||
background: false
|
||||
confirm: false
|
||||
args:
|
||||
- -c
|
||||
- >-
|
||||
flux
|
||||
reconcile source helm
|
||||
--context $CONTEXT
|
||||
-n $NAMESPACE $NAME
|
||||
| less -K
|
||||
reconcile-oci-repo:
|
||||
shortCut: Shift-R
|
||||
description: Flux reconcile
|
||||
scopes:
|
||||
- ocirepositories
|
||||
command: bash
|
||||
background: false
|
||||
confirm: false
|
||||
args:
|
||||
- -c
|
||||
- >-
|
||||
flux
|
||||
reconcile source oci
|
||||
--context $CONTEXT
|
||||
-n $NAMESPACE $NAME
|
||||
| less -K
|
||||
reconcile-ks:
|
||||
shortCut: Shift-R
|
||||
confirm: false
|
||||
description: Flux reconcile
|
||||
scopes:
|
||||
- kustomizations
|
||||
command: bash
|
||||
background: false
|
||||
args:
|
||||
- -c
|
||||
- >-
|
||||
flux
|
||||
reconcile kustomization
|
||||
--context $CONTEXT
|
||||
-n $NAMESPACE $NAME
|
||||
| less -K
|
||||
|
||||
remove_finalizers:
|
||||
shortCut: Ctrl-F
|
||||
confirm: true
|
||||
scopes:
|
||||
- all
|
||||
description: |
|
||||
Removes all finalizers
|
||||
command: kubectl
|
||||
background: true
|
||||
args:
|
||||
- patch
|
||||
- --context
|
||||
- $CONTEXT
|
||||
- --namespace
|
||||
- $NAMESPACE
|
||||
- $RESOURCE_NAME.$RESOURCE_GROUP
|
||||
- $NAME
|
||||
- -p
|
||||
- '{"metadata":{"finalizers":null}}'
|
||||
- --type
|
||||
- merge
|
||||
|
||||
watch-events:
|
||||
shortCut: Shift-E
|
||||
confirm: false
|
||||
description: Watch Events
|
||||
scopes:
|
||||
- all
|
||||
command: sh
|
||||
background: false
|
||||
args:
|
||||
- -c
|
||||
- "kubectl events --context $CONTEXT --namespace $NAMESPACE --for $RESOURCE_NAME.$RESOURCE_GROUP/$NAME --watch"
|
Reference in New Issue
Block a user