Readme.md contains prerequisits on how to setup the environment, and information on how to add additional microservices helm charts.
- Google Authentication/Credentials
brew cask install google-cloud-sdk
- credentials.json file in the repository root.
- Terraform 12
brew install terraform
- Helm 3
brew install helm
Open terraform.tfvars and change the values according to the needs.
Change directory to k8s-cluster
# Install terraform providers
terraform init
# Check for infrastructure deployment/changes
terraform plan
# Deploy infrastructure
terraform apply
Helm is used to generate the skeleton for the microservices. This could also be done through Terraform as shown in helm.tf.
Decision is made to generate this outside of terraform using Helm as in my experience Developers should be able to make changes. These files charts are also stored outside of the gitrepo on dockerhub, artifactory or similar tools.
Change to the root of the repository
helm create <service name>
Open values.yaml and provide image name:
repository: nginxdemos/hello:latest
Additional changes made,
- Change service type to NodePort.
- Enabled ingress, change value to true.
Open deployment.yaml and add deployment strategie:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
Open values.yaml and define resources limnit:
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi