Skip to content

Commit 5e6dd12

Browse files
authored
Update README.md
1 parent f120703 commit 5e6dd12

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

‎README.md‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,48 @@ Artifacts are created under the directory `<Container Name><Pod Index>-<Containe
701701
`-- result.txt
702702
```
703703

704+
## 8. Use kubetest-agent
705+
706+
Normally, when communicating with the container of Job started by kubetest, use the Kubernetes API.
707+
However, if you need to copy large files or run a large number of commands and don't want to overload the Kubernetes API, or if you don't have a shell or tar command in your container image, you can use the `kubetest-agent` method.
708+
709+
kubetest-agent is a CLI tool that can be installed by the following methods.
710+
711+
```console
712+
$ go install github.com/goccy/kubetest/cmd/kubetest-agent
713+
```
714+
715+
Include this tool in your container image and specify the path to kubetest-agent as follows:
716+
717+
```yaml
718+
apiVersion: kubetest.io/v1
719+
kind: TestJob
720+
metadata:
721+
name: kubetest-agent-job
722+
namespace: default
723+
spec:
724+
mainStep:
725+
template:
726+
metadata:
727+
generateName: kubetest-agent-testjob-
728+
spec:
729+
containers:
730+
- name: test
731+
image: alpine
732+
agent:
733+
installedPath: /bin/kubetest-agent
734+
workingDir: /go/src
735+
command:
736+
- echo
737+
args:
738+
- "hello"
739+
```
740+
741+
This will switch from communication using the Kubernetes API to gRPC-based communication with kubetest-agent.
742+
Communication with `kubetest-agent` is performed using JWT issued using the RSA Key issued each time Kubernetes Job is started, so requests cannot be sent directly to the container from other processes.
743+
It makes use of the features of `kubejob-agent`. See here for [details](https://github.com/goccy/kubejob#execution-with-kubejob-agent)
744+
745+
704746
# Specification of TestJob
705747

706748
## TestJob

0 commit comments

Comments
 (0)