{"id":19205353,"url":"https://github.com/evgeny-nik/project_platform_app","last_synced_at":"2026-04-28T12:31:25.099Z","repository":{"id":249049044,"uuid":"830481526","full_name":"Evgeny-Nik/project_platform_app","owner":"Evgeny-Nik","description":"a project that indegrates Flask, Github Actions, DockerHub, Helm, ArgoCD, Terraform, EKS, and Redis..","archived":false,"fork":false,"pushed_at":"2024-07-29T12:27:41.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T04:05:49.888Z","etag":null,"topics":["argocd","ci-cd","dockerhub-image","eks-cluster","flask-application","github-actions","helm","python","redis","terraform"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Evgeny-Nik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-18T11:04:59.000Z","updated_at":"2024-07-29T12:27:44.000Z","dependencies_parsed_at":"2024-11-09T13:12:34.864Z","dependency_job_id":"bf8373c8-bacf-40a3-96c7-a6087728fb9d","html_url":"https://github.com/Evgeny-Nik/project_platform_app","commit_stats":null,"previous_names":["evgeny-nik/project_platform_app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Evgeny-Nik/project_platform_app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evgeny-Nik%2Fproject_platform_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evgeny-Nik%2Fproject_platform_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evgeny-Nik%2Fproject_platform_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evgeny-Nik%2Fproject_platform_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Evgeny-Nik","download_url":"https://codeload.github.com/Evgeny-Nik/project_platform_app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Evgeny-Nik%2Fproject_platform_app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32381226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T11:25:28.583Z","status":"ssl_error","status_checked_at":"2026-04-28T11:25:05.435Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argocd","ci-cd","dockerhub-image","eks-cluster","flask-application","github-actions","helm","python","redis","terraform"],"created_at":"2024-11-09T13:12:27.238Z","updated_at":"2026-04-28T12:31:25.080Z","avatar_url":"https://github.com/Evgeny-Nik.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Platform Flask App Integration with EKS\n\n## Project overview\n\nThis project demonstrates a CI/CD and GitOps deployment of a Flask application using GitHub Actions, Terraform, and ArgoCD.\n\n## Application\nThe application is a Flask web platform that facilitates the creation, display, and destruction of various Kubernetes environments using a predefined Helm chart.\n\n## Workflow overview\n\nThe project includes the following workflow:\n   1. CI/CD for Flask App: Manages the continuous integration and deployment cycle of the platform application.\n\n### 1. CI/CD for Flask App\n\nThis workflow builds and deploys a Flask application that communicates with the Kubernetes API. \\\nKey steps include:\n\n   - **Read and Increment Version**: Reads the `version.txt` file for current version, and increments patch number by 1.\n   - **Build the Docker image**: Builds a Docker image and tags it with the current version and latest\n   - **Docker Login**: Logs into Docker Hub using provided credentials.\n   - **push to Docker Hub**: Pushes the tagged Docker images to Docker Hub.\n   - **Update Manifest and Version Files**: Updates the manifest and version file with the new version number for ArgoCD.\n\n#### Trigger\n\nThis workflow is triggered on a push event to the `main` branch in the following paths:\n```yaml\non:\n  push:\n    branches: \n      - \"main\"\n    paths:       \n      - 'platform_app/**'\n      - '.github/workflows/platform_app_ci.yaml'\n      - '!**/README.md'\n```\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch2\u003eReproducing the Project\u003c/h2\u003e\u003c/summary\u003e\n\n## Flask Application:\n\n### Overview\n\n- **platform_app**\n  - `app.py`: A simple Flask web application that manages multiple endpoints and communicates with Kubernetes API.\n\n## Web_App Dockerfile\n\n- **Base Image**: Uses `python:alpine3.19` for a lightweight Python environment.\n- **Install Helm**: Uses `apk` to install curl, bash, and openssl to install Helm 3, then removes unnecessary packages while keeping Helm operational.\n- **Work Directory**: Sets the working directory to `/app`.\n- **Install Dependencies**: Copies `requirements.txt` and installs Python dependencies without cache (including the Flask[async] addon).\n- **Copy Source Code**: Copies the source code to the working directory.\n- **Create Temp Session Store**: Creates a directory to store the temporary session store for use when running in a container.\n- **Run Application**: Uses Gunicorn to run the Flask application with pre-configured `gunicorn.conf.py` file.\n\n## Setup\n\n1. **Clone the Repository**:\n    ```bash\n    git clone https://github.com/Evgeny-Nik/project_platform_app.git\n    cd project_platform_app\n    ```\n2. **Setup the .env file**:\n    ```bash\n    touch platform_app/.env\n    ```\n\n#### Environment Variables Example (.env-example)\n\nThe `.env` file in your `platform_app` directory should have the following example values:\n\n    ```\n    DOCKER_HUB_USERNAME=\"\u003cusername\u003e\"\n    DOCKER_HUB_ACCESS_TOKEN=\"\u003ctoken\u003e\"\n    SESSION_KEY=\"\u003csession_secret_key\u003e\"\n    HELM_CHART=\"\u003cpath_or_url_to_helm_chart\u003e\"\n    KUBECONFIG=\"\u003cpath_to_.kube/config\u003e\"\n    REDIS_HOST_URL='\u003cyour_redis_host_url\u003e'\n    REDIS_HOST_PORT='\u003cport_num_your_redis_is_exposed_at\u003e'\n    REDIS_HOST_PASSWORD='\u003cyour_redis_password\u003e'\n    ```\n    \n*KUBECONFIG env var is only required when the app is deployed out of kubernetes.\n\n3. **Trigger the workflow to build the app**:\n   - Push changes to the `main` branch.\n   - See triggers [here](#trigger).\n\n4. **Deploy the app to the environment of your choosing**:\n   - To manually run the platform app locally:\n     ```bash\n     cd platform_app\n     python -m venv venv\n     source venv/bin/activate \n     pip install -r requirements.txt\n     python3 platform_app/app.py\n     ```\n     The Platform App will then be accessible in `http://localhost:5000`\n\n   - To manually run the platform app in a container:\n     ```bash\n     cd platform_app\n     docker build -t ${DOCKERHUB_USERNAME}/platform_app:latest .\n     docker run -d -v \u003c/path/to/.kube/config\u003e:\u003c/path/to/.kube/config\u003e -p 8000:8000 --env-file .env ${DOCKERHUB_USERNAME}/platform_app:latest\n     ```\n     The Platform App will then be accessible in `http://localhost:8000`\n\n   - To manually run the platform in a Kubernetes Cluster:\n     ```bash\n     cd tf-Files\n     terraform init \\\n       -backend-config=\"bucket=\u003cyour_s3_bucket's_name\u003e\" \\\n       -backend-config=\"key=\u003cyour_s3_statefiles's_key\u003e\"\n     terraform validate\n     terraform plan\n     terraform apply -auto-approve\n     ```\n     For further Setup steps go to [tf_files README](tf_files/README.md)\n\n## Slack\n\n```yaml\n    - name: Send Slack Notification\n      uses: 8398a7/action-slack@v3\n      with:\n        status: ${{ job.status }}\n        fields: repo,message,commit,author,action,eventName,ref,workflow,job,took\n      env:\n        SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required\n      if: always() # Pick up events even if the job fails or is canceled.\n```\n\nTo incorporate Slack notifications for your GitHub Actions pipeline do the following:\n\n1. **Set Up Slack Webhook**:\n   - Create a [Slack Application](https://api.slack.com/apps)\n   - Create an Incoming Webhook in your Slack workspace and obtain the Webhook URL.\n   - Store the Webhook URL as a secret in your GitHub repository settings:\n     - Go to your repository on GitHub.\n     - Click on `Settings` \u003e `Secrets and variables` \u003e `Actions`.\n     - Click on `New repository secret` and add `SLACK_WEBHOOK_URL` with the Webhook URL as the value.\n\n3. **Customize Notification Fields**:\n   - Customize the fields parameter in the `with` section to include the details you want in the Slack message.\n\n\u003c/details\u003e\n\n### GitHub Actions Plugins Used\n\n- **actions/checkout@v4**: Checks out the repository to the runner.\n- **docker/login-action@v3.1.0**: Logs into Docker Hub.\n- **8398a7/action-slack@v3**: Sends a Slack message.\n\n## To-Do List\n\n- [ ] Fully integrate flask sessions: add user login/logout, support for multiple pods/gunicorn workers. \n- [ ] Create tests.\n- [x] Integrate HTTPS support for the platform app via Let's Encrypt.\n\n## Links\n- [platform_app README](platform_app/README.md)\n- [tf_files README](tf_files/README.md)\n- [charts](charts/README.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevgeny-nik%2Fproject_platform_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevgeny-nik%2Fproject_platform_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevgeny-nik%2Fproject_platform_app/lists"}