Test application to verify environment deployment and reachability over HTTP.
Environment variables:
LISTEN_ADDRESS
- listen address,0.0.0.0
by defaultLISTEN_PORT
- listen port for requests,8080
by defaultAPP_NAME
- name of application printed in outputHTTP_RESPONSE_CODE
- returned HTTP response code, 200 by defaultPROCESSING_SLEEP
- block processing of request for specified ms, 0 by default
make build
- build application locally
make container
- build application container
Run application as container:
docker run -p 8080:8080 denis256/go-test-app:v0.0.4
Run application as deployment in Kubernetes:
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-app
labels:
app: test-app
spec:
replicas: 1
selector:
matchLabels:
app: test-app
template:
metadata:
labels:
app: test-app
spec:
containers:
- name: test-app
image: denis256/go-test-app:v0.0.4
env:
- name: LISTEN_PORT
value: "9000"
ports:
- containerPort: 9000