gcs-storage-operator

command module
v0.0.0-...-98a1388 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

gcs-storage-operator

Create Storage Bucket

Generate service account key file

Generate a Google Cloud service account key file (which is a JSON file containing the private key for a service account). You can skip this if you already have one.

  1. authenticate with your Google Cloud account by running the following command in your terminal
gcloud auth login
  1. Once you're authenticated, you can use the following command to create a new service account and generate a key for it
gcloud iam service-accounts keys create service-account-key.json --iam-account=[SA-EMAIL]

replace [SA-EMAIL] with the email address of the service account you want to create the key for.

Make service account key file available via Secret

Create a Secret in your management cluster, using the service-account-key.json created above.

kubectl create ns sveltos-demo

kubectl create secret generic my-gcs-operator-secret --from-file=service-account-key.json -n sveltos-demo

Create a Secret containing the Google ProjectID

kubectl create secret generic projectid --from-literal=projectid=<YOUR PROJECT ID> -n sveltos-demo

Deploy operator

Assuming kubectl is pointing to your management cluster,

kubectl apply -f https://raw.githubusercontent.com/gianlucam76/gcs-storage-operator/main/manifest/manifest.yaml

Create a Bucket

apiVersion: demo.projectsveltos.io/v1alpha1
kind: Bucket
metadata:
  name: bucket-sample
spec:
  bucketName: <BUCKET NAME>
  location: us-central1
  serviceAccount: serviceAccount:<SERVICE ACCOUNT EMAIL>

This will create a bucket. Deleting above instance, will cause controller to delete bucket from google cloud storage. Service account listed will be granted roles/storage.objectViewer for the bucket.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the demo v1alpha1 API group +kubebuilder:object:generate=true +groupName=demo.projectsveltos.io
Package v1alpha1 contains API Schema definitions for the demo v1alpha1 API group +kubebuilder:object:generate=true +groupName=demo.projectsveltos.io

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL