支持多 K8S 集群并与其交互。
HUBOT_K8S_CONTEXTS
{"prod":{"server":"https://kubernetes.cluster.io","ca":"./ca.crt","dashboardPrefix":"https://kubernetes.cluster.io","token":"<kubernetes token>"}}
HUBOT_K8S_DEFAULT_CONTEXT
- Default context (from above config)HUBOT_K8S_DEFAULT_NAMESPACE
- Default namespace in Kubernetes
All commands operate in the currently selected namespace and context. All commands with label selectors accept it in the form label=value
.
k8s help
k8s context
k8s context
<context>
k8s namespace|ns
k8s namespace|ns
<namespace>
k8s deployments|deploy [
<labelSelector>
]
k8s statefulsets|sts [
<labelSelector>
]
k8s nodes|no [
<labelSelector>
]
k8s services|svc [
<labelSelector>
]
k8s cronjobs|cj [
<labelSelector>
]
例如 k8s scale deployment nginx-app 3
k8s scale resource resourcename count
k8s jobs [
<labelSelector>
]
k8s pods|po [
<labelSelector>
]
k8s logs|log
<pod name>