Conectar un contenedor a Google Storage
Para crear un butjet:
Ir a 'cloud storage/buckets'.
Presionar create.
Asignar un nombre al butcker.
Configurar según las necesidades del proyecto.
Para conectarse al bucket, es necesario agregar la siguiente configuración en el archivo de despliegue del servicio.
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
La configuración de volumeMount y los volúmenes es importante, porque sin ella, no se puede acceder a las credenciales.
Last updated