Kubernetes
Onofficiรซle Beta-vertaling
Deze pagina is vertaald door PageTurner AI (beta). Niet officieel goedgekeurd door het project. Een fout gevonden? Probleem melden โ
Watโ
Toont de naam van de huidige actieve Kubernetes-context en namespace
Voorbeeldconfiguratieโ
- json
- yaml
- toml
{
"type": "kubectl",
"style": "powerline",
"powerline_symbol": "๎ฐ",
"foreground": "#000000",
"background": "#ebcc34",
"template": " ๓ฑพ {{.Context}}{{if .Namespace}} :: {{.Namespace}}{{end}} ",
"options": {
"context_aliases": {
"arn:aws:eks:eu-west-1:1234567890:cluster/posh": "posh"
},
"cluster_aliases": {
"arn:aws:eks:eu-west-1:1234567890:cluster/posh": "posh-cluster"
}
}
}
type: kubectl
style: powerline
powerline_symbol: ๎ฐ
foreground: "#000000"
background: "#ebcc34"
template: " ๓ฑพ {{.Context}}{{if .Namespace}} :: {{.Namespace}}{{end}} "
options:
context_aliases:
arn:aws:eks:eu-west-1:1234567890:cluster/posh: posh
cluster_aliases:
arn:aws:eks:eu-west-1:1234567890:cluster/posh: posh-cluster
type = "kubectl"
style = "powerline"
powerline_symbol = "๎ฐ"
foreground = "#000000"
background = "#ebcc34"
template = " ๓ฑพ {{.Context}}{{if .Namespace}} :: {{.Namespace}}{{end}} "
[options.context_aliases]
"arn:aws:eks:eu-west-1:1234567890:cluster/posh" = "posh"
[options.cluster_aliases]
"arn:aws:eks:eu-west-1:1234567890:cluster/posh" = "posh-cluster"
Optiesโ
| Name | Type | Default | Description |
|---|---|---|---|
display_error | boolean | false | show the error context when failing to retrieve the kubectl information |
parse_kubeconfig | boolean | true | parse kubeconfig files instead of calling out to kubectl to improve performance |
context_aliases | object | custom context namespace | |
cluster_aliases | object | custom cluster name |
Template (informatie)โ
standaard sjabloon
{{ .Context }}{{ if .Namespace }} :: {{ .Namespace }}{{ end }}
Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.Context | string | the current kubectl context |
.Namespace | string | the current kubectl context namespace |
.User | string | the current kubectl context user |
.Cluster | string | the current kubectl context cluster |
tip
Het is gebruikelijk dat de Kubernetes "default"-namespace wordt gebruikt wanneer geen namespace is opgegeven. Als je wilt dat je prompt een lege huidige namespace weergeeft met het woord "default", kun je zoiets als dit gebruiken voor het sjabloon:
{{.Context}} :: {{if .Namespace}}{{.Namespace}}{{else}}default{{end}}