Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
santanusinha committed Aug 16, 2024
1 parent 8a947b4 commit 97cc6c1
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 14 deletions.
3 changes: 2 additions & 1 deletion docs/docs/cluster/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Executors are the agents running on the nodes where the containers are deployed.
- Find and kill any **zombie containers** that are not supposed to exist on that node. The check is done every 30 seconds.
- Provide container **log-file** listing and offset based content delivery APIs to container

## NGinx and Drove-Nixy
## NGinx and Drove-Gateway
Almost all of the traffic between service containers is routed via the internal Ranger based service discovery system at PhonePe. However, traffic from the edge as well and between different protected environments are routed using the well-established **virtual host** (and additionally, in some unusual cases, header) based routing.

- All applications on Drove can specify a Vhost and a port name as endpoint for such routing.
Expand All @@ -85,6 +85,7 @@ Nixy plays the following role in a cluster:

## Other components
There are a few more components that are used for operational management and observability.

### Telegraf
PhonePe’s internal metric management system uses a HTTP based metric collector. Telegraf is installed on all Drove nodes to collect metric from the metric port (Admin connector on Dropwizard) and push that information to our metric ingestion system. This information is then used to build dashboards as well as by our Anomaly detection and alerting systems.

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/cluster/setup/gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ slowstartupstream = "0s"

1. Nixy listener configuration. Endpoint for nixy itself.

2. List of Drove controllers. Add all controller nodes here. Nixy will automatically determine and track th current leader.
2. List of Drove controllers. Add all controller nodes here. Nixy will automatically determine and track the current leader.

> _Auto detection is disabled if a single endpoint is specified._
Expand All @@ -57,15 +57,15 @@ slowstartupstream = "0s"

> In this example, the RoutingTag variable will be set to the value specified in the `routing_tag` tag key specified when deploying the Drove Application. For example, if we want to expose the app we can set it to `yes`, and filter the VHost to be exposed in NGinx template when `RoutingTag == "yes"`.
5. Nixy works on event polling on controller. This is the polling interval. Especially if number of NGinx nodes is high. Default is `2 seconds`. Unless cluster is really busy with a high rate of change of containers, this strikes a good balance between apps becoming discoverable vs putting the leader controller under heavy load.
5. Drove Gateway/Nixy works on event polling on controller. This is the polling interval. Especially if number of NGinx nodes is high. Default is `2 seconds`. Unless cluster is really busy with a high rate of change of containers, this strikes a good balance between apps becoming discoverable vs putting the leader controller under heavy load.

6. `user` and `pass` are optional params can be used to set basic auth credentials to the calls made to Drove controllers if basic auth is enabled on the cluster. Leave empty if no basic auth is required.

7. If cluster has some custom header based auth, the following can be used. The contents on this parameter are passed verbatim to the Authorization HTTP header. Leave empty if no token auth is enabled on the cluster.

8. By default drove-gateway will expose all vhost declared in the spec for all drove apps on a cluster (caveat: filtering can be done using RoutingTag as well). If specific vhosts need to be exposed, set the realms parameter to a comma separated list of realms. Optional.

9. Beside perfect vhost matching, Nixy supports suffix based matches as well. A single suffix is supported. Optional.
9. Beside perfect vhost matching, Drove Gateway supports suffix based matches as well. A single suffix is supported. Optional.

10. Path to NGinx config.

Expand Down
67 changes: 66 additions & 1 deletion docs/docs/extra/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,75 @@ Setup the drove version
```xml
<properties>
<!--other properties-->
<drove.version>1.28</drove.version>
<drove.version>1.29</drove.version>
</properties>
```

!!!note "Checking the latest version"
Latest version can be checked at the github packages page [here](https://github.com/PhonePe/drove/packages/2229703){:target="_blank"}

!!!danger "Accessing maven repo on github"
Public repos on github need authentication. In order to use these please follow the steps as mentioned below:

- Create a Personal Access Token on github.
- Go to your account -> Settings -> Developer settings -> Personal access token -> Tokens (classic) -> Generate new token (classic)
(Basically create a PAT and add your username and password in maven-settings.xml or .m2/settings.xml for the repo `https://maven.pkg.github.com/phonepe/drove`).
- The only permission needed is `read:packages`.

- Create a settings file or add required configurations to your `~/.m2/settings.xml`.

Sample settings file:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/phonepe/drove</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>YOUR GITHUB USERNAME</username>
<password>YOUR PERSONAL ACCESS TOKEN</password>
</server>
</servers>

</settings>

```
> Your PAT works fine as the repo itself is public.

To build:
```shell
mvn -s /path/to/settings.xml clean package
```

If setting up your github actions, please follow the steps in this excellent [stack-overflow answer](https://stackoverflow.com/questions/64706720/how-to-access-maven-dependency-from-github-packages-on-a-github-actions-workflow){:target="_blank"} to setup your actions correctly.


All libraries are located in sub packages of the top level package `com.phonepe.drove`.

!!!danger "Java Version Compatibility"
Expand Down
17 changes: 10 additions & 7 deletions docs/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

To get a trivial cluster up and running on a machine, the [compose file](https://raw.githubusercontent.com/PhonePe/drove-orchestrator/master/compose/compose.yaml) can be used.

Usage:

```shell
git clone [email protected]:PhonePe/drove-orchestrator.git
git submodule init
git submodule update
```
## Update etc hosts to interact wih nginx
Add the following lines to `/etc/hosts`
```
Expand Down Expand Up @@ -79,3 +72,13 @@ drove -c local apps scale TEST_APP-1 0 -w
drove -c local apps destroy TEST_APP-1
```

## Accessing the code
Code is hosted on github.

Cloning everything:

```shell
git clone [email protected]:PhonePe/drove-orchestrator.git
git submodule init
git submodule update
```
2 changes: 1 addition & 1 deletion drove
Submodule drove updated 637 files

0 comments on commit 97cc6c1

Please sign in to comment.