Skip to content

Commit 676d401

Browse files
Adding full AzureStack and custom cloud support and tests
1 parent 505143d commit 676d401

10 files changed

+669
-187
lines changed

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,34 @@ _Note: this option is **not valid** if you are planning to take Azure snapshots
479479
480480
> Available values for `AZURE_CLOUD_NAME`: `AzurePublicCloud`, `AzureUSGovernmentCloud`, `AzureChinaCloud`
481481
482+
483+
### Using Azure Custom or Stack clouds
484+
485+
When using custom Azure clouds, there are two methods to configure velero.
486+
487+
#### Option 1: Use Azure ResourceManager endpoint discovery
488+
489+
```bash
490+
cat << EOF > ./credentials-velero
491+
AZURE_CLOUD_NAME=AzureCustomCloud
492+
AZURE_METADATA_HOST=<Azure metadata host. For example, https://management.usgovcloudapi/net>
493+
EOF
494+
```
495+
496+
#### Option 2: Use Azure cloud configuration
497+
498+
_Note: This is the best option when using AzureStackCloud_
499+
500+
1. Ensure that a valid [cloud provider configuration](https://cloud-provider-azure.sigs.k8s.io/install/configs/) has been created. If using AKS, this can be mounted from the host path `/etc/kubernetes/azurestackcloud.json`
501+
2. Ensure that the environment variable `AZURE_ENVIRONMENT_FILEPATH` has been set to the location of the file from step 1
502+
3. Set the configuration (cloud name **must** be `AzureStackCloud`)
503+
504+
```bash
505+
cat << EOF > ./credentials-velero
506+
AZURE_CLOUD_NAME=AzureStackCloud
507+
EOF
508+
```
509+
482510
## Install and start Velero
483511
484512
[Download][6] Velero

backupstoragelocation.md

+5
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,9 @@ spec:
7272
#
7373
# Optional (defaults to 1048576, i.e. 1MB, maximum 104857600, i.e. 100MB).
7474
blockSizeInBytes: "1048576"
75+
76+
# APIVersion to use with Azure client API calls for storage.
77+
#
78+
# Optional.
79+
apiVersion: ""
7580
```

velero-plugin-for-microsoft-azure/object_store.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
"github.com/pkg/errors"
3636
"github.com/sirupsen/logrus"
3737

38+
"github.com/vmware-tanzu/velero-plugin-for-microsoft-azure/velero-plugin-for-microsoft-azure/util"
3839
veleroplugin "github.com/vmware-tanzu/velero/pkg/plugin/framework"
3940
"github.com/vmware-tanzu/velero/pkg/util/azure"
4041
)
@@ -227,11 +228,12 @@ func (o *ObjectStore) Init(config map[string]string) error {
227228
azure.BSLConfigUseAAD,
228229
azure.BSLConfigStorageAccountAccessKeyName,
229230
credentialsFileConfigKey,
231+
util.ApiVersion,
230232
); err != nil {
231233
return err
232234
}
233235

234-
client, cred, err := NewStorageClient(o.log, config)
236+
client, cred, err := util.NewStorageClient(o.log, config)
235237
if err != nil {
236238
return err
237239
}

velero-plugin-for-microsoft-azure/storage.go

-185
This file was deleted.

0 commit comments

Comments
 (0)