-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support COSI BucketInfo in replica config #537
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mateusz Urbanek <mateusz.urbanek.98@gmail.com>
Signed-off-by: Mateusz Urbanek <mateusz.urbanek.98@gmail.com>
Signed-off-by: Mateusz Urbanek <mateusz.urbanek.98@gmail.com>
Signed-off-by: Mateusz Urbanek <mateusz.urbanek.98@gmail.com>
@benbjohnson I am willing to keep the maintenance of that feature, update API and extend functionality if needed. |
return fmt.Errorf("unable to decode BucketInfo: %w", err) | ||
} | ||
|
||
switch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a cool PR, but this switch is not configuring Azure or GCP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it is not. I will do that soon for Azure, not sure about GCP, as there is no GCP secret defined in COSI alpha specification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I don't know if the Azure Blob provides enough info for the litestream
to configure replica client - it is only giving the BucketName
and AccessToken
- this probably is not enough data.
readBucketInfo
in theConfig
struct to read COSI BucketInfo for each database replica.parseBucketInfo
to handle the parsing of BucketInfo from a specified file.ReadConfigFile
function to call the newreadBucketInfo
method.litestream
by supporting COSI BucketInfo, enabling more versatile storage configurations in Kubernetes.Newly introduced code allows specifying new field called
bucket-info
. Configuration file as this:Will be expanded based on the contents of the BucketInfo file to something like this:
fix: remove deprecated code
fix: removed issues found by staticcheck.
feature: report errors from stopping/starting replication
COSI stands for Container Object Storage Interface. It is a standard developed by the Kubernetes community as part of the SIG-Storage project. COSI focuses specifically on defining an interface for object storage systems within the context of containerized applications and orchestrators like Kubernetes.
The primary goal of COSI is to provide a standardized way for containerized applications to interact with different object storage systems seamlessly. This interface allows developers and operators to use various object storage solutions without requiring changes to the application code. It abstracts the underlying details of the object storage provider, making it easier to switch between different storage backends.
Key components of COSI include:
BucketInfo: In the context of
litestream
's changes,BucketInfo
refers to the metadata or configuration information associated with a bucket in an object storage system. It specifies details such as the bucket name, authentication credentials, endpoint, and other relevant settings.The BucketInfo is a JSON object inside Secret, that can be mounted in the pod. In the mount path the new file will be created called
BucketInfo
. The contents should look like this:Protocols: COSI supports 3 different protocols for communication with object storage systems - S3 (Simple Storage Service), Azure Blob, GCS (Google Cloud Storage).
Authentication Types: COSI supports different authentication mechanisms, such as access keys, secret keys, and various authentication types specific to different object storage providers.
In the context of your
litestream
changes, it seems that support for parsing COSI BucketInfo is being added, allowinglitestream
to work with Kubernetes-compliant object storage configurations. This enhances the flexibility oflitestream
by supporting a wider range of object storage solutions through the COSI standard.