Welcome to the message-api repository! This README provides an overview of the project structure, setup instructions, and usage details for deploying and managing resources using Kubernetes, Terraform, Jenkins, and the Go message API.
- Project Overview
- Kubernetes Setup
- Terraform Modules
- Jenkinsfile
- Go Message API
- Usage
- Contributing
- License
This repository contains configurations and code for deploying and managing an API infrastructure using Kubernetes, Terraform for infrastructure provisioning, Jenkins for CI/CD pipelines, and a Go-based message API.
- k8s/: Contains Kubernetes YAML files for deployments, services, ingress, etc.
- terraform/: Includes Terraform modules for provisioning AWS resources such as EKS clusters.
- Jenkinsfile: Defines the Jenkins pipeline for automated CI/CD processes.
- message-api/: Source code for the Go-based message API.
The k8s/
directory contains YAML files for deploying and managing Kubernetes resources such as deployments, services, ingress configurations, and more.
Apply Kubernetes resources using kubectl
:
kubectl apply -f k8s/
The terraform/
directory contains Terraform configuration files for provisioning AWS resources, particularly an EKS cluster for hosting the API.
-
Initialize Terraform:
cd terraform/ terraform init
-
Apply Terraform configurations:
terraform apply -var-file=variables.tfvars
The Jenkinsfile
defines the Jenkins pipeline for automating build, test, and deployment tasks for the API project.
- Build: Compiles the Go-based message API.
- Test: Runs automated tests to validate API functionality.
- Deploy: Deploys API changes to Kubernetes cluster.
The message-api/
directory contains the source code for the Go-based message API.
To build and run the API locally:
cd message-api/
go build
./message-api
curl -X POST http://localhost:8080/create
-H "Content-Type: application/json"
-d '{
"account_id": "123",
"message_id": "abc123",
"sender_number": "+1234567890",
"receiver_number": "+9876543210"
}'
curl -X GET http://localhost:8080/get/message/abc123
- Kubernetes cluster configured and accessible.
- AWS credentials and Terraform configured for infrastructure provisioning.
- Jenkins server with necessary plugins and agents set up.
-
Deploy Kubernetes Resources: Apply YAML files in
k8s/
directory to deploy API components. -
Provision Infrastructure with Terraform: Use Terraform in
terraform/
directory to create EKS cluster and required AWS resources. -
CI/CD with Jenkins: Set up Jenkins using
Jenkinsfile
for automated build, test, and deployment workflows. -
Run Go Message API: Build and run the Go-based message API from
message-api/
directory.
Contributions are welcome! Please fork the repository, make your changes, and submit a pull request. For major changes, please open an issue first to discuss potential improvements.
This project is licensed under the MIT License.