From 112f13f69614637d473c20a194528874732be2dc Mon Sep 17 00:00:00 2001 From: George MacRorie Date: Tue, 14 Nov 2023 16:31:16 +0000 Subject: [PATCH] feat(config): add details around OCI --- configuration/overview.mdx | 10 +++++++ configuration/storage.mdx | 49 ++++++++++++++++++++++++++++---- guides/get-going-with-gitops.mdx | 4 +-- tooling/github-actions.mdx | 2 +- 4 files changed, 56 insertions(+), 9 deletions(-) diff --git a/configuration/overview.mdx b/configuration/overview.mdx index 76e838d..59aeedc 100644 --- a/configuration/overview.mdx +++ b/configuration/overview.mdx @@ -199,6 +199,16 @@ These properties are as follows: | storage.object.s3.endpoint | The S3 endpoint to use for object storage | | v1.25.0 | | storage.object.s3.poll_interval | The interval to poll S3 for changes | 30s | v1.25.0 | +#### Storage OCI + +| Property | Description | Default | Since | +| ------------------------------------------ | ----------------------------------------------------- | --------------------- | ------- | +| storage.object.oci.repository | The target bundle repository (with optional registry) | | v1.31.0 | +| storage.object.oci.authentication.username | The username to use for authentication | | v1.31.0 | +| storage.object.oci.authentication.password | The password to use for authentication | | v1.31.0 | +| storage.object.oci.bundles_directory | The directory in which to store local bundles | $config/flipt/bundles | v1.31.0 | +| storage.object.oci.poll_interval | The interval to poll the registry for changes | 30s | v1.31.0 | + ### Cache | Property | Description | Default | Since | diff --git a/configuration/storage.mdx b/configuration/storage.mdx index 3358a3d..9be5bee 100644 --- a/configuration/storage.mdx +++ b/configuration/storage.mdx @@ -3,9 +3,9 @@ title: Storage description: This document describes how to configure Flipt's storage backend mechanisms. --- -## Databases +## Relational Database Backends -Flipt supports [SQLite](https://www.sqlite.org/index.html), [PostgreSQL](https://www.postgresql.org/), [CockroachDB](https://www.cockroachlabs.com/) and [MySQL](https://dev.mysql.com/) databases. +Flipt supports [SQLite](https://www.sqlite.org/index.html), [PostgreSQL](https://www.postgresql.org/), [CockroachDB](https://www.cockroachlabs.com/) and [MySQL](https://dev.mysql.com/) relational databases. As of [v1.29.0](https://github.com/flipt-io/flipt/releases/tag/v1.29.0), Flipt @@ -114,14 +114,14 @@ docker run -it -v $HOME/flipt:/var/opt/flipt flipt/flipt:latest /bin/sh -c './fl If you don't use mounted volumes to persist your data, your data will be lost when the migration container exits, having no effect on your Flipt instance! -## Filesystem +## Declarative Backends -The following backend types are designed to support declarative management of feature flag state. +The following backend types are designed to support declarative management of feature flag state via a well-known file format. In particular, they're designed to support GitOps practices with minimal external dependencies. -Currently, we classify `local`, `git`, and `object` as the three filesystem backends. +Currently, we classify `local`, `git`, `object` and `oci` as the four declarative backends. The `local` backend has been primarily developed to support a local development experience, -whereas, the `git` and `object` backends are intended for production and serve flag state directly from a configurable repository and Git reference (e.g. branch) or object storage bucket. +whereas, the `git`, `object` and `oci` backends are intended for production use. ### Read Only Mode @@ -321,6 +321,43 @@ AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... ``` +### OCI + +Since `v1.31.0`, Flipt supports using any [OCI](https://opencontainers.org/) compatible registry as a declarative backend source. +Flipt has its own custom OCI manifest format (we call them `bundles`), which can be built and managed using the [Flipt CLI](/cli/commands/bundle). + + + + + ```bash + FLIPT_STORAGE_TYPE="oci" + FLIPT_STORAGE_OCI_REPOSITORY="some.oci.registry/repository/image:tag" + FLIPT_STORAGE_OCI_POLL_INTERVAL="30s" + # authentication credentials + FLIPT_STORAGE_OCI_AUTHENTICATION_USERNAME="username" + FLIPT_STORAGE_OCI_AUTHENTICATION_PASSWORD="password" + # location used for storing local bundles + FLIPT_STORAGE_OCI_BUNDLES_DIRECTORY="/flipt/bundles" + ``` + + + + + ```yaml + storage: + type: "oci" + oci: + repository: "some.oci.registry/repository/image:tag" + poll_interval: "30s" + authentication: + username: "username" + password: "password" + bundles_directory: "/flipt/bundles" + ``` + + + + ### Flag State Configuration Each of Flipt's filesystem backends expects you to represent your feature flag configuration via a set of YAML files. diff --git a/guides/get-going-with-gitops.mdx b/guides/get-going-with-gitops.mdx index dde4cda..0741fba 100644 --- a/guides/get-going-with-gitops.mdx +++ b/guides/get-going-with-gitops.mdx @@ -209,8 +209,8 @@ Flipt will track the HEAD of this repository's `main` branch. Changes will eventually propagate into our running instance of Flipt. - Head to [Configuration: Storage: Filesystem - Backends](/configuration/storage#filesystem) to learn more about configuring + Head to [Configuration: Storage: Declarative Backends + Backends](/configuration/storage#declarative-backends) to learn more about configuring these backend types for Flipt. diff --git a/tooling/github-actions.mdx b/tooling/github-actions.mdx index 5c5d3bb..ad266e9 100644 --- a/tooling/github-actions.mdx +++ b/tooling/github-actions.mdx @@ -7,7 +7,7 @@ description: How to use our GitHub Actions to automate your workflows. ![Flipt Validate Action](/images/tooling/validate-action.png) -The [flipt-validate action](https://github.com/flipt-io/validate-action) is used to validate your [features.yml](/configuration/storage#flag-state-configuration) files in a GitHub workflow. We recommend to use this action in your workflow to ensure that your Flipt data is syntactically and semantically valid before deploying when using [Git](https://www.flipt.io/docs/configuration/storage#git) or other [file-based backends](https://www.flipt.io/docs/configuration/storage#filesystem). +The [flipt-validate action](https://github.com/flipt-io/validate-action) is used to validate your [features.yml](/configuration/storage#flag-state-configuration) files in a GitHub workflow. We recommend to use this action in your workflow to ensure that your Flipt data is syntactically and semantically valid before deploying when using [Git](https://www.flipt.io/docs/configuration/storage#git) or other [declarative backends](https://www.flipt.io/docs/configuration/storage#declarative-backends). It uses the [`flipt validate`](/cli/commands/validate) command under the hood to validate your data. If the data is invalid, the action will fail and provide a detailed error annotation at the source of the error.