Kindly go through the following steps to deploy this application:
-
You need to have hooked up your okteto CLI to your K8 to deploy this application. Run all the required go commands to get the dependencies.
-
Run the command
cp .env.example .env
to create a clone of your local environment variables. In the new .env file, kindly provide the name of your K8 namespace. You can only leave this blank if you have elevated permission in the cluster. -
You should run
okteto deploy --build
to create the deployment, or if you modify the K8s.yml or the okteto file. -
Once your deployment has been set up, you can connect to the Okteto development platform using the command
okteto up
, and once you're connected, you should start the application using the commandgo run main.go
. You can also use the commandmake start
if you like the easy life. -
You can run the test routes in the pods.http file to test the respective routes. Don't forget to change the baseURL to yours if different.
-
As an added advantage, you can manage the K8 cluster by hooking to it locally. Connect your kubectl using the
okteto context use <your okteto kubernetes url>
, and view your deployment using thekubectl get deploy -n <your namespace>
. You can also manually scale the deployment using thekubectl scale --replicas=<your desired number> deployment/tech-assessment
command. -
To run the tests, simply run the following command
go test ./...
and you're good to go. Please feel free to make changes and send in your PR. I look forward to the collab.