GithubHelp home page GithubHelp logo

go-vol's Introduction

Docker Container Image Size Docker Container Layers Docker Container Pulls

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:

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:

{
  "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

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:

kubectl get service --selector=app=go-vol-service
NAME             TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
go-vol-service   NodePort   10.104.151.78   <none>        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

go-vol's People

Contributors

cjimti avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.