Skip to content

Commit

Permalink
Update docker compose docs (#49)
Browse files Browse the repository at this point in the history
* Update docker-compose docs
* Use h4 headings to make content more accessible
* Update timestamps
  • Loading branch information
mostafa authored Mar 10, 2024
1 parent 393c394 commit c4771c3
Show file tree
Hide file tree
Showing 45 changed files with 95 additions and 50 deletions.
2 changes: 1 addition & 1 deletion developing-plugins/grpc-api-reference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: gRPC API Reference
description: GatewayD exposes a gRPC API that can be used to interact with the GatewayD plugin system. This API can be used by the GatewayD plugins and is available in the GatewayD SDK.
Expand Down
2 changes: 1 addition & 1 deletion developing-plugins/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Developing Plugins
nav_order: 4
Expand Down
2 changes: 1 addition & 1 deletion developing-plugins/plugin-developers-guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Plugin Developers Guide
description: Plugin developers' guide of GatewayD
Expand Down
2 changes: 1 addition & 1 deletion developing-plugins/sdk-reference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: SDK Reference
description: The GatewayD plugin SDK provides a number of interfaces, structs and methods to help you build your plugin.
Expand Down
2 changes: 1 addition & 1 deletion developing-plugins/template-projects.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Template Projects
description: Template projects can be used to quickly get started with developing plugins.
Expand Down
2 changes: 1 addition & 1 deletion getting-started/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Getting Started
nav_order: 1
Expand Down
57 changes: 51 additions & 6 deletions getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:54:48
layout: default
title: Installation
description: How to install GatewayD and its plugins on different platforms and how to build it from source.
Expand Down Expand Up @@ -67,32 +67,77 @@ sudo rpm -i gatewayd-{% github_latest_release gatewayd-io/gatewayd v %}-1.x86_64

### Docker image

GatewayD is also available as a Docker image. The image is available on [GitHub Container Registry](https://ghcr.io/gatewayd-io/gatewayd:latest) and [Docker Hub](https://hub.docker.com/r/gatewaydio/gatewayd).
GatewayD is also available as a Docker image. The image is available on [Docker Hub](https://hub.docker.com/r/gatewaydio/gatewayd) and [GitHub Container Registry](https://ghcr.io/gatewayd-io/gatewayd:latest).

To run GatewayD using Docker, you can use the following command, considering that the `gatewayd.yaml` and `gatewayd_plugins.yaml` configuration files and plugins are located in the current working directory on the host machine. The server will be available on port `15432` on the host machine and the container will be removed after it exits.

```bash
docker run -v ./:/opt -p 15432:15432 --rm ghcr.io/gatewayd-io/gatewayd:latest run --config /opt/gatewayd.yaml --plugins-config /opt/gatewayd_plugins.yaml
docker run -v ./:/opt -p 15432:15432 --rm gatewaydio/gatewayd:latest run --config /opt/gatewayd.yaml --plugins-config /opt/gatewayd_plugins.yaml
```

The same image can be used to install plugins. The plugins will be installed in the `plugins` directory in the current working directory on the host machine.

```bash
docker run -v ./:/opt --rm ghcr.io/gatewayd-io/gatewayd:latest plugin install github.com/<organization>/<plugin-name>@<version> --plugins-config /opt/gatewayd_plugins.yaml
docker run -v ./:/opt --rm gatewaydio/gatewayd:latest plugin install github.com/<organization>/<plugin-name>@<version> --plugins-config /opt/gatewayd_plugins.yaml
```

{: .note }
> In the above examples, the image from GitHub Container Registry is used. To use the image from Docker Hub, replace `ghcr.io/gatewayd-io/gatewayd:latest` with `gatewaydio/gatewayd:latest`.
> In the above examples, the image from Docker Hub is used. To use the image from GitHub Container Registry, replace `gatewaydio/gatewayd:latest` with `ghcr.io/gatewayd-io/gatewayd:latest`.
### Docker Compose

For ease of use, a [docker-compose](https://github.com/gatewayd-io/gatewayd/blob/main/docker-compose.yaml) file is available. It starts two services: a PostgreSQL database and GatewayD. The server will be available on port `15432` on the host machine.
For ease of use, a [docker-compose](https://github.com/gatewayd-io/gatewayd/blob/main/docker-compose.yaml) file and a [setup.sh](https://github.com/gatewayd-io/gatewayd/blob/main/setup.sh) are available, which starts a few services to demonstrate the capabilities of GatewayD. This is a good starting point to test GatewayD and its plugins.

#### Download and run the docker-compose file

To download and run the docker-compose and the setup files, use the following commands:

```bash
# Create a new directory and navigate to it
mkdir gatewayd && cd gatewayd
# Download the docker-compose file and the setup script
curl -L https://raw.githubusercontent.com/gatewayd-io/gatewayd/main/docker-compose.yaml -o docker-compose.yaml
curl -L https://raw.githubusercontent.com/gatewayd-io/gatewayd/main/setup.sh -o setup.sh
# Run the docker-compose file
docker-compose up -d
```

The above commands will download the `docker-compose.yaml` file and the `setup.sh` script from the GitHub repository and start the services. The `setup.sh` script will install the cache plugin and update the `gatewayd_plugins.yaml` configuration file. The `docker-compose.yaml` file will start the services the following services:

1. A transient service that installs the cache plugin
2. PostgreSQL database
3. Redis
4. GatewayD with the cache plugin

#### Exposed ports and services

GatewayD will expose a few ports that will be available on the host machine. The ports are one-to-one mapped to the container's ports.

| Port | Service Name | Endpoints/Services/Protocols | Description |
| ----- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 15432 | GatewayD server | [Postgres Wire Protocol](https://www.postgresql.org/docs/current/protocol.html) | GatewayD server for PostgreSQL clients to connect to |
| 9090 | Prometheus metrics | <http://localhost:9090/metrics> | Prometheus metrics |
| 18080 | GatewayD HTTP gateway | <http://localhost:18080/swagger-ui/><br/><http://localhost:18080/healthz> | API documentation and health check |
| 19090 | GatewayD gRPC API | `api.v1.GatewayDAdminAPIService`<br/>`grpc.health.v1.Health`<br/>`grpc.reflection.v1.ServerReflection`<br/>`grpc.reflection.v1alpha.ServerReflection` | gRPC API with reflection enabled. Use [grpcurl](https://github.com/fullstorydev/grpcurl), [grpc-client-cli](https://github.com/vadimi/grpc-client-cli) or any other gRPC client to interact with it |

#### Test the services

To test the services, you can use the following commands:

```bash
docker exec -it postgres-test psql postgresql://postgres:postgres@${DOCKER_HOST}:5432/postgres -c "\d"
```

Since the database is just created, no relations exist, which is expected. You can change the configuration of the services in the `gatewayd.yaml` and `gatewayd_plugins.yaml` configuration files inside the `gatewayd-files` directory.

#### Stop and remove the services

To stop and remove the services, use the following command:

```bash
docker-compose down
```

## Installing plugins

Plugins are available as standalone binaries for different platforms. These binaries are available in their GitHub repositories and are distributed as archives that contain the binary and the default configuration file for the plugin. The README file and the LICENSE file might also be included in the archive.
Expand Down
2 changes: 1 addition & 1 deletion getting-started/running-gatewayd.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Running GatewayD
description: How to run GatewayD and test it with psql
Expand Down
2 changes: 1 addition & 1 deletion getting-started/welcome.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Welcome
description: Introduction to GatewayD and its key features
Expand Down
2 changes: 1 addition & 1 deletion miscellaneous/glossary.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Glossary
description: Glossary of GatewayD terms
Expand Down
2 changes: 1 addition & 1 deletion miscellaneous/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Miscellaneous
nav_order: 6
Expand Down
2 changes: 1 addition & 1 deletion miscellaneous/telemetry-and-usage-report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Telemetry and Usage Report
description: Telemetry and usage report of GatewayD
Expand Down
2 changes: 1 addition & 1 deletion plugins/gatewayd-plugin-cache.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: gatewayd-plugin-cache
description: GatewayD plugin for caching query results in Redis.
Expand Down
2 changes: 1 addition & 1 deletion plugins/gatewayd-plugin-js.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: gatewayd-plugin-js
description: GatewayD plugin for running JS functions as hooks.
Expand Down
2 changes: 1 addition & 1 deletion plugins/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Plugins
nav_order: 5
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/API.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: API
description: GatewayD exposes a gRPC API with an HTTP gateway for querying and managing the `gatewayd` process and its plugins.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/Act.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Act
description: Act is a policy engine that supports signals, policies and actions. It is used to automate the execution of business rules.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/CLI.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:54:38
last_modified_date: 2024-03-10 23:47:43
layout: default
title: CLI
description: GatewayD is a CLI application that runs on Windows, Linux-based distributions and macOS.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/clients.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Clients
description: Client object is a client that can connect to the database servers over TCP, UDP and Unix Domain Socket.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/configuration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Configuration
description: GatewayD is fully configurable via various sources, including default values, YAML config files, environment variables, CLI flags and plugins.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/connection-lifecycle.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Connection Lifecycle
description: Connection Lifecycle of GatewayD
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: API
description: GatewayD gRPC API configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/clients.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Clients
description: GatewayD client configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Global Configuration
nav_order: 2
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/loggers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Loggers
description: GatewayD logger configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/metrics.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Metrics
description: GatewayD metrics configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/pools.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Pools
description: GatewayD pool configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/proxies.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Proxies
description: GatewayD proxy configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/global-configuration/servers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Servers
description: GatewayD server configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Using GatewayD
nav_order: 2
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/observability.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Observability
description: Observability is a first-class citizen of GatewayD. It generates logs, metrics and traces to make it easier to see what is going on inside.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: General configurations
description: General configurations for plugins
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/plugins-configuration/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Plugins Configuration
nav_order: 3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Plugins configuration
description: GatewayD plugins configuration
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/pools.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Pools
description: GatewayD has a generic internal pool object that is used to manage plugins and connections.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/protocols.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Protocols
description: GatewayD is application layer protocol-agnostic. This means that GatewayD *can* practically support any protocol in the application layer, or L7.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/proxies.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Proxies
description: Proxy object is used to create a binding between incoming connections from the database clients to the database servers.
Expand Down
2 changes: 1 addition & 1 deletion using-gatewayd/servers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Servers
description: Server is an object that listens on an address:port pair and accepts connections from database clients.
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/hook-registry.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Hook registry
description: The hook registry is a central place where all hooks are registered and executed. It is used by the plugin registry to register and execute plugin hooks.
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/hooks.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Hooks
description: Plugins can be used to modify the connection lifecycle. Each step in the connection lifecycle is represented by one or more plugin hook(s). Plugins can register themselves to be called when a specific hook is triggered.
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:43
layout: default
title: Using Plugins
nav_order: 3
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/plugin-registry.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:44
layout: default
title: Plugin registry
description: The plugin registry is a central place where all plugins are loaded, configured and executed, and also the main entry point for all plugins.
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/plugin-types.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:44
layout: default
title: Plugin types
description: >
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/plugins.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:44
layout: default
title: Plugins
description: Plugins play a very important role in GatewayD for adding support for different databases. They are the building blocks of GatewayD, and they are responsible for the majority of the functionality of GatewayD.
Expand Down
2 changes: 1 addition & 1 deletion using-plugins/proposals.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
last_modified_date: 2024-03-07 22:52:53
last_modified_date: 2024-03-10 23:47:44
layout: default
title: Proposals
description: GatewayD proposals are used to propose new ideas and features for GatewayD.
Expand Down

0 comments on commit c4771c3

Please sign in to comment.