-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 1875-make-menu-foreground-brighter
- Loading branch information
Showing
225 changed files
with
4,207 additions
and
1,731 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: K9s Lint | |
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
branches: [ master ] | ||
|
||
jobs: | ||
golangci: | ||
|
@@ -12,13 +12,13 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v5.1.0 | ||
uses: actions/setup-go@v5.3.0 | ||
with: | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v6.1.1 | ||
uses: golangci/golangci-lint-action@v6.3.2 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
reporter: github-pr-check |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v5.1.0 | ||
uses: actions/setup-go@v5.3.0 | ||
with: | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ demos | |
kind | ||
*.snap | ||
/stresser | ||
__debug_bin* |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
# ----------------------------------------------------------------------------- | ||
# The base image for building the k9s binary | ||
|
||
FROM golang:1.23-alpine3.20 AS build | ||
FROM golang:1.23.6-alpine3.20 AS build | ||
|
||
WORKDIR /k9s | ||
COPY go.mod go.sum main.go Makefile ./ | ||
COPY internal internal | ||
COPY cmd cmd | ||
RUN apk --no-cache add --update make libx11-dev git gcc libc-dev curl && make build | ||
RUN apk --no-cache add --update make libx11-dev git gcc libc-dev curl \ | ||
&& make build | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Build the final Docker image | ||
|
||
FROM alpine:3.20.3 | ||
ARG KUBECTL_VERSION="v1.29.0" | ||
FROM alpine:3.21.2 | ||
ARG KUBECTL_VERSION="v1.31.2" | ||
|
||
COPY --from=build /k9s/execs/k9s /bin/k9s | ||
RUN apk add --update ca-certificates \ | ||
&& apk add --update -t deps curl vim \ | ||
RUN apk --no-cache add --update ca-certificates \ | ||
&& apk --no-cache add --update -t deps curl vim \ | ||
&& TARGET_ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) \ | ||
&& curl -L https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${TARGET_ARCH}/kubectl -o /usr/local/bin/kubectl \ | ||
&& curl -f -L https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${TARGET_ARCH}/kubectl -o /usr/local/bin/kubectl \ | ||
&& chmod +x /usr/local/bin/kubectl \ | ||
&& apk del --purge deps \ | ||
&& rm /var/cache/apk/* | ||
&& apk del --purge deps | ||
|
||
ENTRYPOINT [ "/bin/k9s" ] |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ Please refer to our [K9s documentation](https://k9scli.io) site for installation | |
|
||
Wanna discuss K9s features with your fellow `K9sers` or simply show your support for this tool? | ||
|
||
* Channel: [K9ersSlack](https://k9sers.slack.com/) | ||
* Channel: [K9sersSlack](https://k9sers.slack.com/) | ||
* Invite: [K9slackers Invite](https://join.slack.com/t/k9sers/shared_invite/enQtOTA5MDEyNzI5MTU0LWQ1ZGI3MzliYzZhZWEyNzYxYzA3NjE0YTk1YmFmNzViZjIyNzhkZGI0MmJjYzhlNjdlMGJhYzE2ZGU1NjkyNTM) | ||
|
||
## Installation | ||
|
@@ -115,7 +115,7 @@ Binaries for Linux, Windows and Mac are available as tarballs in the [release pa | |
* On Ubuntu | ||
|
||
```shell | ||
wget https://github.com/derailed/k9s/releases/download/v0.32.5/k9s_linux_amd64.deb && apt install ./k9s_linux_amd64.deb && rm k9s_linux_amd64.deb | ||
wget https://github.com/derailed/k9s/releases/download/v0.32.7/k9s_linux_amd64.deb && apt install ./k9s_linux_amd64.deb && rm k9s_linux_amd64.deb | ||
``` | ||
|
||
* Via [Winget](https://github.com/microsoft/winget-cli) for Windows | ||
|
@@ -171,7 +171,7 @@ Binaries for Linux, Windows and Mac are available as tarballs in the [release pa | |
|
||
## Building From Source | ||
|
||
K9s is currently using GO v1.22.X or above. | ||
K9s is currently using GO v1.23.X or above. | ||
In order to build K9s from source you must: | ||
|
||
1. Clone the repo | ||
|
@@ -362,6 +362,8 @@ K9s uses aliases to navigate most K8s resources. | |
| To view and switch to another Kubernetes context (Pod view) | `:`ctx⏎ | | | ||
| To view and switch directly to another Kubernetes context (Last used view) | `:`ctx context-name⏎ | | | ||
| To view and switch to another Kubernetes namespace | `:`ns⏎ | | | ||
| To switch back to the last active command (like how "cd -" works) | `-` | Navigation that adds breadcrumbs to the bottom are not commands | | ||
| To go back and forward through the command history | back: `[`, forward: `]` | Same as above | | ||
| To view all saved resources | `:`screendump or sd⏎ | | | ||
| To delete a resource (TAB and ENTER to confirm) | `ctrl-d` | | | ||
| To kill a resource (no confirmation dialog, equivalent to kubectl delete --now) | `ctrl-k` | | | ||
|
@@ -396,7 +398,7 @@ You can now override the context portForward default address configuration by se | |
maxConnRetry: 5 | ||
# Indicates whether modification commands like delete/kill/edit are disabled. Default is false | ||
readOnly: false | ||
# Toggles whether k9s should exit when CTRL-C is pressed. When set to true, you will need to exist k9s via the :quit command. Default is false. | ||
# Toggles whether k9s should exit when CTRL-C is pressed. When set to true, you will need to exit k9s via the :quit command. Default is false. | ||
noExitOnCtrlC: false | ||
#UI settings | ||
ui: | ||
|
@@ -411,13 +413,13 @@ You can now override the context portForward default address configuration by se | |
noIcons: false | ||
# Toggles reactive UI. This option provide for watching on disk artifacts changes and update the UI live Defaults to false. | ||
reactive: false | ||
# By default all contexts wil use the dracula skin unless explicitly overridden in the context config file. | ||
# By default all contexts will use the dracula skin unless explicitly overridden in the context config file. | ||
skin: dracula # => assumes the file skins/dracula.yaml is present in the $XDG_DATA_HOME/k9s/skins directory | ||
# Allows to set certain views default fullscreen mode. (yaml, helm history, describe, value_extender, details, logs) Default false | ||
defaultsToFullScreen: false | ||
# Toggles icons display as not all terminal support these chars. | ||
noIcons: false | ||
# Toggles whether k9s should check for the latest revision from the Github repository releases. Default is false. | ||
# Toggles whether k9s should check for the latest revision from the GitHub repository releases. Default is false. | ||
skipLatestRevCheck: false | ||
# When altering kubeconfig or using multiple kube configs, k9s will clean up clusters configurations that are no longer in use. Setting this flag to true will keep k9s from cleaning up inactive cluster configs. Defaults to false. | ||
keepMissingClusters: false | ||
|
@@ -431,6 +433,8 @@ You can now override the context portForward default address configuration by se | |
sinceSeconds: 300 # => tail the last 5 mins. | ||
# Toggles log line wrap. Default false | ||
textWrap: false | ||
# Autoscroll in logs will be disabled. Default is false. | ||
disableAutoscroll: false | ||
# Toggles log line timestamp info. Default false | ||
showTime: false | ||
# Provide shell pod customization when nodeShell feature gate is enabled! | ||
|
@@ -563,6 +567,13 @@ In order to surface hotkeys globally please follow these steps: | |
|
||
--- | ||
|
||
## Port Forwarding over websockets | ||
|
||
K9s follows `kubectl` feature flag environment variables to enable/disable port-forwarding over websockets. (default enabled in >1.30) | ||
To disable Websocket support, set `KUBECTL_PORT_FORWARD_WEBSOCKETS=false` | ||
|
||
--- | ||
|
||
## FastForwards | ||
|
||
As of v0.25.0, you can leverage the `FastForwards` feature to tell K9s how to default port-forwards. In situations where you are dealing with multiple containers or containers exposing multiple ports, it can be cumbersome to specify the desired port-forward from the dialog as in most cases, you already know which container/port tuple you desire. For these use cases, you can now annotate your manifests with the following annotations: | ||
|
@@ -620,7 +631,25 @@ The annotation value must specify a container to forward to as well as a local p | |
|
||
You can change which columns shows up for a given resource via custom views. To surface this feature, you will need to create a new configuration file, namely `$XDG_CONFIG_HOME/k9s/views.yaml`. This file leverages GVR (Group/Version/Resource) to configure the associated table view columns. If no GVR is found for a view the default rendering will take over (ie what we have now). Going wide will add all the remaining columns that are available on the given resource after your custom columns. To boot, you can edit your views config file and tune your resources views live! | ||
|
||
> NOTE: This is experimental and will most likely change as we iron this out! | ||
📢 🎉 As of `release v0.40.0` you can specify json parse expressions to further customize your resources rendering. | ||
|
||
The new column syntax is as follows: | ||
|
||
> COLUMN_NAME<:json_parse_expression><|column_attributes> | ||
|
||
Where `:json_parse_expression` represents an expression to pull a specific snippet out of the resource manifest. | ||
Similar to `kubectl -o custom-columns` command. This expression is optional. | ||
|
||
Additionally, you can specify column attributes to further tailor the column rendering. | ||
To use this you will need to add a `|` indicator followed by your rendering bits. | ||
You can have one or more of the following attributes: | ||
|
||
* `T` -> time column indicator | ||
* `N` -> number column indicator | ||
* `W` -> turns on wide column aka only shows while in wide mode. Defaults to the standard resource definition when present. | ||
* `H` -> Hides the column | ||
* `L` -> Left align (default) | ||
* `R` -> Right align | ||
|
||
Here is a sample views configuration that customize a pods and services views. | ||
|
||
|
@@ -630,7 +659,9 @@ views: | |
v1/pods: | ||
columns: | ||
- AGE | ||
- NAMESPACE | ||
- NAMESPACE|WR # => 🌚 Specifies the NAMESPACE column to be right aligned and only visible while in wide mode | ||
- ZORG:.metadata.labels.fred\.io\.kubernetes\.blee # => 🌚 extract fred.io.kubernetes.blee label into it's own column | ||
- BLEE:.metadata.annotations.blee|R # => 🌚 extract annotation blee into it's own column and right align it | ||
- NAME | ||
- IP | ||
- NODE | ||
|
@@ -645,6 +676,8 @@ views: | |
- CLUSTER-IP | ||
``` | ||
|
||
> 🩻 NOTE: This is experimental and will most likely change as we iron this out! | ||
|
||
--- | ||
|
||
## Plugins | ||
|
@@ -654,15 +687,15 @@ K9s allows you to extend your command line and tooling by defining your very own | |
A plugin is defined as follows: | ||
|
||
* Shortcut option represents the key combination a user would type to activate the plugin. Valid values are [a-z], Shift-[A-Z], Ctrl-[A-Z]. | ||
* Override option make that the default action related to the shortcut will be overrided by the plugin | ||
* Override option make that the default action related to the shortcut will be overridden by the plugin | ||
* Confirm option (when enabled) lets you see the command that is going to be executed and gives you an option to confirm or prevent execution | ||
* Description will be printed next to the shortcut in the k9s menu | ||
* Scopes defines a collection of resources names/short-names for the views associated with the plugin. You can specify `all` to provide this shortcut for all views. | ||
* Command represents ad-hoc commands the plugin runs upon activation | ||
* Background specifies whether or not the command runs in the background | ||
* Args specifies the various arguments that should apply to the command above | ||
* OverwriteOutput boolean option allows plugin developers to provide custom messages on plugin stdout execution. See example in [#2644](https://github.com/derailed/k9s/pull/2644) | ||
* Dangerous boolean option enables disabling the plugin when read-only mode is set. See [#2604](https://github.com/derailed/k9s/issues/2604) | ||
* Dangerous boolean option enables disabling the plugin when read-only mode is set. See [#2604](https://github.com/derailed/k9s/issues/2604) | ||
|
||
K9s does provide additional environment variables for you to customize your plugins arguments. Currently, the available environment variables are as follows: | ||
|
||
|
@@ -694,9 +727,9 @@ plugins: | |
fred: | ||
shortCut: Ctrl-L | ||
override: false | ||
overwriteOutput: false | ||
overwriteOutput: false | ||
confirm: false | ||
dangerous: false | ||
dangerous: false | ||
description: Pod logs | ||
scopes: | ||
- pods | ||
|
@@ -937,7 +970,7 @@ k9s: | |
noIcons: false | ||
# Toggles reactive UI. This option provide for watching on disk artifacts changes and update the UI live Defaults to false. | ||
reactive: false | ||
# By default all contexts wil use the dracula skin unless explicitly overridden in the context config file. | ||
# By default all contexts will use the dracula skin unless explicitly overridden in the context config file. | ||
skin: dracula # => assumes the file skins/dracula.yaml is present in the $XDG_DATA_HOME/k9s/skins directory | ||
defaultsToFullScreen: false | ||
skipLatestRevCheck: false | ||
|
@@ -958,6 +991,7 @@ k9s: | |
buffer: 5000 | ||
sinceSeconds: -1 | ||
textWrap: false | ||
disableAutoscroll: false | ||
showTime: false | ||
thresholds: | ||
cpu: | ||
|
@@ -1083,12 +1117,12 @@ to make this project a reality! | |
## Meet The Core Team! | ||
If you have chops in GO and K8s and would like to offer your time to help maintain and enhance this project, please reach out to me. | ||
* [Fernand Galiana](https://github.com/derailed) | ||
* <img src="assets/mail.png" width="16" height="auto" alt="email"/> [email protected] | ||
* <img src="assets/twitter.png" width="16" height="auto" alt="twitter"/> [@kitesurfer](https://twitter.com/kitesurfer?lang=en) | ||
* [Aleksei Romanenko](https://github.com/slimus) | ||
We always enjoy hearing from folks who benefit from our work! | ||
## Contributions Guideline | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.