A utility that scrapes Cloud Foundry APIs to provide metadata about a CF installation.
It is designed to be invoked as a Velero hook.
For more information, see this doc.
Running Tests
Unit/Binary Tests
go test -v ./internal/... ./test/binary/...
End-to-End (e2e) Integration Tests
Prerequisites:
-
A Kubernetes cluster with Velero installed. See our CI script for a GCP example.
For GCP you will also need to provide a service account with the following permissions:
compute.disks.create
compute.disks.createSnapshot
compute.disks.get
compute.snapshots.create
compute.snapshots.delete
compute.snapshots.get
compute.snapshots.useReadOnly
storage.objects.create
storage.objects.get
storage.objects.delete
storage.objects.list
compute.zones.get
storage.buckets.get
For other IaaSes refer to the Velero docs.
-
The velero
CLI installed locally
-
kubectl
targeted to this environment
-
GNU grep as grep
on your PATH (brew install grep
)
go test -v ./internal/e2e
Deployment
The following environment variables are required:
CF_API_HOST
- URL for the CF API
CF_CLIENT
- Name of a UAA Client with cloud_controller.read
and cloud_controller.read_only_admin
authorities
CF_CLIENT_SECRET
- Secret for authenticating the client
You will also need to provide the following Velero hook annotations on the Pod
(substitute CONTAINER_NAME
with the name of the container):
pre.hook.backup.velero.io/container: CONTAINER_NAME
pre.hook.backup.velero.io/command: '["/cnb/process/generate-metadata"]'
In cf-for-k8s
the backup-metadata-generator
container is colocated on the cf-api-controllers
Deployment.