This is a fork of otomato-gh/usersapi with added automation using Ansible, Terraform, and a Jenkins pipeline. The project is designed to build, deploy, and manage a containerized users API on an Amazon EKS cluster.
Ensure the following Jenkins plugins are installed:
- GitHub
- Pipeline: GitHub
- Docker
- Pyenv Pipeline
- Kubernetes
- GitHub Integration
- Amazon Web Services SDK :: All
Go to Manage Jenkins > System > Global properties and configure:
Variable | Description |
---|---|
DOCKER_REGISTRY |
The Docker registry URL |
EKS_CLUSTER_NAME |
The name of the EKS cluster |
GLOBAL_AWS_REGION |
AWS region for EKS deployment |
ID | Description |
---|---|
docker-creds |
Docker login credentials (username/password) |
aws-creds |
AWS credentials (access key/secret key) |
cd terraform/
terraform init
terraform apply -auto-approve
This sets up the EC2 instance, EBS storage, and EKS cluster.
ansible-playbook -i ansible/inventory ansible/deploy.yml
For setting up the server.
The pipeline will:
- Lint and test the application
- Build the Docker image
- Push the image to
DOCKER_REGISTRY
- Deploy the Helm chart to EKS