docs: updated all versions in documentation

This commit is contained in:
Alexis Couvreur
2024-11-10 11:08:47 -05:00
parent bb87e0dd9b
commit 2976392078
12 changed files with 21 additions and 124 deletions

View File

@@ -4,7 +4,6 @@
- [Configuration](/configuration)
- [Strategies](/strategies)
- [Themes](/themes)
- [FAQ](/faq)
- [Versioning](/versioning)
- **Providers**
- [Overview](/providers/overview)

View File

@@ -1,95 +0,0 @@
# Documentation for Sablier
<a name="documentation-for-api-endpoints"></a>
## Documentation for API Endpoints
All URIs are relative to *http://localhost:10000*
| Class | Method | HTTP request | Description |
|------------ | ------------- | ------------- | -------------|
| *ScaleApi* | [**scaleBlocking**](Apis/ScaleApi.md#scaleblocking) | **GET** /api/strategies/blocking | Hangs the request until the services are ready |
*ScaleApi* | [**scaleDynamic**](Apis/ScaleApi.md#scaledynamic) | **GET** /api/strategies/dynamic | The waiting page for the given services |
| *ThemeApi* | [**getTheme**](Apis/ThemeApi.md#gettheme) | **GET** /api/strategies/dynamoc/themes | |
<a name="documentation-for-models"></a>
## Documentation for Models
- [instance](./Models/instance.md)
- [session](./Models/session.md)
- [status](./Models/status.md)
- [themes](./Models/themes.md)
<a name="documentation-for-authorization"></a>
## Documentation for Authorization
All endpoints do not require authorization.
## API
To run the following examples you can create two containers:
- `docker create --name nginx nginx`
- `docker create --name apache httpd`
### GET `/api/strategies/dynamic`
**Description**: The `/api/strategies/dynamic` endpoint allows you to request a waiting page for multiple instances
| Parameter | Value | Description |
| -------------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `names` | array of string | The instances to be started (cannot be used with `group` parameter) |
| `group` | string | The instance group to be started (using `sablier.group=mygroup` labels) (cannot be used with `names` parameter) |
| `session_duration` | duration [time.ParseDuration](https://pkg.go.dev/time#ParseDuration) | The session duration for all services, which will reset at each subsequent calls |
| `show_details` *(optional)* | bool | The details about instances |
| `display_name` *(optional)* | string | The display name |
| `theme` *(optional)* | string | The theme to use |
| `refresh_frequency` *(optional)* | duration [time.ParseDuration](https://pkg.go.dev/time#ParseDuration) | The refresh frequency for the loading page |
Go to http://localhost:10000/api/strategies/dynamic?names=nginx&names=apache&session_duration=5m&show_details=true&display_name=example&theme=hacker-terminal&refresh_frequency=10s and you should see
A special header `X-Sablier-Session-Status` is returned and will have the value `ready` if all instances are ready. Or else `not-ready`.
![API Dynamic Prompt image](docs/img/api-dynamic.png)
### GET `/api/strategies/blocking`
**Description**: The `/api/strategies/blocking` endpoint allows you to wait until the instances are ready
| Parameter | Value | Description |
| ---------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `names` | array of string | The instances to be started (cannot be used with `group` parameter) |
| `group` | string | The instance group to be started (using `sablier.group=mygroup` labels) (cannot be used with `names` parameter) |
| `session_duration` | duration [time.ParseDuration](https://pkg.go.dev/time#ParseDuration) | The session duration for all services, which will reset at each subsequent calls |
| `timeout` *(optional)* | duration [time.ParseDuration](https://pkg.go.dev/time#ParseDuration) | The maximum time to wait for instances to be ready |
A special header `X-Sablier-Session-Status` is returned and will have the value `ready` if all instances are ready. Or else `not-ready`.
**Curl example**
```bash
curl -X GET -v "http://localhost:10000/api/strategies/blocking?names=nginx&names=apache&session_duration=5m&timeout=5s"
* Trying 127.0.0.1:10000...
* Connected to localhost (127.0.0.1) port 10000 (#0)
> GET /api/strategies/blocking?names=nginx&names=apache&session_duration=5m&timeout=30s HTTP/1.1
> Host: localhost:10000
> User-Agent: curl/7.74.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< X-Sablier-Session-Status: ready
< Date: Mon, 14 Nov 2022 19:20:50 GMT
< Content-Length: 245
<
{"session":
{"instances":
[
{"instance":{"name":"nginx","currentReplicas":1,"desiredReplicas":1,"status":"ready"},"error":null},
{"instance":{"name":"apache","currentReplicas":1,"desiredReplicas":1,"status":"ready"},"error":null}
],
"status":"ready"
}
}
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

@@ -1,3 +0,0 @@
# Frequenty Asked Questions
This page is still under construction. Feel free to contribute by raising an issue about a specific cqustion, or by adding a question and an answer about something which is frequently asked in the issues.

View File

@@ -36,7 +36,7 @@ Suppose this is your initial setup with Caddy. You have your reverse proxy with
```yaml
services:
proxy:
image: caddy:2.6.4
image: caddy:2.8.4
ports:
- "8080:80"
volumes:
@@ -68,7 +68,7 @@ Add the Sablier container in the `docker-compose.yaml` file.
```yaml
services:
proxy:
image: caddy:2.6.4
image: caddy:2.8.4
ports:
- "8080:80"
volumes:
@@ -93,17 +93,17 @@ Because Caddy does not provide any runtime evaluation for the plugins, we need t
I'll use the provided Dockerfile to build the custom Caddy image.
```bash
docker build https://github.com/sablierapp/sablier.git#v1.4.0-beta.3:plugins/caddy
--build-arg=CADDY_VERSION=2.6.4
-t caddy:2.6.4-with-sablier
docker build https://github.com/sablierapp/sablier.git#v1.8.1:plugins/caddy
--build-arg=CADDY_VERSION=2.8.4
-t caddy:2.8.4-with-sablier
```
Then change the image to from `caddy:2.6.4` to `caddy:2.6.4-with-sablier`
Then change the image to from `caddy:2.8.4` to `caddy:2.8.4-with-sablier`
```yaml
services:
proxy:
image: caddy:2.6.4-with-sablier
image: caddy:2.8.4-with-sablier
ports:
- "8080:80"
volumes:
@@ -123,7 +123,7 @@ services:
### 4. Configure Caddy to use the Sablier Caddy Plugin on the `whoami` service
This is how you opt-in your services and link them with the plugin.
This is how you opt in your services and link them with the plugin.
<!-- tabs:start -->
@@ -145,7 +145,7 @@ services:
- sablier.group=demo
sablier:
image: sablierapp/sablier:local
image: sablierapp/sablier:1.8.1
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
```
@@ -175,4 +175,4 @@ Here we've configured the following things when we're accessing the service on `
<!-- tabs:end -->
?> We've assigned the group `demo` to the service and we use this to identify the workload i
?> We've assigned the group `demo` to the service, and we use this to identify the workload i

View File

@@ -140,7 +140,6 @@
app: sablier
spec:
serviceAccountName: sablier
serviceAccount: sablier
containers:
- name: sablier
image: sablierapp/sablier:1.8.1

View File

@@ -7,7 +7,6 @@
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css">
<link rel="stylesheet" href="assets/style.css">
<link rel="icon" type="image/x-icon" href="assets/img/favicon.ico">
<style>
:root {

View File

@@ -10,7 +10,7 @@ You can install Sablier with the following flavors:
## Use the Docker image
- **Docker Hub**: [sablierapp/sablier](https://hub.docker.com/r/sablierapp/sablier)
- **Github Container Registry**: [ghcr.io/sablierapp/sablier](https://github.com/sablierapp/sablier/pkgs/container/sablier)
- **GitHub Container Registry**: [ghcr.io/sablierapp/sablier](https://github.com/sablierapp/sablier/pkgs/container/sablier)
Choose one of the Docker images and run it with one sample configuration file:

View File

@@ -22,21 +22,19 @@ Here I'll show you two options with Docker.
#### **Using the provided Dockerfile**
```bash
docker build https://github.com/sablierapp/sablier.git#v1.4.0-beta.3:plugins/caddy
--build-arg=CADDY_VERSION=2.6.4
-t caddy:2.6.4-with-sablier
docker build https://github.com/sablierapp/sablier.git#v1.8.1:plugins/caddy
--build-arg=CADDY_VERSION=2.8.4
-t caddy:2.8.4-with-sablier
```
#### **Updating your Caddy Dockerfile**
```docker
ARG CADDY_VERSION=2.6.4
ARG CADDY_VERSION=2.8.4
FROM caddy:${CADDY_VERSION}-builder AS builder
ADD https://github.com/sablierapp/sablier.git#v1.4.0-beta.3 /sablier
RUN xcaddy build \
--with github.com/sablierapp/sablier/plugins/caddy=/sablier/plugins/caddy
--with github.com/sablierapp/sablier/plugins/caddy
FROM caddy:${CADDY_VERSION}
@@ -73,7 +71,7 @@ You can have the following configuration:
### Exemple with a minimal configuration
Almost all options are optional and you can setup very simple rules to use the server default values.
Almost all options are optional, and you can set up very simple rules to use the server default values.
```Caddyfile
:80 {

View File

@@ -4,7 +4,7 @@ The Docker provider communicates with the `docker.sock` socket to start and stop
## Use the Docker provider
In order to use the docker provider you can configure the [provider.name](TODO) property.
In order to use the docker provider you can configure the [provider.name](../configuration) property.
<!-- tabs:start -->
@@ -61,4 +61,4 @@ services:
If the container defines a Healthcheck, then it will check for healthiness before stating the `ready` status.
If the containers does not define a Healthcheck, then as soon as the container has the status `started`
If the containers do not define a Healthcheck, then as soon as the container has the status `started`

View File

@@ -4,7 +4,7 @@ The Docker Swarm provider communicates with the `docker.sock` socket to scale se
## Use the Docker Swarm provider
In order to use the docker swarm provider you can configure the [provider.name](TODO) property.
In order to use the docker swarm provider you can configure the [provider.name](../configuration) property.
<!-- tabs:start -->

View File

@@ -4,7 +4,7 @@ Sablier assumes that it is deployed within the Kubernetes cluster to use the Kub
## Use the Kubernetes provider
In order to use the kubernetes provider you can configure the [provider.name](TODO) property.
In order to use the kubernetes provider you can configure the [provider.name](../configuration) property.
<!-- tabs:start -->