I deployed couchbase in AKS using helm.
Now I’m trying to configure backups.
Everything is fine when I configure backups with k8s pvm.
But something wrong when I try to configure backups with Azure storage account.
I followed the manual:
create secret and couchbasebackup
apiVersion: v1
kind: Secret
metadata:
name: azure-secret
namespace: apps
type: Opaque
data:
access-key-id: <storage_account_name>
secret-access-key: <key_value>
I’m sorry if my comments are too harsh, but I’ve been trying to figure this out for 3 days now. The instructions on the site are extremely inaccurate, only a few lines are devoted to configuring backups in azure
and now question is how can I specify the values of these env variables?
I’m using not standard k8s deployment -I’m using custom resource “CouchbaseBackup” and I can’t specify something like
Thanks for your feedback @DenisB , I’ve brought this to the attention of our PM team so they can make sure the documentation gets updated with appropriate examples here.
From there you’ll need to set a container to store that information in. Ihis must exist already exist, Operator will not have permission to create it for you.
apiVersion: couchbase/v2
kind: CouchbaseBackup
spec:
...
objectStore:
secret: azure-secret
uri: az://<name of the container>
From the screenshot, containers is under data storage. clicking there will allow you to create the container you wish to store data in.
As you can see with this custom resource you CAN’T provide any specific values to flag or environment variables
But I need to do it following this manual
Question: how is it possible to provide additional flag “-obj-access-key-key” OR The AZURE_STORAGE_ACCOUNT environment variable? OR- The AZURE_STORAGE_CONNECTION_STRING environment variable? Using kubernetes manifests
I can do it using CLI if I deployed Couchbase on VMs, but I can’t do it in AKS
Just for clarification: For example, I created storage account with name straccnametest1
create container with name cbbackup
I get this URL for this container from Azure portal https://straccnametest1.blob.core.windows.net/cbbackup
The values inside the secret are passed to the backup container as env vars so
access-key-id in the azure-secret is equivalent to the --obj-access-key-id flag and CB_OBJSTORE_ACCESS_KEY_ID env var. secret-access-key in the azure-secret is equivalent to --obj-secret-access-key and CB_OBJSTORE_SECRET_ACCESS_KEY env var.
OK, doublechecked
then I returned to my first post:
I specified values exactly as you said.
created new fresh azure storage account, opened public access without any restrictions, created container cbbackup
first create secret, then create Couchbasebackup resource
And received an error- in pod:
2023-07-14T15:45:34 INFO Checking connection to Kubernetes API…
2023-07-14T15:45:35 INFO Creating repository couchbase-release-2023-07-14T15_45_34 in location az://cbbackup/archive
2023-07-14T15:45:35 ERROR Subprocess call exited with non-zero return code 1
2023-07-14T15:45:35 ERROR Arguments: cbbackupmgr config --archive az://cbbackup/archive --repo couchbase-release-2023-07-14T15_45_34 --obj-staging-dir /data/staging --s3-force-path-style --obj-auth-by-instance-metadata
2023-07-14T15:45:35 ERROR Stdout: b’Backup repository creation failed: failed to get service client: failed to get service URL: failed to determine account name\n’
2023-07-14T15:45:35 ERROR Stderr: b’’
2023-07-14T15:45:35 ERROR Failed to configure repository
2023-07-14T15:45:35 ERROR Command ‘[‘cbbackupmgr’, ‘config’, ‘–archive’, ‘az://cbbackup/archive’, ‘–repo’, ‘couchbase-release-2023-07-14T15_45_34’, ‘–obj-staging-dir’, ‘/data/staging’, ‘–s3-force-path-style’, ‘–obj-auth-by-instance-metadata’]’ returned non-zero exit status 1.
/usr/local/lib/python3.8/dist-packages/requests/init.py:109: RequestsDependencyWarning: urllib3 (2.0.2) or chardet (None)/charset_normalizer (3.1.0) doesn’t match a supported version!
warnings.warn(
what can I check else? I’m SURE that I use proper creds cause I use this creds when I connect to storage account with CLI
Environment:
CB_OBJSTORE_ACCESS_KEY_ID: <set to the key 'access-key-id' in secret 'azure-secret'> Optional: false
CB_OBJSTORE_SECRET_ACCESS_KEY: <set to the key 'secret-access-key' in secret 'azure-secret'> Optional: false
maybe just share the whole describe if that is possible