plugins.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. # $XDG_CONFIG_HOME/k9s/plugin.yml
  2. # check your env, XDG_CONFIG_HOME should be defined as ~/.config
  3. # move selected line to chosen resource in K9s, then:
  4. # Shift-T (with confirmation) to toggle helm releases or kustomizations suspend and resume
  5. # Shift-R (no confirmation) to reconcile a git source or a helm release or a kustomization
  6. plugins:
  7. toggle-helmrelease:
  8. shortCut: Shift-T
  9. confirm: true
  10. scopes:
  11. - helmreleases
  12. description: Toggle to suspend or resume a HelmRelease
  13. command: sh
  14. background: false
  15. args:
  16. - -c
  17. - "flux $([ $(kubectl get helmreleases -n $NAMESPACE $NAME -o=custom-columns=TYPE:.spec.suspend | tail -1) = \"true\" ] && echo \"resume\" || echo \"suspend\") helmrelease -n $NAMESPACE $NAME | less"
  18. toggle-kustomization:
  19. shortCut: Shift-T
  20. confirm: true
  21. scopes:
  22. - kustomizations
  23. description: Toggle to suspend or resume a Kustomization
  24. command: sh
  25. background: false
  26. args:
  27. - -c
  28. - "flux $([ $(kubectl get kustomizations -n $NAMESPACE $NAME -o=custom-columns=TYPE:.spec.suspend | tail -1) = \"true\" ] && echo \"resume\" || echo \"suspend\") kustomization -n $NAMESPACE $NAME | less"
  29. reconcile-git:
  30. shortCut: Shift-R
  31. confirm: false
  32. description: Flux reconcile
  33. scopes:
  34. - gitrepositories
  35. command: sh
  36. background: false
  37. args:
  38. - -c
  39. - "flux reconcile source git -n $NAMESPACE $NAME | less"
  40. reconcile-hr:
  41. shortCut: Shift-R
  42. confirm: false
  43. description: Flux reconcile
  44. scopes:
  45. - helmreleases
  46. command: sh
  47. background: false
  48. args:
  49. - -c
  50. - "flux reconcile helmrelease -n $NAMESPACE $NAME --with-source | less"
  51. reconcile-ks:
  52. shortCut: Shift-R
  53. confirm: false
  54. description: Flux reconcile
  55. scopes:
  56. - kustomizations
  57. command: sh
  58. background: false
  59. args:
  60. - -c
  61. - "flux reconcile kustomization -n $NAMESPACE $NAME --with-source | less"
  62. terraform-state:
  63. shortCut: Shift-S
  64. confirm: false
  65. description: Terraform show state
  66. scopes:
  67. - secrets
  68. command: sh
  69. background: false
  70. args:
  71. - -c
  72. - "kubectl -n $NAMESPACE get -o json secret $NAME | jq .data.tfstate --raw-output | base64 -d | gzip -d | less"
  73. getall-ns:
  74. shortCut: Shift-G
  75. confirm: false
  76. description: Get All Resources in NS
  77. scopes:
  78. - namespaces
  79. command: sh
  80. background: false
  81. args:
  82. - -c
  83. - "kubectl get all -n $NAME | less"
  84. cert:
  85. shortCut: Shift-T
  86. confirm: false
  87. description: Show certificate in secret
  88. scopes:
  89. - secrets
  90. command: sh
  91. background: false
  92. args:
  93. - -c
  94. - kubectl -n $NAMESPACE get -o json secret $NAME | jq '.data["tls.crt"]' --raw-output | base64 -d | openssl x509 -text | less
  95. # velero-describe:
  96. # shortCut: Shift-D
  97. # confirm: false
  98. # description: Describe Velero Backup
  99. # scopes:
  100. # - backups
  101. # command: sh
  102. # background: false
  103. # args:
  104. # - -c
  105. # - "velero backup describe $NAME --details --colorized true --features=EnableCSI | less"
  106. # velero-logs:
  107. # shortCut: Shift-L
  108. # confirm: false
  109. # description: Logs Velero Backup
  110. # scopes:
  111. # - backups
  112. # command: sh
  113. # background: false
  114. # args:
  115. # - -c
  116. # - "velero backup logs $NAME --colorized true --features=EnableCSI | less"
  117. # viddy-describe:
  118. # shortCut: Shift-V
  119. # confirm: false
  120. # description: Describe resource with viddy watching
  121. # scopes:
  122. # - all
  123. # command: sh
  124. # background: false
  125. # args:
  126. # - -c
  127. # - "viddy --differences kubectl describe -n $NAMESPACE $NAME"
  128. # neat-em-all:
  129. # shortCut: Shift-N
  130. # confirm: false
  131. # description: Neatly export a resource
  132. # scopes:
  133. # - all
  134. # command: sh
  135. # background: false
  136. # args:
  137. # - -c
  138. # - "kubectl get all -n $NAME | less"
  139. # kubectl get pod kube-prometheus-node-exporter-v78xp -o yaml |k neat