Alta3 Research | https://alta3.com @RZFeeser | A simple Go Webservice
The purpose of this repository is to provide a simple Go program for container testing within Docker and Kubernetes.
This service mimics the Simple Python Flask Service available @: https://gitlab.com/alta3research/simpleflaskservice
The following endpoints are currently available:
- /endpoint - Description of what is returned
- / - HTTP + HTML
- /ping - HTTP + JSON
- /spock - HTTP + JSON
- /env - HTTP + JSON
- /alta3 - HTTP + JSON
- /health - HTTP + JSON (response may be deplayed by setting HEALTH_DELAY)
Some behaviors of the webservice may be modified by setting the following environmental variables.
Default Vaules:
- ENV_VAR_TO_SET - Description
- PORT - The default port to run the webservice on. The default is 9876
- HEALTH_DELAY - The time in seconds to delay an HTTP response sent to /health. The default is 0. The only reason to change this might be mimicing a failure within a Kubernetes health check.
- VERSION - The version returned by the server. The default is 0.1.
Builds may be accomplished using theDockerfile
and Dockerfile.multistage`.
git clone https://github.com/rzfeeser/dockergo
sudo docker build --tag dockergo .
(sudo) docker build -t dockergo:multistage -f Dockerfile.multistage .
(sudo) docker run -d -p 9876:9876 dockergo:latest (sudo) docker run -d -p 9876:9876 dockergo:multistage
sudo docker stop $(sudo docker ps -aq)
sudo docker container prune
Russell Zachary Feeser - @RZFeeser