Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K9s Release v0.29.0 #2326

Merged
merged 22 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2e9cf78
Feat: Move shell pod cluster config to general config
derailed Nov 21, 2023
304fde9
Fix #2290 - Add freebsd assets
derailed Nov 21, 2023
958ef58
Maintenance cleaning up
derailed Nov 21, 2023
86843cb
Fix #2166 - Add taint tracking column to node view
derailed Nov 23, 2023
9025631
Fix #2009: Update screendump file names to contain resource info
derailed Nov 23, 2023
bcfc9dc
Maintenance: Cleanup errror messages
derailed Nov 23, 2023
4511369
Fix #1513: Change log default to tail vs last 5min
derailed Nov 23, 2023
9675b17
Fix #2166: Add taint indicator on node view
derailed Nov 23, 2023
6fc3e63
Fix #2165: Track init co restarts
derailed Nov 23, 2023
1b1c240
Fix #2308: Fix rbac auth checks
derailed Nov 23, 2023
002a843
Fix #2036: Fix npe on filtering CRDs
derailed Nov 23, 2023
1b7c31a
Fix #2219: Turn on TTY option on shellpod
derailed Nov 23, 2023
2a8524b
Fix #2167: Update color escape sequence on copy
derailed Nov 23, 2023
fe7c970
Fix #2297: Enable multi select on nodes
derailed Nov 23, 2023
236f563
Cleanup headers
derailed Nov 24, 2023
338366e
Fix #2162: Allow edit when describing/viewing
derailed Nov 24, 2023
e8aa2a8
Feat: Add helm release history support
derailed Nov 25, 2023
8c3df98
Fix #2039: Command Arrow up/down + enter support
derailed Nov 25, 2023
5931ad0
Small refactor
derailed Nov 29, 2023
e334c77
Add img vulenerability scans support
derailed Dec 2, 2023
01fafca
Change skin loading and support
derailed Dec 4, 2023
3ea9221
Release v0.29.0 docs
derailed Nov 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# options for analysis running
run:
# default concurrency is a available CPU number
concurrency: 4
concurrency: 8

# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 1m
timeout: 5m

# exit code when at least one issue was found, default is 1
issues-exit-code: 1
Expand Down
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ builds:
- linux
- darwin
- windows
- freebsd
goarch:
- amd64
- arm64
Expand All @@ -33,6 +34,7 @@ archives:
darwin: Darwin
linux: Linux
windows: Windows
freebsd: FreeBSD
bit: Arm
bitv6: Arm6
bitv7: Arm7
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DATE ?= $(shell TZ=UTC date -j -f "%s" ${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:
else
DATE ?= $(shell date -u -d @${SOURCE_DATE_EPOCH} +"%Y-%m-%dT%H:%M:%SZ")
endif
VERSION ?= v0.28.2
VERSION ?= v0.29.0
IMG_NAME := derailed/k9s
IMAGE := ${IMG_NAME}:${VERSION}

Expand Down
84 changes: 46 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,16 @@ K9s uses aliases to navigate most K8s resources.

## K9s Configuration

K9s keeps its configurations inside of a `k9s` directory and the location depends on your operating system. K9s leverages [XDG](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) to load its various configurations files. For information on the default locations for your OS please see [this link](https://github.com/adrg/xdg/blob/master/README.md). If you are still confused a quick `k9s info` will reveal where k9s is loading its configurations from. Alternatively, you can set `K9SCONFIG` to tell K9s the directory location to pull its configurations from.
K9s keeps its configurations as YAML files inside of a `k9s` directory and the location depends on your operating system. K9s leverages [XDG](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) to load its various configurations files. For information on the default locations for your OS please see [this link](https://github.com/adrg/xdg/blob/master/README.md). If you are still confused a quick `k9s info` will reveal where k9s is loading its configurations from. Alternatively, you can set `K9SCONFIG` to tell K9s the directory location to pull its configurations from.

| Unix | macOS | Windows |
|-----------------|------------------------------------|-----------------------|
| `~/.config/k9s` | `~/Library/Application Support/k9s` | `%LOCALAPPDATA%\k9s` |

> NOTE: This is still in flux and will change while in pre-release stage!

> NOTE! Thanks to [Mr Alexandru Placenta](https://github.com/placintaalexandru) the config files can now use either `.yml` or `.yaml` mimes.

```yaml
# $XDG_CONFIG_HOME/k9s/config.yml
k9s:
Expand Down Expand Up @@ -350,8 +352,8 @@ K9s uses aliases to navigate most K8s resources.
tail: 200
# Defines the total number of log lines to allow in the view. Default 1000
buffer: 500
# Represents how far to go back in the log timeline in seconds. Setting to -1 will show all available logs. Default is 5min.
sinceSeconds: 300
# Represents how far to go back in the log timeline in seconds. Setting to -1 will tail logs. Default is -1.
sinceSeconds: 300 # => tail the last 5 mins.
# Go full screen while displaying logs. Default false
fullScreenLogs: false
# Toggles log line wrap. Default false
Expand All @@ -364,6 +366,18 @@ K9s uses aliases to navigate most K8s resources.
currentCluster: minikube
# KeepMissingClusters will keep clusters in the config if they are missing from the current kubeconfig file. Default false
KeepMissingClusters: false
# Provide shell pod customization when nodeShell feature gate is enabled!
shellPod:
# The shell pod image to use.
image: killerAdmin
# The namespace to launch to shell pod into.
namespace: default
# The resource limit to set on the shell pod.
limits:
cpu: 100m
memory: 100Mi
# Enable TTY
tty: true
# Persists per cluster preferences for favorite namespaces and view.
clusters:
coolio:
Expand All @@ -378,22 +392,7 @@ K9s uses aliases to navigate most K8s resources.
active: po
featureGates:
# Toggles NodeShell support. Allow K9s to shell into nodes if needed. Default false.
nodeShell: false
# Provide shell pod customization of feature gate is enabled
shellPod:
# The shell pod image to use.
image: killerAdmin
# The namespace to launch to shell pod into.
namespace: fred
# imagePullPolicy defaults to Always
imagePullPolicy: Always
# imagePullSecrets defaults to no secret
imagePullSecrets:
- name: my-regcred
# The resource limit to set on the shell pod.
limits:
cpu: 100m
memory: 100Mi
nodeShell: true
# The IP Address to use when launching a port-forward.
portForwardAddress: 1.2.3.4
kind:
Expand Down Expand Up @@ -424,25 +423,19 @@ By enabling the nodeShell feature gate on a given cluster, K9s allows you to she
```yaml
# $XDG_CONFIG_HOME/k9s/config.yml
k9s:
# You can also further tune the shell pod specification
shellPod:
image: cool_kid_admin:42
namespace: blee
limits:
cpu: 100m
memory: 100Mi
clusters:
# Configures node shell on cluster blee
blee:
featureGates:
# You must enable the nodeShell feature gate to enable shelling into nodes
nodeShell: true
# You can also further tune the shell pod specification
shellPod:
image: cool_kid_admin:42
namespace: blee
# imagePullPolicy defaults to Always
imagePullPolicy: Always
# imagePullSecrets defaults to no secret
imagePullSecrets:
- name: my-regcred
# The resource limit to set on the shell pod.
limits:
cpu: 100m
memory: 100Mi
```

---
Expand Down Expand Up @@ -809,21 +802,36 @@ Example: Dracula Skin ;)

<img src="assets/skins/dracula.png" alt="Dracula Skin">

You can style K9s based on your own sense of look and style. Skins are YAML files, that enable a user to change the K9s presentation layer. K9s skins are loaded from `$XDG_CONFIG_HOME/k9s/skin.yml`. If a skin file is detected then the skin would be loaded if not the current stock skin remains in effect.
You can style K9s based on your own sense of look and style. Skins are YAML files, that enable a user to change the K9s presentation layer. K9s default skin is loaded from `$XDG_CONFIG_HOME/k9s/skin.yml`. If a skin file is detected then the skin will be loaded if not the current stock skin remains in effect.

You can also change K9s skins based on the cluster you are connecting too. In this case, you can specify the skin file name as `$XDG_CONFIG_HOME/k9s/mycontext_skin.yml`
Below is a sample skin file, more skins are available in the skins directory in this repo, just simply copy any of these in your user's home dir as `skin.yml`.
You can also change K9s skins based on the cluster you are connecting too. In this case, you can specify a skin field on your cluster config aka `skin: dracula` (just the name of the skin!) and copy this repo skins/dracula.yml to `$XDG_CONFIG_HOME/k9s/skins` directory.
Below is a sample skin file, more skins are available in the skins directory in this repo, just simply copy any of these in your k9s home dir as `skin.yml`.

Colors can be defined by name or using a hex representation. Of recent, we've added a color named `default` to indicate a transparent background color to preserve your terminal background color settings if so desired.

> NOTE: This is very much an experimental feature at this time, more will be added/modified if this feature has legs so thread accordingly!


> NOTE: Please see [K9s Skins](https://k9scli.io/topics/skins/) for a list of available colors.

```yaml
# Make cluster fred display in_the_navy skin when loaded...
k9s:
...
clusters:
fred:
# Override the default skin and use this skin for this cluster.
# NOTE: Just the skin file name to extension!
skin: in_the_navy # -> Look for a skin file in ~/.config/k9s/skins/in_the_navy.yml
namespace:
...
view:
active: pod
featureGates:
nodeShell: false
portForwardAddress: localhost
```

```yaml
# Skin InTheNavy...
# in_the_navy.yml: Skin InTheNavy...
k9s:
# General K9s styles
body:
Expand Down
212 changes: 212 additions & 0 deletions change_logs/release_v0.29.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/k9s.png" align="center" width="800" height="auto"/>

# Release v0.29.0

## Notes

Thank you to all that contributed with flushing out issues and enhancements for K9s!
I'll try to mark some of these issues as fixed. But if you don't mind grab the latest rev
and see if we're happier with some of the fixes!
If you've filed an issue please help me verify and close.

Your support, kindness and awesome suggestions to make K9s better are, as ever, very much noted and appreciated!
Also big thanks to all that have allocated their own time to help others on both slack and on this repo!!

As you may know, K9s is not pimped out by corps with deep pockets, thus if you feel K9s is helping your Kubernetes journey,
please consider joining our [sponsorship program](https://github.com/sponsors/derailed) and/or make some noise on social! [@kitesurfer](https://twitter.com/kitesurfer)

On Slack? Please join us [K9slackers](https://join.slack.com/t/k9sers/shared_invite/enQtOTA5MDEyNzI5MTU0LWQ1ZGI3MzliYzZhZWEyNzYxYzA3NjE0YTk1YmFmNzViZjIyNzhkZGI0MmJjYzhlNjdlMGJhYzE2ZGU1NjkyNTM)

---

## ♫ Sounds Behind The Release ♭

* [Snowbound - Donald Fagen](https://www.youtube.com/watch?v=bj8ZdBdKsfo)
* [Pilgrim - Eric Clapton](https://www.youtube.com/watch?v=8V9tSQuIzbQ)
* [Lucky Number - Lene Lovich](https://www.youtube.com/watch?v=KnIJOO__jVo)

---

## 🦃 Happy (Belated!) ThanksGiving To All! 🦃

Hope you and yours had a wonderful holiday!!
Hopefully this drop won't be a cold turkey 😳

I'd like to take this opportunity to honor two very special folks:

* [Alexandru Placinta](https://github.com/placintaalexandru)
* [Jayson Wang](https://github.com/wjiec)

These guys have been relentless in fishing out bugs, helping out with support and addressing issues, not to mention enduring my code! 🙀
They dedicate a lot of their time to make `k9s` better for all of us!
So if you happen to run into them live/virtual, please be sure to `Thank` them and give them a huge hug! 🤗

I am thankful for all of you for being kind, patient, understanding and one of the coolest OSS community on the web!!

Feeling blessed and ever so humbled to be part of it.

Thank you!!

---

## A Word From Our Sponsors...

To all the good folks below that opted to `pay it forward` and join our sponsorship program, I salute you!!

* [Marco Stuurman](https://github.com/fe-ax)
* [Paul Sweeney](https://github.com/Kolossi)
* [Cayla Fauver](https://github.com/cayla)
* [alemanek](https://github.com/alemanek)
* [Danske Commodities A/S](https://github.com/DanskeCommodities)

> Sponsorship cancellations since the last release: **8** ;(

---

## 🎉 Feature Release 🎈👯

---

### Breaking Bad!

WARNING! There are breaking change on this drop!

1. NodeShell configuration has moved up in the k9s config file from the context section to the top level config.
More than likely, one uses the same nodeShell image with all the fixins to introspect nodes no matter the cluster. This update DRY's up k9s config and still allows one to opt in/out of nodeShell via the context specific feature gate.
Please see README for the details.

> NOTE: If you haven't customize the shellPod images on your contexts, the app will move the nodeShell config section to
> it's new location and update your clusters information accordingly.
> If not, you will need to edit the nodeShell section and manage it from a single location!

1. Log view used to default to the last 5mins aka `sinceSeconds: 300`.
Changed the default to tail logs instead aka `sinceSeconds: -1`

1. Skins loading changed! In this release, we do away with the context specific skin files. You can now directly specify the skin to use for a given cluster directly in the k9s config file under the cluster configuration. K9s now expects a skins directory in the k9s config home with your skin files. You can use your custom skins and copy them to the `skins` directory or use the contributes skins found on this repo root.
Specify the name of the skin in the config file and now your cluster will load the specified skin.

For example: create a `skins` dir your k9s config home and add one_dark.yml skin file from this repo. Then edit your k9s config file as follows:

```yaml
k9s:
...
clusters:
fred:
# Override the default skin and use this skin for this cluster.
skin: one_dark # -> Look for a skin file in ~/.config/k9s/skins/one_dark.yml
namespace:
...
view:
active: pod
featureGates:
nodeShell: false
portForwardAddress: localhost
```

The `fred` cluster will now load with the specified skin name. Rinse and repeat for other clusters of your liking. In the case where neither the skin dir or skin file are present, k9s will still honor the global skin aka `skin.yml` in your k9s config home directory to skin all your clusters.

---

### Walk Of SHelm...

Added a `Releases` view to Helm!

This provides the ability for Helm users to manage their releases directly from k9s.
You can now press `enter` on a selected Helm install and view all associated releases.
While in the releases view, you can also rollback an install to a previous revision.

---

### Spock! Are You Out Of Your VulScan Mind?

Tired of having malignent folks shoot holes in your prod clusters or failing compliance testing?

Added ability to run image vulnerability scans directly from k9s. You can now monitor your security stance in dev/staging/... clusters
prior to proclaiming `It's Open Season...` in prod!

As it stands Pod, Deployment, StatefulSet, DaemonSet, CronJob, Job views will feature a new column for Vulnerability Scan aka `VS`.

> NOTE! This feature is gated so you'll need to manually opt in/out by modifying your k9s config file like so:

```yaml
k9s:
liveViewAutoRefresh: false
enableImageScan: true # <- Yes Please!!
headless: false
...
```

Once enabled, a new column `VS` (aka Vulnerability Score) should be present on the aforementioned views where you will see your vulnerability scores (*Still work in progress!!*).
The `VS` column displays a bit vector aka Sev-1|Sev-2|Sev-3|Sev-4|Sev-5|Sev-Unknown. When the bit is high it indicate the presence of the severity in the scans. Higher order bits = Higher severity
For instance, the following vector `110001` indicates the presence of both critical (Sev-1) and high (Sev-2) and an unclassified severity (aka Sev-Unknown) issues in the scan. Sev-U indicates no classification currently exist in our vulnerability database.

The image scans are run async, rendering the views eventually consistent, hence you may have to give the scores a few cycles for the dust to settle...
Once the caches are primed, subsequent loads should be faster 🤞

You can sort the views by vulnerability score using `ShiftV`.
Additionally, you can view the full scans report by pressing `v` on a selected resource.

I've synced my entire Thanksgiving holiday break on this ding dang deal, so hopefully it works for most of you??
Also if you dig this new feature, please make some noise! 😍

💘 This is an experimental feature and likely will require additional TLC 💘

> NOTE! The lib we use to scan for vulnerabilities only supports macOS and Linux!!
> NOTE: I have yet to test this feature on larger clusters, so likely this may break??
> Please take these reports with a grain of salt as likely your mileage will vary and help us
> validate the accuracy of the report ie if we cry `Wolf`, is it actually there?

The paint is still fresh on this deal!!

### Do You Tube?

My plan is to begin (again!) putting out short k9s episodes with how-tos, tips, tricks and features previews.

Please dial [K9s Channel](https://www.youtube.com/channel/UC897uwPygni4QIjkPCpgjmw) for up coming content...

The first drop should be up by the time you read this!

* [Vulnerability Scans](https://youtu.be/ULkl0MsaidU)

---

## Resolved Issues

* [#2308](https://github.com/derailed/k9s/issues/2308) Unable to list CRs for crd with only list and get verb without watch verb
* [#2301](https://github.com/derailed/k9s/issues/2301) Add imagePullPolicy and imagePullSecrets on shell_pod for internal registry uses
* [#2298](https://github.com/derailed/k9s/issues/2298) Weird color after plugin usage
* [#2297](https://github.com/derailed/k9s/issues/2297) Select nodes with space does not work anymore
* [#2290](https://github.com/derailed/k9s/issues/2290) Provide release assets for freebsd amd64/arm64
* [#2283](https://github.com/derailed/k9s/issues/2283) Adding auto complete in search bar
* [#2219](https://github.com/derailed/k9s/issues/2219) Add tty: true to the node shell pod manifest
* [#2167](https://github.com/derailed/k9s/issues/2167) Show wrong Configmap data
* [#2166](https://github.com/derailed/k9s/issues/2166) Taint count for the nodes view
* [#2165](https://github.com/derailed/k9s/issues/2165) Restart counter for init containers
* [#2162](https://github.com/derailed/k9s/issues/2162) Make edit work when describing a resource
* [#2154](https://github.com/derailed/k9s/issues/2154) Help and h command does not work if typed into cmdbuff
* [#2036](https://github.com/derailed/k9s/issues/2036) Crashed while do filtering
* [#2009](https://github.com/derailed/k9s/issues/2009) Ctrl-s: Name of file (Describe-....)
* [#1513](https://github.com/derailed/k9s/issues/1513) Problem regarding showing the logs - it hangs/slow on pods which are running for long time
NOTE: Better but not cured! Perf improvements while viewing large cm (7k lines) from 26s->9s
* [#568](https://github.com/derailed/k9s/issues/568) Allow both .yaml and .yml yaml config files

---

## Contributed PRs

Please be sure to give `Big Thanks!` and `ATTA Girls/Boys!` to all the fine contributors for making K9s better for all of us!!

* [#2322](https://github.com/derailed/k9s/pull/2322) Check if the service provides selectors
* [#2319](https://github.com/derailed/k9s/pull/2319) Proper handling of help commands (fixes #2154)
* [#2315](https://github.com/derailed/k9s/pull/2315) Fix namespace suggestion error on context switch
* [#2313](https://github.com/derailed/k9s/pull/2313) Should not clear screen when executing plugin command
* [#2310](https://github.com/derailed/k9s/pull/2310) chore: Mot recommended to use k8s.io/kubernetes as a dependency
* [#2303](https://github.com/derailed/k9s/pull/2303) Clean up items
* [#2301](https://github.com/derailed/k9s/pull/2301) feat: Add imagePullSecrets and imagePullPolicy configuration for shellpod
* [#2289](https://github.com/derailed/k9s/pull/2289) Clean up issues introduced in #2125
* [#2288](https://github.com/derailed/k9s/pull/2288) Fix merge issues from PR #2168
* [#2284](https://github.com/derailed/k9s/issues/2284) Allow both .yaml and .yml yaml config files

---

<img src="https://raw.githubusercontent.com/derailed/k9s/master/assets/imhotep_logo.png" width="32" height="auto"/> © 2023 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0)
Loading