https://github.com/cjimti/go-vol
Kubernetes volume testing container.
https://github.com/cjimti/go-vol
docker docker-container docker-image filesystem go golang k8s kubernetes testing testing-tools volume
Last synced: 6 months ago
JSON representation
Kubernetes volume testing container.
- Host: GitHub
- URL: https://github.com/cjimti/go-vol
- Owner: cjimti
- License: mit
- Created: 2018-03-29T21:01:09.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-29T21:38:57.000Z (about 8 years ago)
- Last Synced: 2025-03-10T23:14:33.683Z (over 1 year ago)
- Topics: docker, docker-container, docker-image, filesystem, go, golang, k8s, kubernetes, testing, testing-tools, volume
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://hub.docker.com/r/cjimti/go-vol/)
[](https://hub.docker.com/r/cjimti/go-vol/)
[](https://hub.docker.com/r/cjimti/go-vol/)
# GO Vol
Go Vol is for testing [Kubernetes] volumes. Pods will write a file to the specified path with a file consisting the environment variable vales for NODE_NAME and POD_NAME. This helps test and debug issues where Pods are not correctly connecting to a volume. The list of files on the volume is available from an http endpoint on a specified port.
## Test with [Docker]
Run the container from a terminal:
```bash
docker run --rm -it -p 8080:80 -v "$(pwd)"/files:/files \
-e VOL_PATH="/files" -e PORT=80 \
-e NODE_NAME=n1.imti.cloud \
-e POD_NAME=go-vol-xxx2 \
cjimti/go-vol
```
Browse to http://localhost:8080 and you should see JSON output similar to the one below:
```json
{
"client_ip": "172.17.0.1",
"count": 2,
"file": "/files/gv_n1.imti.cloud_go-vol-xxx2.txt",
"files": [
".gitignore",
"gv_n1.imti.cloud_go-vol-xxx2.txt",
"gv_n1.imti.cloud_go-vol-xxxx.txt",
"hello-world.txt"
],
"message": "go-vol",
"node_name": "n1.imti.cloud",
"pod_ip": "",
"pod_name": "go-vol-xxx2",
"pod_namepage": "",
"service_account": "",
"status_message": "OK",
"time": "2018-03-29T20:56:00.3109565Z",
"uuid_call": "0fe81ee2-1e5f-40e5-79ac-ae219af26a3a",
"uuid_instance": "f118620f-3194-46fc-76c5-d32b5d7bfe01",
"version": 1,
"version_msg": "version 1"
}
```
## Test with [Kubernetes]
```bash
cd k8s
kubectl create -f ./setup-rookfs.yml
kubectl create -f ./go-vol-service.yml
kubectl create -f ./go-vol-deployment.yml
```
Find the new nodePort service:
```bash
kubectl get service --selector=app=go-vol-service
```
```bash
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
go-vol-service NodePort 10.104.151.78 80:31020/TCP 19m
```
[Kubernetes] assigned port 31020 on my cluster, so I browse to http://n1.imti.cloud:31020. Port assignment is random since I did not specify a port in the provided configuration.
## Resources
- [Docker]
- [Kubernetes]
[Docker]: https://www.docker.com/
[Kubernetes]: https://kubernetes.io/