Taken from https://github.com/nlatham1999/GoApp
export PORT=5000
export MONGODB_URL=mongodb+srv://user:password@host/?retryWrites=true&w=majority
go build -o order-service
./order-service
curl http://localhost:5000/orders
curl -X POST http://localhost:5000/order/create -H "Content-Type: application/json" -d '{"dish":"paratha","price":100, "server":"name","table":"1"}'
docker build -t order-service:v1.0 .
Sometimes secrets values gets appended with newline and pod goes into CrashLoopBackOff
You could create first file for secrets value e.g.
echo -n "secret_value1" > filename1 echo -n "secret_value2" > filename2
and then create secret
kubectl create secret generic order-service-secrets --from-file=port=port-file --from-file=mongodb_url=url-file -n order-app