Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gianlucam76/gcs-storage-operator
Create Storage Bucket
https://github.com/gianlucam76/gcs-storage-operator
Last synced: 9 days ago
JSON representation
Create Storage Bucket
- Host: GitHub
- URL: https://github.com/gianlucam76/gcs-storage-operator
- Owner: gianlucam76
- License: apache-2.0
- Created: 2023-04-20T07:02:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-24T08:35:05.000Z (over 1 year ago)
- Last Synced: 2024-06-20T20:01:28.926Z (6 months ago)
- Language: Go
- Size: 33.1 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
```
2. 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-demokubectl 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= -n sveltos-demo
```## Deploy operator
Assuming kubectl is pointing to your management cluster,
```bash
kubectl apply -f https://raw.githubusercontent.com/gianlucam76/gcs-storage-operator/main/manifest/manifest.yaml
```## Create a Bucket
```yaml
apiVersion: demo.projectsveltos.io/v1alpha1
kind: Bucket
metadata:
name: bucket-sample
spec:
bucketName:
location: us-central1
serviceAccount: serviceAccount:
```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.