github.com/argoproj/argo-cd/v3@v3.2.1/docs/developer-guide/tilt.md (about)

     1  # Tilt Development
     2  
     3  [Tilt](https://tilt.dev/) provides a real-time web UI that offers better visibility into logs, health status, and dependencies, making debugging easier compared to relying solely on terminal outputs. With a single `tilt up` command, developers can spin up all required services without managing multiple processes manually, simplifying the local development workflow. Tilt also integrates seamlessly with Docker and Kubernetes, allowing for efficient container-based development. Unlike goreman, which lacks dynamic config reloading, Tilt can detect and apply changes to Kubernetes YAML and Helm charts without full restarts, making it more efficient for iterative development.
     4  
     5  ### Prerequisites
     6  * kubernetes environment (kind, minikube, k3d, etc.)
     7  * tilt (`brew install tilt`)
     8  * kustomize
     9  * kubectl
    10  
    11  ### Running
    12  1. Spin up environment by running `tilt up` in the root directory of the repo
    13      * Resources will be deployed into the `argocd` namespace in the cluster that your `kubeconfig` is currently pointed to. 
    14  
    15  2. Use `ctrl+c` to close tilt which stops watching files for changes and closes port-forwards. Everything deployed to the local cluster will be left in tact and continue to run. Run `tilt up` again to start up another session and pick up where you left off.   
    16  
    17  ### Cleanup
    18  To remove all deployed resources in your local cluster including CRDs, run `tilt down` from the root of the repo. 
    19  
    20  ### Port Forwarding
    21  Port forwarding is automatically setup from the cluster to localhost host for the folling ports:
    22  
    23  | Deployment | API | Metrics | Webhook | Debug |
    24  |------------|-----|---------|---------|-------|
    25  | argocd-server | 8080 | 8083 | | 9345 |
    26  | argocd-repo-server | 8081 | 8084 | | 9346 |
    27  | argocd-redis | 6379 | | | |
    28  | argocd-applicationset-controller | | 8085 | 7000 | 9347 |
    29  | argocd-application-controller | | 8086 | | 9348 |
    30  | argocd-notifications-controller | | 8087 | | 9349 |
    31  | argocd-commit-server | 8089 | 8088 | | 9350 |
    32  
    33  ### Debugging ArgoCD
    34  Each deployed pod running ArgoCD components uses delve to expose a debug port. Tilt is configured to forward each of those ports locally to `localhost`. IDEs can attach to the corresponding application to set break points and debug code running inside the cluster. 
    35  
    36  | Deployment | Debug Host Port |
    37  |-----------|------------|
    38  | argocd-server | localhost:9345 |
    39  | argocd-repo-server | localhost:9346 |
    40  | argocd-applicationset-controller | localhost:9347 |
    41  | argocd-application-controller | localhost:9348 |
    42  | argocd-notifications-controller | localhost:9349 |
    43  | argocd-commit-server | localhost:9350 |
    44  
    45  
    46  #### VS Code
    47  Add a `.vscode/launch.json` file with these configurations to support attaching to running pods corresponding to the service. 
    48  
    49  
    50  ```json
    51  {
    52      "version": "0.2.0",
    53      "configurations": [
    54          {
    55              "name": "Connect to server",
    56              "type": "go",
    57              "request": "attach",
    58              "mode": "remote",
    59              "remotePath": "${workspaceFolder}",
    60              "port": 9345,
    61              "host": "127.0.0.1"
    62          },
    63          {
    64              "name": "Connect to repo-server",
    65              "type": "go",
    66              "request": "attach",
    67              "mode": "remote",
    68              "remotePath": "${workspaceFolder}",
    69              "port": 9346,
    70              "host": "127.0.0.1"
    71          },
    72          {
    73              "name": "Connect to applicationset-controller",
    74              "type": "go",
    75              "request": "attach",
    76              "mode": "remote",
    77              "remotePath": "${workspaceFolder}",
    78              "port": 9347,
    79              "host": "127.0.0.1"
    80          },
    81          {
    82              "name": "Connect to application-controller",
    83              "type": "go",
    84              "request": "attach",
    85              "mode": "remote",
    86              "remotePath": "${workspaceFolder}",
    87              "port": 9348,
    88              "host": "127.0.0.1"
    89          },
    90          {
    91              "name": "Connect to notifications-controller",
    92              "type": "go",
    93              "request": "attach",
    94              "mode": "remote",
    95              "remotePath": "${workspaceFolder}",
    96              "port": 9349,
    97              "host": "127.0.0.1"
    98          },
    99          {
   100              "name": "Connect to commit-server",
   101              "type": "go",
   102              "request": "attach",
   103              "mode": "remote",
   104              "remotePath": "${workspaceFolder}",
   105              "port": 9350,
   106              "host": "127.0.0.1"
   107          }
   108      ]
   109  }
   110  ```
   111  
   112  #### Goland
   113  Add a `.run/remote-debugging.run.xml` file with these configurations to support attaching to running pods corresponding to the service. 
   114  
   115  ```xml
   116  <component name="ProjectRunConfigurationManager">
   117      <configuration default="false" name="Connect to server" type="GoRemoteDebugConfigurationType" factoryName="Go Remote" focusToolWindowBeforeRun="true" port="9345">
   118          <option name="disconnectOption" value="LEAVE" />
   119          <disconnect value="LEAVE" />
   120          <method v="2" />
   121      </configuration>
   122      <configuration default="false" name="Connect to repo-server" type="GoRemoteDebugConfigurationType" factoryName="Go Remote" focusToolWindowBeforeRun="true" port="9346">
   123          <option name="disconnectOption" value="LEAVE" />
   124          <disconnect value="LEAVE" />
   125          <method v="2" />
   126      </configuration>
   127      <configuration default="false" name="Connect to applicationset-controller" type="GoRemoteDebugConfigurationType" factoryName="Go Remote" focusToolWindowBeforeRun="true" port="9347">
   128          <option name="disconnectOption" value="LEAVE" />
   129          <disconnect value="LEAVE" />
   130          <method v="2" />
   131      </configuration>
   132      <configuration default="false" name="Connect to application-controller" type="GoRemoteDebugConfigurationType" factoryName="Go Remote" focusToolWindowBeforeRun="true" port="9348">
   133          <option name="disconnectOption" value="LEAVE" />
   134          <disconnect value="LEAVE" />
   135          <method v="2" />
   136      </configuration>
   137      <configuration default="false" name="Connect to notifications-controller" type="GoRemoteDebugConfigurationType" factoryName="Go Remote" focusToolWindowBeforeRun="true" port="9349">
   138          <option name="disconnectOption" value="LEAVE" />
   139          <disconnect value="LEAVE" />
   140          <method v="2" />
   141      </configuration>
   142      <configuration default="false" name="Connect to commit-server" type="GoRemoteDebugConfigurationType" factoryName="Go Remote" focusToolWindowBeforeRun="true" port="9350">
   143          <option name="disconnectOption" value="LEAVE" />
   144          <disconnect value="LEAVE" />
   145          <method v="2" />
   146      </configuration>
   147  </component>
   148  ```