-
Notifications
You must be signed in to change notification settings - Fork 44
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
WIP Azure Backups #855
WIP Azure Backups #855
Changes from 2 commits
c9c06f9
93fd539
39222e2
f552c10
6b8afd7
2448a72
85b1e62
24425bb
e4d0be9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,84 @@ pub struct ServiceAccountTemplate { | |
pub metadata: Option<ObjectMeta>, | ||
} | ||
|
||
/// AzureCredentials is the type for the credentials to be used to upload files to Azure Blob Storage. | ||
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)] | ||
pub struct AzureCredentials { | ||
Comment on lines
+92
to
+94
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. are these types already present in the cnpg file, or could be kopium imported from the CNPG crd 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. Yes they are already present. The S3Credentials values (right below this section) are also present there, but it looks like we copied them in and renamed slightly. I followed the same pattern here. Happy to go with either approach |
||
/// The connection string to be used | ||
#[serde( | ||
default, | ||
skip_serializing_if = "Option::is_none", | ||
rename = "connectionString" | ||
)] | ||
pub connection_string: Option<AzureCredentialsConnectionString>, | ||
/// Use the Azure AD based authentication without providing explicitly the keys. | ||
#[serde( | ||
default, | ||
skip_serializing_if = "Option::is_none", | ||
rename = "inheritFromAzureAD" | ||
)] | ||
pub inherit_from_azure_ad: Option<bool>, | ||
/// The storage account where to upload data | ||
#[serde( | ||
default, | ||
skip_serializing_if = "Option::is_none", | ||
rename = "storageAccount" | ||
)] | ||
pub storage_account: Option<AzureCredentialsStorageAccount>, | ||
/// The storage account key to be used in conjunction with the storage account name | ||
#[serde( | ||
default, | ||
skip_serializing_if = "Option::is_none", | ||
rename = "storageKey" | ||
)] | ||
pub storage_key: Option<AzureCredentialsStorageKey>, | ||
/// A shared-access-signature to be used in conjunction with the storage account name | ||
#[serde( | ||
default, | ||
skip_serializing_if = "Option::is_none", | ||
rename = "storageSasToken" | ||
)] | ||
pub storage_sas_token: Option<AzureCredentialsStorageSasToken>, | ||
} | ||
|
||
/// The connection string to be used for Azure Blob Storage backups | ||
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)] | ||
pub struct AzureCredentialsConnectionString { | ||
/// The key to select | ||
pub key: String, | ||
/// Name of the referent. | ||
pub name: String, | ||
} | ||
|
||
/// The storage account for Azure Blob Storage backups | ||
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)] | ||
pub struct AzureCredentialsStorageAccount { | ||
/// The key to select | ||
pub key: String, | ||
/// Name of the referent. | ||
pub name: String, | ||
} | ||
|
||
/// The storage account key to be used in conjunction with the storage account name for Azure Blob | ||
/// Storage backups | ||
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)] | ||
pub struct AzureCredentialsStorageKey { | ||
/// The key to select | ||
pub key: String, | ||
/// Name of the referent. | ||
pub name: String, | ||
} | ||
|
||
/// A shared-access-signature to be used in conjunction with the storage account name for Azure Blob | ||
/// Storage backups | ||
#[derive(Serialize, Deserialize, Clone, Debug, Default, JsonSchema)] | ||
pub struct AzureCredentialsStorageSasToken { | ||
/// The key to select | ||
pub key: String, | ||
/// Name of the referent. | ||
pub name: String, | ||
} | ||
|
||
/// S3Credentials is the type for the credentials to be used to upload files to S3. | ||
/// It can be provided in two alternative ways: | ||
/// * explicitly passing accessKeyId and secretAccessKey | ||
|
@@ -226,6 +304,10 @@ pub struct Backup { | |
#[serde(default, rename = "endpointURL")] | ||
pub endpoint_url: Option<String>, | ||
|
||
/// The Azure Blob Storage credentials to use for backups | ||
#[serde(default, rename = "azureCredentials")] | ||
pub azure_credentials: Option<AzureCredentials>, | ||
|
||
/// The S3 credentials to use for backups (if not using IAM Role) | ||
#[serde(default = "defaults::default_s3_credentials", rename = "s3Credentials")] | ||
pub s3_credentials: Option<S3Credentials>, | ||
|
@@ -286,6 +368,10 @@ pub struct Restore { | |
#[serde(default, rename = "endpointURL")] | ||
pub endpoint_url: Option<String>, | ||
|
||
/// The Azure Blob Storage credentials to use for restores | ||
#[serde(default, rename = "azureCredentials")] | ||
pub azure_credentials: Option<AzureCredentials>, | ||
|
||
/// s3Credentials is the S3 credentials to use for backups. | ||
#[serde(rename = "s3Credentials")] | ||
pub s3_credentials: Option<S3Credentials>, | ||
|
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 may need a step to provision in Azure the permissions for the workload required for this instance to access the bucket where its backups go
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 we will need that