Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Charith Ellawala <charithe@users.noreply.github.com>
Signed-off-by: Oğuzhan Durgun <oguzhandurgun95@gmail.com>
  • Loading branch information
oguzhand95 and charithe committed Mar 12, 2024
1 parent 43ec532 commit af02fe2
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions docs/modules/deployment/pages/cloud-platforms.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ primary_region = '<REGION>' <2>
path = "/_cerbos/metrics"
----
<1> The name of the link:https://fly.io/docs/apps[Fly App]
<2> Pick a link:https://fly.io/docs/reference/regions/#fly-io-regions[region]
<2> Pick a Fly.io link:https://fly.io/docs/reference/regions/#fly-io-regions[region]

The example above launches a Cerbos instance with the
xref:configuration:index.adoc#minimal-configuration[minimal configuration] using an empty
Expand All @@ -76,9 +76,12 @@ link:https://fly.io/docs/reference/tigris[Tigris]. To set the credentials for ac
`flyctl secrets` command.
[source,bash]
----
flyctl secrets set AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
flyctl secrets set AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>
flyctl secrets set AWS_ACCESS_KEY_ID=tid_XXXXXX <1>
flyctl secrets set AWS_SECRET_ACCESS_KEY=tsec_XXXXXX <2>
----
<1> Tigris key ID
<2> Tigris secret access key


[source,toml,linenums,subs="attributes+"]
----
Expand Down Expand Up @@ -143,13 +146,12 @@ primary_region = '<REGION>' <2>
path = "/_cerbos/metrics"
----
<1> The name of the link:https://fly.io/docs/apps[Fly App]
<2> Pick a link:https://fly.io/docs/reference/regions/#fly-io-regions[region]
<2> Pick a Fly.io link:https://fly.io/docs/reference/regions/#fly-io-regions[region]
<3> Bucket name

=== Using LiteFS as a policy repository

Cerbos `sqlite3` driver can be used with storage backend such as link:https://fly.io/docs/litefs[LiteFS]. There are some
steps to take to use LiteFS with Cerbos.
Fly.io's distributed SQLite storage layer link:https://fly.io/docs/litefs[LiteFS] can be used for policy storage using Cerbos' `sqlite3` driver.

==== LiteFS configuration

Expand Down Expand Up @@ -181,14 +183,10 @@ lease:
<1> LiteFS requires us to set the command in the LiteFS configuration instead of using the Dockerfile. When LiteFS is
run it runs the command specified and waits until it exits.

NOTE: link:https://fly.io/docs/litefs/getting-started-docker/#configuring-litefs[Configuring LiteFS] page shows
additional parameters for configuration.
NOTE: Refer to link:https://fly.io/docs/litefs/getting-started-docker/#configuring-litefs[Configuring LiteFS] documentation for other available configuration parameters.

=== Dockerfile

Create a Dockerfile (`Dockerfile`)

.Dockerfile
.Create a Dockerfile
[source,Dockerfile,subs="attributes+"]
----
FROM flyio/litefs:0.5 AS litefs
Expand All @@ -205,7 +203,7 @@ ENTRYPOINT ["litefs"]
CMD ["mount"]
----

=== Create a `fly.toml` to launch Cerbos
.Create a `fly.toml` to launch Cerbos
[source,toml,linenums,subs="attributes+"]
----
app = '<APPLICATION_NAME>' <1>
Expand Down Expand Up @@ -258,14 +256,10 @@ primary_region = '<REGION>' <2>
<2> Pick a link:https://fly.io/docs/reference/regions/#fly-io-regions[region]
<3> Destination must be equal to the one specified in the `litefs.yaml`

=== Lease configuration

Add a Consul URL by running the following command.

.Add a Consul URL to manage LiteFS leases.
[source,bash]
----
flyctl consul attach
----

NOTE: See more details in link:https://fly.io/docs/litefs/getting-started-fly/#lease-configuration[lease configuration]
section.
NOTE: See link:https://fly.io/docs/litefs/getting-started-fly/#lease-configuration[lease configuration] for more details.

0 comments on commit af02fe2

Please sign in to comment.