This is a basic Hello World example application written in NodeJS.
Install the dependencies
npm install
Start the server
npm start
Test by visiting http://localhost:8080
If it's working, shut down the server (ctrl-c)
Use Cloud Build to build the Docker image and push to GCR. This command assumes you are in Cloud Shell for a Google Cloud Project.
sh buildContainer.sh
At the end of the script output, Cloud Build will display the path to the newly generated container. It should look like: "gcr.io/some-project-name/hello-world:1.0". Copy the path.
If you'd like to deploy to GKE, there's a k8sapp.yaml
containing configurations to create a Deployment, and build a LoadBalancer for it. You will need to edit the file before applying to set the proper path to the container in GCR. The container path was generated by the buildContainer.sh
script, and if you followed instructions, it's currently copied into your buffer. Once the image bath has been updated, apply the file:
kubectl apply -f k8sapp.yaml
If you'd like to apply load to your hello world application, see the loadgenerator sub-folder.