TechTrends is a Python Flask web application that serves as a Blog website. It displays a list of IT articles and allows for the creation of new articles.
This project was developed as a part of the Cloud Native Fundamentals Scholarship Program Nanodegree Program by Udacity.
The project uses Python and Flask for the web service, and SQLite for the database.
- Python 3.8+
- Pip package manager (usually comes with Python)
-
Clone this repository and navigate into it:
git clone https://github.com/alexsnow348/techtrends cd TechTrends
-
Install the required Python packages:
pip install -r requirements.txt
-
Start the application:
python app.py
Access the application at http://localhost:3111
.
The application can also be containerized and run as a Docker container.
-
Build the Docker image (from the directory containing the Dockerfile):
docker build -t techtrends .
-
Run the application as a Docker container:
docker run -d -p 3111:3111 techtrends
Access the application at http://localhost:3111
.
This repository utilizes GitHub Actions for continuous integration. Every time a new commit is pushed to the main branch, an automated process is triggered. This process includes setting up the required environments, checking out the latest code, building a new Docker image from it, and then pushing this Docker image to Docker Hub.
Through this CI pipeline, we ensure that our Docker image always represents the latest version of the application in a production-ready state. This streamlines development and prepares for seamless continuous delivery.
For Continuous Deployment (CD), this project uses ArgoCD, a declarative GitOps continuous delivery tool for Kubernetes. Application definitions, configurations, and environments should be declaratively modeled and versioned in a Git repository. You'll also use Helm, a package manager for Kubernetes, to define, install, and upgrade complex Kubernetes applications.
- ArgoCD installed on your Kubernetes cluster.
- Helm v3 installed.
-
Start by packaging your application with Helm. This involves creating a Helm chart, which is a collection of files that describe a related set of Kubernetes resources.
helm create techtrends
Modify the generated templates to fit your application's needs. Create
values.yaml
,values-prod.yaml
, andvalues-staging.yaml
for different environments. -
The application Docker image is built and pushed to Docker Hub automatically by the GitHub Actions CI pipeline whenever changes are pushed to the main branch.
-
Use ArgoCD to create an application for each environment:
For staging:
argocd app create techtrends-staging --repo https://github.com/<your-github-username>/TechTrends.git --path helm --dest-server https://kubernetes.default.svc --dest-namespace staging --values values-staging.yaml
For production:
argocd app create techtrends-prod --repo https://github.com/<your-github-username>/TechTrends.git --path helm --dest-server https://kubernetes.default.svc --dest-namespace production --values values-prod.yaml
-
You can then sync the applications:
For staging:
argocd app sync techtrends-staging
For production:
argocd app sync techtrends-prod
This will deploy your application to your Kubernetes cluster.
This guide provides an overview of the deployment process and might need to be adjusted to fit your specific use case or environment. Ensure to replace <your-github-username>
with your actual GitHub username.