Before we can connect to google storage, we need to create a bucket.
To create a butjet, we're going to 'cloud storage/buckets' and press create, to later assign a name to the butcker and configure it to the needs of the project
To connect to the bucket, we must add the following configuration in the service's deployment file.
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
name: conection-test-bucker
namespace: test
uid: 6636bbee-19a6-439a-18o4-fad045bbb8s6
spec:
template:
spec:
containers:
- env:
- name: ROOT_STORAGE_PATH
value: <name-butcher> #Name of the created buckets
- name: STORAGE_KEY_PATH
value: <access-key> #Address of the secrect that stores the credentials to access the cubes, example -> /storage/storage-key.json
- name: STORAGE_PROJECT_ID
value: <name-proyect> #Name of proyect
volumeMounts:
- mountPath: /storage
name: storage-key
readOnly: true
volumes:
- name: storage-key
secret:
defaultMode: 420
secretName: storage-key
Setting the volumeMount and volumes is important, because without it, the credentials cannot be accessed