This program is very simple, it connects to a MySQL database based on the following env vars:
- MYSQL_HOST
- MYSQL_USER
- MYSQL_PASS
- MYSQL_PORT
And exposes itself on port 9090:
- On
/healthcheckit returns an OK message, - On GET it returns all recorded rows.
- On POST it creates a new row.
- On PATCH it updates the creation date of the row with the same ID as the one specified in query parameter
id# instaBug
- Fix bugs in code
- Dockerizing App
- Compose the API image & Mysql
- CI/CD Jenkins Pipeline
- Kubernetes + packaging it using helm & kustomization file
- ArgoCD for GitOps
- Horizontal Pod Autoscaler
- The .env file is used to store the required environment variables for the application. Ensure that you provide the correct values for MYSQL_HOST, MYSQL_USER, MYSQL_PASS, and MYSQL_PORT.
- it shoud be in instabug-intern-challenge/ dir.
git clone https://github.com/Elheity/instaBug.git
cd instabug
go build -o main .
./main
sudo docker build -t internship .
- Dockerfile Built in the way that make it as lightweight as possible with all layers of security.
docker-compose up
- In Docker-compose The Api Will Start Only After Mysql DB Be Healthy, So i add Healthcheck for my compose file
# Start the Minikube cluster using the Docker driver by running the command:
minikube start --driver docker
# Verify the status of the Minikube cluster using the command:
minikube status
Ensure that the control plane components, including the host, kubelet, apiserver, and kubeconfig, are running and properly configured.
kubectl apply -f kubernetes//app-deployment.yaml
kubectl apply -f kubernetes//app-service.yaml
kubectl apply -f kubernetes//db-deployment.yaml
kubectl apply -f kubernetes//db-service.yaml
kubectl apply -f kubernetes//app-config.yaml
helm install mywebapp-release helminsta/ --namespace default --set fullnameOverride=mywebapp-release --set releaseNamespace=default
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Install API By Using Helm Charts Command OR By Run Application.yaml K8s File And It Will Sync Automatically. and it also point to helm package.
kubectl apply -f helminsta/templates/application.yaml
.jpeg)


.jpeg)


