backup-metadata-generator

command module
v0.0.0-...-85617d8 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

backup-metadata-generator

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:

  1. 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.

  2. The velero CLI installed locally

  3. kubectl targeted to this environment

  4. 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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cfmetadata/cfmetadatafakes
Code generated by counterfeiter.
Code generated by counterfeiter.
delegate/delegatefakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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