{"id":18928848,"url":"https://github.com/kubesimplify/devops-project","last_synced_at":"2025-10-07T07:46:37.627Z","repository":{"id":252049447,"uuid":"838664936","full_name":"kubesimplify/devops-project","owner":"kubesimplify","description":"This is the repo for DevOps project.","archived":false,"fork":false,"pushed_at":"2025-03-21T09:16:36.000Z","size":49,"stargazers_count":71,"open_issues_count":0,"forks_count":46,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-20T02:02:24.339Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","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/kubesimplify.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,"zenodo":null}},"created_at":"2024-08-06T05:35:57.000Z","updated_at":"2025-05-12T14:42:09.000Z","dependencies_parsed_at":"2025-05-13T01:14:05.750Z","dependency_job_id":"33c2cc78-7dcb-4ee1-907b-c27b3ceca0a5","html_url":"https://github.com/kubesimplify/devops-project","commit_stats":null,"previous_names":["kubesimplify/devops-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kubesimplify/devops-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesimplify%2Fdevops-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesimplify%2Fdevops-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesimplify%2Fdevops-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesimplify%2Fdevops-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kubesimplify","download_url":"https://codeload.github.com/kubesimplify/devops-project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesimplify%2Fdevops-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278740816,"owners_count":26037480,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-08T11:28:24.433Z","updated_at":"2025-10-07T07:46:37.594Z","avatar_url":"https://github.com/kubesimplify.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repo is for the video below \n\n\n[![Conplete DevOps Project](https://img.youtube.com/vi/kCWAwXFnYic/0.jpg)](https://www.youtube.com/watch?v=kCWAwXFnYic)\n\n# Running Locally \n## Initialising for base image\n```\nbsf init\n``` \n## Building OCI artifact using bsf and ko\n```\nbsf oci pkgs --platform=linux/amd64 --tag=prod-v1 --push --dest-creds {Dockerhub username}:{dockerhub password}\nKO_DOCKER_REPO=saiyam911/devops-project KO_DEFAULTBASEIMAGE=saiyam911/devops-proj:base ko build --bare -t v1 . (change your image names here)\n```\n## Running using Docker\n```\ndocker run -d --name grafana -p 3000:3000 grafana/grafana\ndocker run -d --name prometheus -p 9090:9090 -v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus\ndocker run --name local-postgres -e POSTGRES_USER=myuser -e POSTGRES_PASSWORD=mypassword -e POSTGRES_DB=mydb -p 5432:5432 -d postgres\ndocker exec -it local-postgres psql -U myuser -d mydb\nCREATE TABLE goals (\n    id SERIAL PRIMARY KEY,\n    goal_name TEXT NOT NULL\n);\ndocker run -d \\\n  --platform=linux/amd64 \\\n  -p 8080:8080 \\\n  -e DB_USERNAME=myuser \\\n  -e DB_PASSWORD=mypassword \\\n  -e DB_HOST=host.docker.internal \\\n  -e DB_PORT=5432 \\\n  -e DB_NAME=mydb \\\n  -e SSL=disable \\\n ttl.sh/devops-project-1a3a3957a5f042748486580be307ed8e@sha256:9ae320cdf05700210dd50ebefa6b3cd4a11ca2feaad1946f6715e0ec725bda62\n```\n\n## Cluster creatiom \n```ksctl create-cluster azure --name=application --version=1.29```\n\n## Switching the KubeConfig file \n```ksctl switch-cluster --provider azure --region eastus --name devops-project```\n\n## Exporting Kubeconfig\n```export KUBECONFIG=\"/Users/saiyam/.ksctl/kubeconfig\"```              \n\n## Installing basic componenets cert manager, nginx fabric for gateway API, Prometheus. for monitoring and Grafana for visualization. \n### Cert manager\n```\nkubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.15.3/cert-manager.yaml\n```\nEdit cert-manager deployment \n```\n- --enable-gateway-api\n```\n```kubectl rollout restart deployment cert-manager -n cert-manager```\n\n### Install Kube prometheus stack\n```\nhelm repo add prometheus-community https://prometheus-community.github.io/helm-charts\nhelm repo update\nhelm install kube-prometheus-stack prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespace\n\n```\n### Getting Grafana login secret for admin user\n\n```\nkubectl get secret --namespace monitoring kube-prometheus-stack-grafana -o jsonpath=\"{.data.admin-password}\" | base64 --decode ; echo\nkubectl port-forward svc/grafana 3000:80 -n monitoring\n```\n\n## Install Nginx fabric gateway\n```\nkubectl kustomize \"https://github.com/nginxinc/nginx-gateway-fabric/config/crd/gateway-api/standard?ref=v1.3.0\" | kubectl apply -f -\nhelm install ngf oci://ghcr.io/nginxinc/charts/nginx-gateway-fabric --create-namespace -n nginx-gateway\n```\n\n\n## Install Cloudnative postgress DB \n```\nkubectl apply --server-side -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.23/releases/cnpg-1.23.1.yaml\n```\n```\ncat \u003c\u003c EOF | kubectl apply -f -\napiVersion: postgresql.cnpg.io/v1\nkind: Cluster\nmetadata:\n  name: my-postgresql\n  namespace: default\nspec:\n  instances: 3\n  storage:\n    size: 1Gi\n  bootstrap:\n    initdb:\n      database: goals_database\n      owner: goals_user\n      secret:\n        name: my-postgresql-credentials\nEOF        \n```\n### Creating secret for cluster\n```\nkubectl create secret generic my-postgresql-credentials --from-literal=password='new_password'  --from-literal=username='goals_user'  --dry-run=client -o yaml | kubectl apply -f -\nkubectl exec -it my-postgresql-1 -- psql -U postgres -c \"ALTER USER goals_user WITH PASSWORD 'new_password';\"\n```\n\n### Creating Table inside the database\n```\nkubectl port-forward my-postgresql-1 5432:5432\nPGPASSWORD='new_password' psql -h 127.0.0.1 -U goals_user -d goals_database -c \"\n\nCREATE TABLE goals (\n    id SERIAL PRIMARY KEY,\n    goal_name VARCHAR(255) NOT NULL\n);\n\"\n```\n\n### Create secret to be used by the application \n```\ncat \u003c\u003c EOF | kubectl apply -f - \napiVersion: v1\nkind: Secret\nmetadata:\n  name: postgresql-credentials\ntype: Opaque\ndata:\n  password: bmV3X3Bhc3N3b3Jk\n  username: Z29hbHNfdXNlcg==\nEOF\n```\n\n\n### Application deployment(Currently this has the gateway for both Argocd and the application)\n```\nkubectl apply -f deploy/deploy.yaml\n```\n\n## Argocd installation \n```\nkubectl create namespace argocd\nkubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml\nkubectl patch configmap argocd-cmd-params-cm  -n argocd --patch '{\"data\":{\"server.insecure\":\"true\"}}'\nkubectl rollout restart deployment argocd-server -n argocd\nkubectl get secret --namespace argocd argocd-initial-admin-secret -o jsonpath=\"{.data.password}\" | base64 --decode ; echo \n```\n\n## Create Route for ArgoCD \n```\nkubectl apply -f route-argo.yaml\nkubectl apply -f referencegrant\n```\n## Load testing \n```\nk6s run load.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubesimplify%2Fdevops-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkubesimplify%2Fdevops-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubesimplify%2Fdevops-project/lists"}