The kn admin
is a plugin of Knative client and it is designed to help administrators and operators better manage a Knative platform installation with kn CLI.
This plugin’s main objective is to make administration and operation workflows easier, for instance by making it easy to accomplish
tasks such as feature flags enablement or disablement with one command, instead of many manual steps like modifying ConfigMaps or yaml files.
You can download latest binaries from the https://github.com/knative-sandbox/kn-plugin-admin/releases[Releases] page.
Here are two ways to run kn admin
:
kn
client to run:kn client
if you don't have it.kn admin
binary to ~/.config/kn/plugins/
folder and make sure its filename is kn-admin
.kn plugin list
to assure the kn-admin
plugin is installed successfully.After the plugin is installed, you can use kn admin
to run its related subcommands.
A plugin of kn client to manage Knative for administrators.
For example: kn admin domain set - to set Knative route domain kn admin private-registry enable - to enable deployment from the private registry kn admin autoscaling update - to manage autoscaling config
Usage: kn admin [command]
Available Commands: autoscaling Manage autoscaling config domain Manage route domain help Help about any command registry Manage registry version Prints the plugin version
Flags: --config string config file (default is $HOME/.config/kn/plugins/admin.yaml) -h, --help help for kn admin -t, --toggle Help message for toggle
kn admin cdc
Manage custom domain claim
Usage: kn admin cdc [command]
Available Commands: create create cluster domain claim delete delete cluster domain claim list List cluster domain claims
Flags: -h, --help help for cdc
Global Flags: --config string config file (default is $HOME/.config/kn/plugins/admin.yaml)
kn admin domain
Set default route domain or route domain for Service with selectors. For example:
kn admin domain set - to set Knative route domain
Usage: kn admin domain [flags] kn admin domain [command]
Available Commands: set set route domain unset unset route domain
Flags: -h, --help help for domain
Global Flags: --config string config file (default is $HOME/.config/kn/plugins/admin.yaml)
Use "admin domain [command] --help" for more information about a command.
kn admin registry
Manage registry used by Knative service deployment
Usage: kn admin registry [command]
Available Commands: add Add registry with credentials help Help about any command list List registry settings remove Remove registry settings
Flags: -h, --help help for registry
Global Flags: --config string config file (default is $HOME/.config/kn/plugins/admin.yaml)
kn admin autoscaling
Manage autoscaling provided by Knative Pod Autoscaler (KPA). For example:
kn admin autoscaling update - to manage autoscaling config
Usage: kn admin autoscaling [command]
Available Commands: list List autoscaling config update update autoscaling config
Flags: -h, --help help for autoscaling
Global Flags: --config string config file (default is $HOME/.config/kn/plugins/admin.yaml)
Use "kn admin autoscaling [command] --help" for more information about a command.
kn admin profiling
Enable Knative Serving components profiling and download profiling data
Usage: kn admin profiling [flags]
Aliases: profiling, prof
Examples:
kn admin profiling --enable
kn admin profiling --target autoscaler --heap
kn admin profiling --target networking-istio --trace 2m
kn admin profiling --target activator --block --mem-allocs --save-to /tmp
kn admin profiling --target activator-5979f56548 --all
Flags: --all Download all available profiling data --block Download go routine blocking data --cpu string Download cpu profiling data, you can specify a profiling data duration with 's' for second(s), 'm' for minute(s) and 'h' for hour(s), e.g: '1m' for one minute (default "5s") --disable Disable Knative Serving profiling --enable Enable Knative Serving profiling --goroutine Download stack traces of all current goroutines data --heap Download heap profiling data -h, --help help for profiling --mem-allocs Download memory allocations data --mutex Download holders of contended mutexes data -s, --save-to string The path to save the downloaded profiling data, if not speicifed, the data will be saved in current working folder -t, --target string The profiling target. It can be a Knative Serving component name or a specific pod name, e.g: 'activator' or 'activator-586d468c99-w59cm' --thread-create Download stack traces that led to the creation of new OS threads data --trace string Download execution trace data, you can specify a trace data duration with 's' for second(s), 'm' for minute(s) and 'h' for hour(s), e.g: '1m' for one minute (default "5s")
Global Flags: --config string config file (default is $HOME/.config/kn/plugins/admin.yaml)
====
====
====
=====
=====
=====
=====
=====
=====
===== After you get the profiling data file, you need to use https://blog.golang.org/pprof[pprof] to open it.