Configure GKE workloads
Once the cloud resources are created, we can deploy our applications as Kubernetes workloads. The necessary YAML files can be found as a template in the link below.
Template repo: https://github.com/coronasafe/infra_template
Editing the template repo
Using the template, replace all generic/example values to production values. Let’s go through each folder.
Certificate
Replace the example hostnames for ‘dnsNames’ with actual hostnames
Configmaps
In care-configmap.yaml, add database configurations and update the hostnames in CSRF_TRUSTED_ORIGINS and DJANGO_ALLOWED_HOSTS
In nginx.yaml, update the server_name with hostnames.
Helm
Install Helm[Ref]
use the static IP created from "Reserve a static IP address" step to replace the IP value in helm/scripts.sh
Ingress
Replace example hostnames with actual hostnames
Secrets
Update care-secrets.yml
Update metabase.yml with metabase db credentials.
Applying Configurations
Set the default gke cluster
Get the name using:
kubectl config get-contextsSet the config:
kubectl config use-context <name>
Run the helm script:
bash helm/scripts.shUse kubectl to apply all the kubernetes yaml files in the following order
Deploy configmaps:
kubectl apply -f 'configmaps/*'Secrets:
kubectl apply -f 'secrets/*'Deployments:
kubectl apply -f 'deployments/*'Services:
kubectl apply -f 'services/*'Clusterissuer:
kubectl apply -f ClusterIssuer/cluster-issuer.yamlCertificate:
kubectl apply -f certificate/certificate.ymlIngress:
kubectl apply -f ingress/care.yaml
Once ingress is created,
kubectl get ingress care-ingresswill show the IP of the TCP load balancer.Once the DNS records are added, the SSL will be automatically handled.
Add DNS records
create DNS A records for each domain pointing to the static IP created from "Reserve a static IP address" step
Last updated
Was this helpful?