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
Storage: Add Oracle Cloud Infrastructure Object Storage Bucket support #4661
Closed
aarontams
wants to merge
1
commit into
thanos-io:main
from
aarontams:add-oci-object-storage-bucket-support_20210915
+757
−18
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -37,15 +37,16 @@ In Kubernetes it is as easy as (on Thanos sidecar example): | |||||||||||||||
|
||||||||||||||||
Current object storage client implementations: | ||||||||||||||||
|
||||||||||||||||
| Provider | Maturity | Aimed For | Auto-tested on CI | Maintainers | | ||||||||||||||||
|----------------------------------------------------------------------------------------|--------------------|-----------------------|-------------------|-------------------------| | ||||||||||||||||
| [Google Cloud Storage](#gcs) | Stable | Production Usage | yes | @bwplotka | | ||||||||||||||||
| [AWS/S3](#s3) (and all S3-compatible storages e.g disk-based [Minio](https://min.io/)) | Stable | Production Usage | yes | @bwplotka | | ||||||||||||||||
| [Azure Storage Account](#azure) | Stable | Production Usage | no | @vglafirov | | ||||||||||||||||
| [OpenStack Swift](#openstack-swift) | Beta (working PoC) | Production Usage | yes | @FUSAKLA | | ||||||||||||||||
| [Tencent COS](#tencent-cos) | Beta | Production Usage | no | @jojohappy,@hanjm | | ||||||||||||||||
| [AliYun OSS](#aliyun-oss) | Beta | Production Usage | no | @shaulboozhiao,@wujinhu | | ||||||||||||||||
| [Local Filesystem](#filesystem) | Stable | Testing and Demo only | yes | @bwplotka | | ||||||||||||||||
| Provider | Maturity | Aimed For | Auto-tested on CI | Maintainers | | ||||||||||||||||
|-------------------------------------------------------------------------------------------|--------------------|-----------------------|-------------------|----------------------------------| | ||||||||||||||||
| [Google Cloud Storage](#gcs) | Stable | Production Usage | yes | @bwplotka | | ||||||||||||||||
| [AWS/S3](#s3) (and all S3-compatible storages e.g disk-based [Minio](https://min.io/)) | Stable | Production Usage | yes | @bwplotka | | ||||||||||||||||
| [Azure Storage Account](#azure) | Stable | Production Usage | no | @vglafirov | | ||||||||||||||||
| [OpenStack Swift](#openstack-swift) | Beta (working PoC) | Production Usage | yes | @FUSAKLA | | ||||||||||||||||
| [Tencent COS](#tencent-cos) | Beta | Production Usage | no | @jojohappy,@hanjm | | ||||||||||||||||
| [AliYun OSS](#aliyun-oss) | Beta | Production Usage | no | @shaulboozhiao,@wujinhu | | ||||||||||||||||
| [Local Filesystem](#filesystem) | Stable | Testing and Demo only | yes | @bwplotka | | ||||||||||||||||
| [Oracle Cloud Infrastructure Object Storage](#oracle-cloud-infrastructure-object-storage) | Beta | Production Usage | yes | @aarontams,@gaurav-05,@ericrrath | | ||||||||||||||||
|
||||||||||||||||
**Missing support to some object storage?** Check out [how to add your client section](#how-to-add-a-new-client-to-thanos) | ||||||||||||||||
|
||||||||||||||||
|
@@ -207,7 +208,7 @@ Example working AWS IAM policy for user: | |||||||||||||||
To test the policy, set env vars for S3 access for *empty, not used* bucket as well as: | ||||||||||||||||
|
||||||||||||||||
``` | ||||||||||||||||
THANOS_TEST_OBJSTORE_SKIP=GCS,AZURE,SWIFT,COS,ALIYUNOSS | ||||||||||||||||
THANOS_TEST_OBJSTORE_SKIP=GCS,AZURE,SWIFT,COS,ALIYUNOSS,OCI | ||||||||||||||||
THANOS_ALLOW_EXISTING_BUCKET_USE=true | ||||||||||||||||
``` | ||||||||||||||||
|
||||||||||||||||
|
@@ -241,7 +242,7 @@ We need access to CreateBucket and DeleteBucket and access to all buckets: | |||||||||||||||
} | ||||||||||||||||
``` | ||||||||||||||||
|
||||||||||||||||
With this policy you should be able to run set `THANOS_TEST_OBJSTORE_SKIP=GCS,AZURE,SWIFT,COS,ALIYUNOSS` and unset `S3_BUCKET` and run all tests using `make test`. | ||||||||||||||||
With this policy you should be able to run set `THANOS_TEST_OBJSTORE_SKIP=GCS,AZURE,SWIFT,COS,ALIYUNOSS,OCI` and unset `S3_BUCKET` and run all tests using `make test`. | ||||||||||||||||
|
||||||||||||||||
Details about AWS policies: https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html | ||||||||||||||||
|
||||||||||||||||
|
@@ -493,6 +494,65 @@ config: | |||||||||||||||
prefix: "" | ||||||||||||||||
``` | ||||||||||||||||
|
||||||||||||||||
### Oracle Cloud Infrastructure Object Storage | ||||||||||||||||
|
||||||||||||||||
To configure Oracle Cloud Infrastructure (OCI) Object Storage as Thanos Object Store, you need to provide appropriate authentication credentials to your OCI tenancy. The OCI object storage client implementation for Thanos supports either the default keypair or instance principal authentication. | ||||||||||||||||
|
||||||||||||||||
#### API Signing Key | ||||||||||||||||
The default API signing key authentication provider leverages same [configuration as the OCI CLI](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/cliconcepts.htm) which is usually stored in at `$HOME/.oci/config` or via variable names starting with the string `OCI_CLI`. You can also use environment variables that start with `TF_VAR`. If the same configuration is found in multiple places the provider will prefer the first one. | ||||||||||||||||
|
||||||||||||||||
The following example configures the provider to look for an existing API signing key for authentication: | ||||||||||||||||
```yaml | ||||||||||||||||
type: OCI | ||||||||||||||||
config: | ||||||||||||||||
provider: "default" | ||||||||||||||||
bucket: "" | ||||||||||||||||
compartment_ocid: "" | ||||||||||||||||
part_size: "" // Optional part size to override the OCI default of 128 MiB, value is in bytes. | ||||||||||||||||
max_request_retries: "" // Optional maximum number of retries for a request. | ||||||||||||||||
request_retry_interval: "" // Optional sleep duration in seconds between retry requests. | ||||||||||||||||
http_config: | ||||||||||||||||
idle_conn_timeout: 1m30s // Optional maximum amount of time an idle (keep-alive) connection will remain idle before closing itself. Zero means no limit. | ||||||||||||||||
response_header_timeout: 2m // Optional amount of time to wait for a server's response headers after fully writing the request. | ||||||||||||||||
tls_handshake_timeout: 10s // Optional maximum amount of time waiting to wait for a TLS handshake. Zero means no timeout. | ||||||||||||||||
expect_continue_timeout: 1s // Optional amount of time to wait for a server's first response headers. Zero means no timeout and causes the body to be sent immediately. | ||||||||||||||||
insecure_skip_verify: false // Optional. If true, crypto/tls accepts any certificate presented by the server and any host name in that certificate. | ||||||||||||||||
max_idle_conns: 100 // Optional maximum number of idle (keep-alive) connections across all hosts. Zero means no limit. | ||||||||||||||||
max_idle_conns_per_host: 100 // Optional maximum idle (keep-alive) connections to keep per-host. If zero, DefaultMaxIdleConnsPerHost=2 is used. | ||||||||||||||||
max_conns_per_host: 0 // Optional maximum total number of connections per host. | ||||||||||||||||
disable_compression: false // Optional. If true, prevents the Transport from requesting compression. | ||||||||||||||||
client_timeout: 90s // Optional time limit for requests made by the HTTP Client. | ||||||||||||||||
``` | ||||||||||||||||
|
||||||||||||||||
|
||||||||||||||||
#### Instance Principal Provider | ||||||||||||||||
For Example: | ||||||||||||||||
Comment on lines
+528
to
+529
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
```yaml | ||||||||||||||||
type: OCI | ||||||||||||||||
config: | ||||||||||||||||
provider: "instance-principal" | ||||||||||||||||
bucket: "" | ||||||||||||||||
compartment_ocid: "" | ||||||||||||||||
``` | ||||||||||||||||
You can also include any of the optional configuration just like the example in `Default Provider`. | ||||||||||||||||
|
||||||||||||||||
#### Raw Provider | ||||||||||||||||
For Example: | ||||||||||||||||
```yaml | ||||||||||||||||
type: OCI | ||||||||||||||||
config: | ||||||||||||||||
provider: "raw" | ||||||||||||||||
bucket: "" | ||||||||||||||||
compartment_ocid: "" | ||||||||||||||||
tenancy_ocid: "" | ||||||||||||||||
user_ocid: "" | ||||||||||||||||
region: "" | ||||||||||||||||
fingerprint: "" | ||||||||||||||||
privatekey: "" | ||||||||||||||||
passphrase: "" // Optional passphrase to encrypt the private API Signing key | ||||||||||||||||
``` | ||||||||||||||||
You can also include any of the optional configuration just like the example in `Default Provider`. | ||||||||||||||||
|
||||||||||||||||
### How to add a new client to Thanos? | ||||||||||||||||
|
||||||||||||||||
Following checklist allows adding new Go code client to supported providers: | ||||||||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.