You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python Flask Application with UWSGI with HorizontalPodAutoscaler
Prerequisites
Install and configure aws-cli
Install kubectl
Install terraform
Install jq
Pre Deployment
Navigate to the following directory
cd terraform/env/perimiter81
Fill in all the relevant values in the variables.tfvars file
Deployment
cd terraform/env/perimiter81/
terraform init
terraform validate
terraform plan -var-file="variables.tfvars" -out terraform.plan
terraform apply terraform.plan
Post Deployment
Configure kubectl
Option one: as part of the deployment a "config" file was created in the same directory (see above). You can use it to execute kubectl commands by using the --kubeconfig
Option two: you can use the file mentioned in "1.a" and override/merge-to your local ~/.kube/config
Option three: You can execute the below command which will automatically update your ~/.kube/config file with the correct details
cd ../../../auto-scalers/
sed "s/PUT_ACCOUNT_ID_HERE/$(aws sts get-caller-identity | jq -r ".Account")/g" cluster/values.yaml
sed "s/PUT_CLUSTER_NAME_HERE/$(terraform output -raw eks_cluster_name)/g" cluster/templates/deployment.yaml
helm install --upgrade cluster-autoscaler cluster
cd ../ingress-nginx
# Put the correct value for the ssl cert under service.annotations in the values.yaml file# service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-east-1:XXXXXXXX:certificate/XXXXXX-XXXXXXX-XXXXXXX-XXXXXXXX
helm install --upgrade ingress-nginx .
Deploy the application
cd ../application_server
helm install --upgrade application-server application_chart
Cleanup of all the created resources
cd terraform/env/perimiter81/
terraform destroy -var-file="variables.tfvars" --auto-approve
About
Full deployment example of AWS + Kubernetes Infra + Application