generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
268 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Attach Configuration | ||
|
||
{{< hint "info" >}} | ||
|
||
This document walks you through how to configure the Attach feature. | ||
|
||
{{< /hint >}} | ||
|
||
## What is a Attach? | ||
|
||
The Attach API is a [`kwok` Configuration]({{< relref "/docs/user/configuration" >}}) that allows users to define and simulate attach to an Pod(s). | ||
|
||
A Attach resource has the following fields: | ||
|
||
``` yaml | ||
kind: Attach | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
metadata: | ||
name: <string> | ||
namespace: <string> | ||
spec: | ||
attaches: | ||
- containers: | ||
- <string> | ||
logsFile: <string> | ||
``` | ||
To attach a container, you can set the `attaches` field in the spec section of a Logs resource. | ||
The `containers` field is used to match an item in the `attaches` field. If the `containers` field is not set, the `attaches` item will default to all containers. | ||
The `logsFile` field specifies the file path of the logs. If the `logsFile` field is not set, this item will be ignored. | ||
|
||
### ClusterAttach | ||
|
||
The ClusterAttach API is a special Attach API which is cluster-side. | ||
|
||
A ClusterAttach resource has the following fields: | ||
|
||
``` yaml | ||
kind: ClusterAttach | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
metadata: | ||
name: <string> | ||
spec: | ||
selector: | ||
matchNamespaces: | ||
- <string> | ||
matchNames: | ||
- <string> | ||
attaches: | ||
- containers: | ||
- <string> | ||
logsFile: <string> | ||
``` | ||
|
||
The `selector` field specifies the Pods to be attached. | ||
The `matchNamespaces` field specifies the namespaces to be matched. If the `matchNamespaces` field is not set, the `matchNamespaces` field will default to all namespaces. | ||
The `matchNames` field specifies the names to be matched. If the `matchNames` field is not set, the `matchNames` field will default to all names. |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Exec Configuration | ||
|
||
{{< hint "info" >}} | ||
|
||
This document walks you through how to configure the Exec feature. | ||
|
||
{{< /hint >}} | ||
|
||
## What is a Exec? | ||
|
||
The Exec API is a [`kwok` Configuration]({{< relref "/docs/user/configuration" >}}) that allows users to define and simulate exec to an Pod(s). | ||
|
||
A Exec resource has the following fields: | ||
|
||
``` yaml | ||
kind: Exec | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
metadata: | ||
name: <string> | ||
namespace: <string> | ||
spec: | ||
execs: | ||
- containers: | ||
- <string> | ||
local: | ||
workDir: <string> | ||
envs: | ||
- name: <string> | ||
value: <string> | ||
``` | ||
To exec a container, you can set the `execs` field in the spec section of a Exec resource. | ||
The `containers` field is used to match an item in the `execs` field. If the `containers` field is not set, the `execs` item will default to all containers. | ||
The `local` field specifies the local environment to be executed. | ||
The `workDir` field specifies the working directory of the local environment. If the `workDir` field is not set, the working directory will be the root directory. | ||
The `envs` field specifies the environment variables of the local environment. | ||
|
||
### ClusterExec | ||
|
||
The ClusterExec API is a special Exec API which is cluster-side. | ||
|
||
A ClusterExec resource has the following fields: | ||
|
||
``` yaml | ||
kind: ClusterExec | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
metadata: | ||
name: <string> | ||
spec: | ||
selector: | ||
matchNamespaces: | ||
- <string> | ||
matchNames: | ||
- <string> | ||
execs: | ||
- containers: | ||
- <string> | ||
local: | ||
workDir: <string> | ||
envs: | ||
- name: <string> | ||
value: <string> | ||
``` | ||
|
||
The `selector` field specifies the Pods to be executed. | ||
The `matchNamespaces` field specifies the namespaces to be matched. If the `matchNamespaces` field is not set, the `ClusterExec` will match all namespaces. | ||
The `matchNames` field specifies the names to be matched. If the `matchNames` field is not set, the `ClusterExec` will match all names. |
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Logs Configuration | ||
|
||
{{< hint "info" >}} | ||
|
||
This document walks you through how to configure the Logs feature. | ||
|
||
{{< /hint >}} | ||
|
||
## What is a Logs? | ||
|
||
The Logs API is a [`kwok` Configuration]({{< relref "/docs/user/configuration" >}}) that allows users to define and simulate logs to an Pod(s). | ||
|
||
A Logs resource has the following fields: | ||
|
||
``` yaml | ||
kind: Logs | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
metadata: | ||
name: <string> | ||
namespace: <string> | ||
spec: | ||
logs: | ||
- containers: | ||
- <string> | ||
logsFile: <string> | ||
follow: <bool> | ||
``` | ||
To log a container, you can set the `logs` field in the spec section of a Logs resource. | ||
The `containers` field is used to match an item in the `logs` field. If the `containers` field is not set, the `logs` item will default to all containers. | ||
The `logsFile` field specifies the file path of the logs. If the `logsFile` field is not set, this item will be ignored. | ||
The `follow` field specifies whether to follow the logs. If the `follow` field is not set, the `follow` field will default to false. | ||
|
||
### ClusterLogs | ||
|
||
The ClusterLogs API is a special Logs API which is cluster-side. | ||
|
||
A ClusterLogs resource has the following fields: | ||
|
||
``` yaml | ||
kind: ClusterLogs | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
metadata: | ||
name: <string> | ||
spec: | ||
selector: | ||
matchNamespaces: | ||
- <string> | ||
matchNames: | ||
- <string> | ||
logs: | ||
- containers: | ||
- <string> | ||
logsFile: <string> | ||
follow: <bool> | ||
``` | ||
|
||
The `selector` field specifies the Pods to be logged. | ||
The `matchNamespaces` field specifies the namespaces to be matched. If the `matchNamespaces` field is not set, the `matchNamespaces` field will default to all namespaces. | ||
The `matchNames` field specifies the names to be matched. If the `matchNames` field is not set, the `matchNames` field will default to all names. |
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# PortForward Configuration | ||
|
||
{{< hint "info" >}} | ||
|
||
This document walks you through how to configure the PortForward feature. | ||
|
||
{{< /hint >}} | ||
|
||
## What is a PortForward? | ||
|
||
The PortForward API is a [`kwok` Configuration]({{< relref "/docs/user/configuration" >}}) that allows users to define and simulate port forwarding to an Pod(s). | ||
|
||
A PortForward resource has the following fields: | ||
|
||
``` yaml | ||
kind: PortForward | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
metadata: | ||
name: <string> | ||
namespace: <string> | ||
spec: | ||
forwards: | ||
- ports: | ||
- <int> | ||
target: | ||
port: <int> | ||
address: <string> | ||
|
||
- ports: | ||
- <int> | ||
command: | ||
- <string> | ||
- <string> | ||
``` | ||
To forward a port, you can set the `forwards` field in the spec section of a PortForward resource. | ||
The `ports` field is used to match an item in the `forwards` field. If the `ports` field is not set, the `forwards` item will default to all ports. | ||
The `target` field specifies the target address to be forwarded to. If the `command` field is set, the `target` field will be ignored. | ||
The `command` field allows users to define the command to be executed to forward the port. The `command` is executed in the container of kwok. | ||
The `command` should be a string array, where the first element is the command and the rest are the arguments. Also, the command should be in the container’s PATH. | ||
|
||
### ClusterPortForward | ||
|
||
The ClusterPortForward API is a special PortForward API which is cluster-side. | ||
|
||
A ClusterPortForward resource has the following fields: | ||
|
||
``` yaml | ||
kind: ClusterPortForward | ||
apiVersion: kwok.x-k8s.io/v1alpha1 | ||
metadata: | ||
name: <string> | ||
spec: | ||
selector: | ||
matchNamespaces: | ||
- <string> | ||
matchNames: | ||
- <string> | ||
forwards: | ||
- ports: | ||
- <int> | ||
target: | ||
port: <int> | ||
address: <string> | ||
- ports: | ||
- <int> | ||
command: | ||
- <string> | ||
- <string> | ||
``` | ||
|
||
The `selector` field is used to select the Pods to be port forwarded. | ||
The `matchNamespaces` field is used to match the namespace of the Pods. If the `matchNamespaces` field is not set, the ClusterPortForward will match all namespaces. | ||
The `matchNames` field is used to match the name of the Pods. If the `matchNames` field is not set, the ClusterPortForward will match all Pods. |
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