A helloworld example has been shipped with the template to show the bare minimum setup - a server that listens on the configured port, a dockerfile, and some kubernetes manifests.
- Webserver that listens on port 80
- Dockerfile builds and serves on port 80
- The Github Org has already been configured with secrets that allow this project to deploy to the Onboarding cluster
- CI/CD will run in Github actions to deploy your application
- It will build an image and push to ECR (Elastic Container Registry)
- it will create an ingress, service, and deployment in the Kubernetes cluster using kustomize during the CI pipeline
- It will update the deployment to use the newly built docker image
To set up your local environment with access to AWS and Kubernetes, just run:
./scripts/setup-env.sh
This script will open a web browser and prompt you to log in with your Commit Gmail account, and then will configure an AWS profile and a Kubernetes context.
The Playground uses a somewhat "quick and dirty" way to create secrets for your application without needing to commit them to your GitHub repository. In order to add secrets to your deployment:
- Rename
secrets/secrets.yml.example
tosecrets.yml
(note thatsecrets.yml
has been added to the.gitignore
file, so they will not be committed to your GitHub repository). - Add secrets to the
stringData
section of yoursecrets.yml
file as appropriate. In your deployed application, each secret key will be available as an environment variable. - Run
make upsert-secrets
from the root of your application which will create the secrets object on your Kubernetes cluster server. - Uncomment the
secretRef
andname
lines fromkubernetes/deploy/deployment.yml
. - That's it! Deploy your application in order for the secrets to be picked up, and you should now be able to access them as environment variables via the defined secret keys.
The configuration of your application in Kubernetes uses https://kustomize.io/ and is run by the CI pipeline, the configuration is in the /kubernetes
directory.
Once the CI pipeline is finished, you can see the pod status on kubernetes in your application namespace:
kubectl -n ep-map-backend get pods
You can update the configuration of the deployment and adjust things like increasing the number of replicas and adding new environment variables in the kustomization file. The ingress and service control routing traffic to your application.
Your repository comes with a end-to-end CI/CD pipeline, which includes the following steps:
- Checkout
- Unit Tests
- Build Image
- Upload Image to ECR
- Deploy image to cluster