Skip to content

Commit 5dd98dc

Browse files
committed
Update docs with the information about GCS sync source
Signed-off-by: Alan Kutniewski <kutniewski@google.com>
1 parent 224a656 commit 5dd98dc

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

docs/concepts/syncs.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,23 @@ In this example, `default/my_example` expected to be a valid FeatureFlag resourc
6868
namespace and `my_example` being the resource name.
6969
See [sync source](../reference/sync-configuration.md#source-configuration) configuration for details.
7070

71+
---
72+
73+
### GCS sync
74+
75+
The GCS sync provider fetches flags from a GCS blob and periodically poll the GCS for the flag definition updates.
76+
It uses [application default credentials](https://cloud.google.com/docs/authentication/application-default-credentials) if they
77+
are [configured](https://cloud.google.com/docs/authentication/provide-credentials-adc) to authorize the calls to GCS.
78+
79+
```shell
80+
flagd start --uri gs://my-bucket/my-flags.json
81+
```
82+
83+
In this example, `gs://my-bucket/my-flags.json` is expected to be a valid GCS URI accessible by the flagd
84+
(either by being public or together with application default credentials).
85+
The polling interval can be configured.
86+
See [sync source](../reference/sync-configuration.md#source-configuration) configuration for details.
87+
7188
## Merging
7289

7390
Flagd can be configured to read from multiple sources at once, when this is the case flagd will merge all flag definition into a single

docs/reference/sync-configuration.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ it is passed to the correct implementation:
1717
| `file` | `file:` | `file:etc/flagd/my-flags.json` |
1818
| `http` | `http(s)://` | `https://my-flags.com/flags` |
1919
| `grpc` | `grpc(s)://` | `grpc://my-flags-server` |
20+
| `gcs` | `gs://` | `gs://my-bucket/my-flags.json` |
2021

2122
## Source Configuration
2223

@@ -30,7 +31,7 @@ Alternatively, these configurations can be passed to flagd via config file, spec
3031
| Field | Type | Note |
3132
| ----------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
3233
| uri | required `string` | Flag configuration source of the sync |
33-
| provider | required `string` | Provider type - `file`, `kubernetes`, `http`, or `grpc` |
34+
| provider | required `string` | Provider type - `file`, `kubernetes`, `http`, `grpc` or `gcs` |
3435
| authHeader | optional `string` | Used for http sync; set this to include the complete `Authorization` header value for any authentication scheme (e.g., "Bearer token_here", "Basic base64_credentials", etc.). Cannot be used with `bearerToken` |
3536
| bearerToken | optional `string` | (Deprecated) Used for http sync; token gets appended to `Authorization` header with [bearer schema](https://www.rfc-editor.org/rfc/rfc6750#section-2.1). Cannot be used with `authHeader` |
3637
| interval | optional `uint32` | Used for http sync; requests will be made at this interval. Defaults to 5 seconds. |
@@ -54,6 +55,7 @@ Sync providers:
5455
- `kubernetes` - default/my-flag-config
5556
- `grpc`(insecure) - grpc-source:8080
5657
- `grpcs`(secure) - my-flag-source:8080
58+
- `gcs` - gs://my-bucket/my-flags.json
5759

5860
Startup command:
5961

@@ -66,7 +68,8 @@ Startup command:
6668
{"uri":"default/my-flag-config","provider":"kubernetes"},
6769
{"uri":"grpc-source:8080","provider":"grpc"},
6870
{"uri":"my-flag-source:8080","provider":"grpc", "maxMsgSize": 5242880},
69-
{"uri":"my-flag-source:8080","provider":"grpc", "certPath": "/certs/ca.cert", "tls": true, "providerID": "flagd-weatherapp-sidecar", "selector": "source=database,app=weatherapp"}]'
71+
{"uri":"my-flag-source:8080","provider":"grpc", "certPath": "/certs/ca.cert", "tls": true, "providerID": "flagd-weatherapp-sidecar", "selector": "source=database,app=weatherapp"},
72+
{"uri":"gs://my-bucket/my-flag.json","provider":"gcs"}]'
7073
```
7174

7275
Configuration file,
@@ -91,4 +94,6 @@ sources:
9194
tls: true
9295
providerID: flagd-weatherapp-sidecar
9396
selector: "source=database,app=weatherapp"
97+
- uri: gs://my-bucket/my-flag.json
98+
provider: gcs
9499
```

0 commit comments

Comments
 (0)