- Source config on folder kubernetes/eks.yaml
- Source parameters on folder kubernetes/server-parameters.json
In this project, we will apply our skills to build an application that connects to the Postgres database. Including:
- Works on AWS
- Use ECR to store the latest version application images
- Use Codebuild to deploy image storage to ECR automatically
- Work with CloudFormation to deploy Kubernetes infrastructure
- Use helm to deploy Postgres database
- Build a Kubernetes cluster and deploy microservices
To run this project, you will need to add the following environment variables to your CircleCI environment variables
AWS_DEFAULT_REGIONAWS_ACCOUNT_IDIMAGE_APP_REPO_NAMEIMAGE_APP_TAGIMAGE_DB_REPO_NAMEIMAGE_DB_TAG
| File | Description |
|---|---|
application/Dockerfile |
Build image application |
codebuild |
the job automatically pushes images to ECR |
codebuild/buildspec.yml |
template codebuild |
db |
Database for postgre |
deployment |
Kubernetes resource files deployment |
deployment/configmap.yaml |
file configmap for username, host, port connect from application to postgres |
deployment/deployment.yaml |
File config deploy application |
deployment/provisioner.yaml |
File config deploy CSI Drive for PV, PVC postgres |
deployment/secret.yaml |
File config password for postgesql |
deployment/services.yaml |
File config servive for application |
kubernetes |
Folder for deploy kubernetes infra using cloudformation |
kubernetes/eks.yaml |
File config template cloudformation |
screenshot |
Folder screenshot project |
-
Run
aws cloudformation deploy --template-file eks.yml --stack-name eks --tags project=udapeople --capabilities CAPABILITY_NAMED_IAMto create EKS cluster -
Some kubectl commands to check k8s resources
aws eks --region us-east-1 update-kubeconfig --name eks
kubectl get all
- Run helm repo add database https://charts.bitnami.com/bitnami
- helm install postgres database/postgresql
- Run kubectl apply -f /deployment
- Show all pod, svc, deployment run kubectl get all