{"id":19621519,"url":"https://github.com/mnstrlara/kubestream","last_synced_at":"2026-04-18T11:04:02.594Z","repository":{"id":226665548,"uuid":"769326823","full_name":"mnstrlara/kubestream","owner":"mnstrlara","description":"GitOps-Enabled Kubernetes Deployment with FluxCD, Flagger, and CDK","archived":false,"fork":false,"pushed_at":"2024-09-13T08:58:47.000Z","size":127,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-09T11:40:24.882Z","etag":null,"topics":["aws","cdk","cloudformation","flagger","fluxcd","gitops","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnstrlara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-03-08T20:17:11.000Z","updated_at":"2024-09-13T08:58:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"41c356c6-ff96-42cc-b732-f25a68258326","html_url":"https://github.com/mnstrlara/kubestream","commit_stats":null,"previous_names":["manestarlara/cdk-k8s-deployment","mnstrlara/kubestream"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnstrlara%2Fkubestream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnstrlara%2Fkubestream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnstrlara%2Fkubestream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnstrlara%2Fkubestream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnstrlara","download_url":"https://codeload.github.com/mnstrlara/kubestream/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240917723,"owners_count":19878308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aws","cdk","cloudformation","flagger","fluxcd","gitops","kubernetes"],"created_at":"2024-11-11T11:23:23.212Z","updated_at":"2026-04-18T11:03:57.570Z","avatar_url":"https://github.com/mnstrlara.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitOps-Enabled Kubernetes Deployment with FluxCD, Flagger, and CDK\n\n## Objective:\nThe objective of this project is to set up a continuous deployment pipeline for a sample application using FluxCD for GitOps-style continuous delivery, Flagger for progressive delivery (canary deployments), and CDK for infrastructure as code (IaC) to provision and manage AWS resources.\n\n## Components:\n### 1. Sample Application\nWe need a sample application to deploy. I am going to be using an AWS EC2 Instance that has a Kubernetes cluster deployed inside of it using AWS CloudFormation.\n### 2. Flux CD\nFluxCD will be used to automate the deployment of the application. It will watch a Git repository where the application manifests are stored and ensure that the cluster stays in sync with the desired state defined in the Git repository.\n### 3. Flagger\nFlagger will be used for progressive delivery, enabling canary deployments and automated analysis of metrics (e.g., latency, error rates) to determine whether to promote or rollback a new version of the application.\n### 4. CDK (AWS Cloud Development Kit)\nCDK will be used to provision and manage AWS resources required by the application.\n\n## Pre-requisites:\n- AWS Root account created and available\n- AWS CLI installed on local machine\n- AWS CDK installed on local machine\n\n## .env Configuration\nSince there are some secret credentials that need to stay hidden they have been added inside the `.env` file. This is an example of the contents inside the file:\n```shell\nACCOUNT_ID=[string]\nACCOUNT_REGION=[string]\nVPC_ID=[string]\nAMI_ID=[string]\nSUBNET_ID=[string]\nEC2_KEYPAIR=[string]\n```\n\n## Steps:\n### 1. Kubernetes Deployment Flow using CDK\nAfter following the documentation on installing CDK and running the cdk synth and bootstrap command, the next step would be to deploy the template using the\n`cdk deploy` command. After running the command it should prompt you on whether you are sure about deploying the template to AWS CloudFormation.\nAfter typing `y` the command is going to automatically create a change set in AWS CloudFormation and then deploy the stack.\n\n### 2. Inside the Instance/Cluster\nAfter SSHing inside the EC2 Instance, check if all of the components that are part of the `userData.sh`\nhave been successfully installed/created; if they have, the next part would be to set up our FluxCD. Since we have\nalready installed FluxCD with the userdata script, all we have to do is run the bootstrap command. \nBut before we get to do that we should check our prerequisites with the `flux check --pre` command. If all the checks passed, we can now run our bootstrap command.\n\nExample:\n```bash\nflux bootstrap github \\\n  --owner=$GITHUB_USER \\\n  --repository=example-name \\\n  --branch=main \\\n  --path=./example-path \\\n  --personal\n```\nAfter applying this command, your terminal is going to ask you for your GitHub PAT(Personal Access Token) which you can create in your GitHub Settings\u003eDeveloper Settings\u003ePersonal Access Tokens\u003eTokens(classic)\u003eGenerate New Token\u003eGenerate New Token(classic); and then choose the Expiration date and the Scopes that fit your project best and finish off with \"Generate Token\".\n\nThis bootstrap command is going to push the Flux manifests to your Git repository and deploy Flux to your cluster. And as it becomes a part of your Git repository, since it is located in the path where your Kubernetes manifests are located, it will automatically deploy your manifests to your cluster without any extra commands.\n\n### 3. Flagger Progressive Delivery\nAs Istio and Flagger installations are part of the `userData.sh` script, there is no further commands needed. The `flagger.yaml` canary deployment is located in the `k8s-deployments` directory with the rest of the Kubernetes manifests, which means that FluxCD does the deployment of the canary as well. To check if the canary is available, run the following command:\n```shell\nkubectl get canaries --all-namespaces\n```\n\n### Documentation\n#### [AWS CLI install and update instructions](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) - This topic describes how to install or update the latest release of the AWS Command Line Interface (AWS CLI) on supported operating systems\n#### [Getting started with AWS CDK](https://docs.aws.amazon.com/cdk/v2/guide/hello_world.html) - Quick Tutorial on starting with AWS CDK\n#### [Flux Bootstrap Command](https://fluxcd.io/flux/cmd/flux_bootstrap/) - Several options on which bootstrap command to use and the proper way to use it\n#### [Istio Canary Deployments](https://docs.flagger.app/tutorials/istio-progressive-delivery) - This guide shows you how to use Istio and Flagger to automate canary deployments","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnstrlara%2Fkubestream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnstrlara%2Fkubestream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnstrlara%2Fkubestream/lists"}