From 72a11e2c8307884e3429721b0a9ab52f9b8f4298 Mon Sep 17 00:00:00 2001 From: Satyam Soni <94950988+satyampsoni@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:19:23 +0530 Subject: [PATCH 1/4] Update development.md --- developers-guide/README.md | 70 ++++++++++++++++++++++++++++++++++---- 1 file changed, 63 insertions(+), 7 deletions(-) diff --git a/developers-guide/README.md b/developers-guide/README.md index 7d9e669742..f915b268a3 100644 --- a/developers-guide/README.md +++ b/developers-guide/README.md @@ -1,12 +1,68 @@ -# Local Devtron Dev Setup +# Development Guide for Devtron -For all the open source contributors out there looking for contributing to Devtron’s code base, here’s how easily you can start contributing in Devtron. +This document provides instructions for setting up a development environment to help you get started with contributing to [Devtron](github.com/devtron-labs/devtron). Make sure to review the [contributing.md](https://github.com/devtron-labs/devtron/blob/main/CONTRIBUTING.md) file for more details on contributing. This document will help guide you through understanding the build process. -## Prerequisite -Any kubernetes Cluster +## Requirements +- [Go Programming language](https://go.dev/) +- [Docker](https://www.docker.com/) +- [Kubernetes Cluster](https://kubernetes.io/) +- [Helm v3](https://helm.sh/) ## Setup Guide -We have documented some of the most popular and easiest ways of creating local kubernetes clusters and setting up the development environment for devtron in our machine. -* [Over Minikube Cluster](https://dev.to/arushi09/local-kubernetes-development-made-easy-with-minikube-devtron-17hf) -* [Over k3s Cluster using k3d](https://hackernoon.com/how-to-install-k3d-and-devtron-locally-for-local-kubernetes-development) \ No newline at end of file +### Install Devtron in a Kubernetes cluster + +1. [Create a Kubernetes Cluster](https://docs.devtron.ai/getting-started#create-a-kubernetes-cluster) + - 2 vCPUs + - 4GB+ of free memory + - 20GB+ free disk space + +2. [Install Devtron with CI/CD along with GitOps (Argo CD) - Full mode](https://docs.devtron.ai/install/install-devtron-with-cicd-with-gitops) + + ```bash + helm repo add devtron https://helm.devtron.ai + helm repo update devtron + helm install devtron devtron/devtron-operator \ + --create-namespace --namespace devtroncd \ + --set installer.modules={cicd} \ + --set argo-cd.enabled=true + ``` + + Note: If you want to install Devtron on a Managed Kubernetes cluster, please [refer to the guide](https://docs.devtron.ai/install/demo-tutorials). + +3. Download the kubeconfig file to access your cluster. It’s a good idea to set it up locally and configure the context to point to the specific cluster you’re working with. + +4. Forward the port of PostgreSQL service and Devtron NATS service: + + ```bash + kubectl -n devtroncd port-forward svc/devtron-nats 4222:4222 + kubectl -n devtroncd port-forward svc/postgresql-postgresql 5432:5432 + ``` + +5. Use this command to extract the password of PostgreSQL (Required to put in ENV): + + ```bash + kubectl exec -it -n devtroncd postgresql-postgresql-0 -- printenv | grep POSTGRES_PASSWORD + ``` + +### Prepare Your Local Workspace + +Navigate to the `github.com` directory on your local machine: + +- `cd go/src/github.com` +- `git clone http://github.com/devtron-labs/devtron` +- Configure [Environment Variables](https://github.com/devtron-labs/devtron/blob/main/scripts/dev-conf/envfile.env) +- Run the server: + + ```bash + make run + ``` + +This will start your server on `localhost:8080`. + +### Need help? + +If you’re looking for the fastest response to your questions, we encourage you to visit our Discord community. Specifically, you can post your inquiries in the [#setup-and-installation](https://discord.com/channels/769482988882493450/801441246849007667) channel, where our team and community members are actively available to assist you on discord channel. + + + From f32d626e3c388490de3b19a15c79a871975fda7c Mon Sep 17 00:00:00 2001 From: Satyam Soni <94950988+satyampsoni@users.noreply.github.com> Date: Wed, 7 May 2025 11:45:09 +0530 Subject: [PATCH 2/4] Update README.md --- developers-guide/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/developers-guide/README.md b/developers-guide/README.md index f915b268a3..4ab50da9c9 100644 --- a/developers-guide/README.md +++ b/developers-guide/README.md @@ -52,7 +52,8 @@ Navigate to the `github.com` directory on your local machine: - `cd go/src/github.com` - `git clone http://github.com/devtron-labs/devtron` - Configure [Environment Variables](https://github.com/devtron-labs/devtron/blob/main/scripts/dev-conf/envfile.env) -- Run the server: +- Install [wire]{https://github.com/google/wire} (Required) +- Run the server: ```bash make run From f7bb9cf72e7fad4bf08b6ef489e2654d68e04bff Mon Sep 17 00:00:00 2001 From: Satyam Soni <94950988+satyampsoni@users.noreply.github.com> Date: Wed, 7 May 2025 13:08:17 +0530 Subject: [PATCH 3/4] Update README.md --- developers-guide/README.md | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/developers-guide/README.md b/developers-guide/README.md index 4ab50da9c9..8f962e7c4f 100644 --- a/developers-guide/README.md +++ b/developers-guide/README.md @@ -32,12 +32,19 @@ This document provides instructions for setting up a development environment to 3. Download the kubeconfig file to access your cluster. It’s a good idea to set it up locally and configure the context to point to the specific cluster you’re working with. -4. Forward the port of PostgreSQL service and Devtron NATS service: - - ```bash - kubectl -n devtroncd port-forward svc/devtron-nats 4222:4222 - kubectl -n devtroncd port-forward svc/postgresql-postgresql 5432:5432 - ``` +4. Forward the necessary service ports (e.g., PostgreSQL, NATS) for local access + + ``` + #Required + kubectl -n devtroncd port-forward svc/devtron-nats 4222:4222 # Allows event driven communictation between microservices. + kubectl -n devtroncd port-forward svc/postgresql-postgresql 5432:5432 #Allows your local code to connect to the database running in the cluster. + + #Optional + kubectl -n devtroncd port-forward svc/argocd-server 8000:80 #Required to interact with ArgoCD's API (GitOps) + kubectl -n devtroncd port-forward svc/argocd-dex-server 5556:5556 #Required for SSO Logins. + kubectl -n devtroncd port-forward svc/kubelink-service 50051:50051 #Required for no-gitops (helm) and fetches the status of resources. + kubectl -n devtroncd port-forward svc/git-sensor-service 7070:80 # Monitors Git repositories for changes and triggers appropriate workflows in Devtron. + ``` 5. Use this command to extract the password of PostgreSQL (Required to put in ENV): @@ -52,7 +59,7 @@ Navigate to the `github.com` directory on your local machine: - `cd go/src/github.com` - `git clone http://github.com/devtron-labs/devtron` - Configure [Environment Variables](https://github.com/devtron-labs/devtron/blob/main/scripts/dev-conf/envfile.env) -- Install [wire]{https://github.com/google/wire} (Required) +- Install [wire](ttps://github.com/google/wire) (Required) - Run the server: ```bash @@ -61,7 +68,20 @@ Navigate to the `github.com` directory on your local machine: This will start your server on `localhost:8080`. -### Need help? +## Cleanup + + ``` + 1. Uninstall Devtron and delete the 'devtroncd' namespace + helm uninstall devtron -n devtroncd + kubectl delete namespace devtroncd + + 2. Remove the local Devtron codebase + rm -rf ~/go/src/github.com/devtron-labs/devtron + ``` +## Contributing +Please check [contributing guidelines](https://github.com/devtron-labs/devtron/blob/main/CONTRIBUTING.md) + +## Need help? If you’re looking for the fastest response to your questions, we encourage you to visit our Discord community. Specifically, you can post your inquiries in the [#setup-and-installation](https://discord.com/channels/769482988882493450/801441246849007667) channel, where our team and community members are actively available to assist you on discord channel. From 55ca520c19750c92a568ebb20b5af2a0769bc0d9 Mon Sep 17 00:00:00 2001 From: Satyam Soni <94950988+satyampsoni@users.noreply.github.com> Date: Fri, 9 May 2025 12:58:51 +0530 Subject: [PATCH 4/4] Update README.md --- developers-guide/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/developers-guide/README.md b/developers-guide/README.md index 8f962e7c4f..15ea852144 100644 --- a/developers-guide/README.md +++ b/developers-guide/README.md @@ -30,7 +30,7 @@ This document provides instructions for setting up a development environment to Note: If you want to install Devtron on a Managed Kubernetes cluster, please [refer to the guide](https://docs.devtron.ai/install/demo-tutorials). -3. Download the kubeconfig file to access your cluster. It’s a good idea to set it up locally and configure the context to point to the specific cluster you’re working with. +3. [Download the kubeconfig file](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/(url)) to access your cluster. It’s a good idea to set it up locally and configure the context to point to the specific cluster you’re working with. 4. Forward the necessary service ports (e.g., PostgreSQL, NATS) for local access @@ -59,7 +59,7 @@ Navigate to the `github.com` directory on your local machine: - `cd go/src/github.com` - `git clone http://github.com/devtron-labs/devtron` - Configure [Environment Variables](https://github.com/devtron-labs/devtron/blob/main/scripts/dev-conf/envfile.env) -- Install [wire](ttps://github.com/google/wire) (Required) +- Install [wire](https://github.com/google/wire) (Required) - Run the server: ```bash