Skip to content

Commit

Permalink
Update gcp-config.md
Browse files Browse the repository at this point in the history
Automated setting environment variables using gcloud commands instead of copy/paste

Signed-off-by: Sandeep Dinesh <[email protected]>
  • Loading branch information
thesandlord committed Jul 24, 2018
1 parent daa61c5 commit dcae6eb
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions docs/gcp-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ If you do not have the `gcloud` and `gsutil` CLIs locally installed, follow the

## Create GCS bucket

Heptio Ark requires an object storage bucket in which to store backups, preferrably unique to a single Kubernetes cluster (see the [FAQ][20] for more details). Create a GCS bucket, replacing placeholder appropriately:
Heptio Ark requires an object storage bucket in which to store backups, preferrably unique to a single Kubernetes cluster (see the [FAQ][20] for more details). Create a GCS bucket, replacing the <YOUR_BUCKET> placeholder with the name of your bucket:

```bash
gsutil mb gs://<YOUR_BUCKET>/
BUCKET=<YOUR_BUCKET>

gsutil mb gs://$BUCKET/
```

## Create service account
Expand All @@ -26,6 +28,10 @@ To integrate Heptio Ark with GCP, create an Ark-specific [Service Account][15]:
```

Store the `project` value from the results in the environment variable `$PROJECT_ID`.

```bash
PROJECT_ID=$(gcloud config get-value project)
```

2. Create a service account:

Expand All @@ -42,11 +48,16 @@ To integrate Heptio Ark with GCP, create an Ark-specific [Service Account][15]:
```
Set the `$SERVICE_ACCOUNT_EMAIL` variable to match its `email` value.
```bash
SERVICE_ACCOUNT_EMAIL=$(gcloud iam service-accounts list \
--filter="displayName:Heptio Ark service account" \
--format 'value(email)')
```
3. Attach policies to give `heptio-ark` the necessary permissions to function:
```bash
BUCKET=<YOUR_BUCKET>
ROLE_PERMISSIONS=(
compute.disks.get
Expand Down Expand Up @@ -93,10 +104,12 @@ Create a Secret. In the directory of the credentials file you just created, run:
```bash
kubectl create secret generic cloud-credentials \
--namespace <ARK_NAMESPACE> \
--namespace heptio-ark \
--from-file cloud=credentials-ark
```
_Note: If you use a custom namespace, replace `heptio-ark` with the name of the custom namespace_
Specify the following values in the example files:
* In file `examples/gcp/00-ark-config.yaml`:
Expand Down

0 comments on commit dcae6eb

Please sign in to comment.