GCSBucket
Checks the contents of a GCP bucket for size, age and count.
See Folder for a full description.
gcs-folder-check.yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
  name: gcs-bucket-check
spec:
  interval: 30
  spec:
    folder:
      - name: gcs auth test
        path: gcs://somegcsbucket
        minCount: 5
| Field | Description | Scheme | Required | 
|---|---|---|---|
name | Name of the check | string | Yes | 
path | A path to a GCS bucket and folder e.g. gcs://bucket/folder | string | Yes | 
gcpConnection | Connection details for GCP | GCPConnection | |
* | All other fields available in the folder check | Folder | |
name | Name of the check, must be unique within the canary | string | Yes | 
description | Description for the check | string | |
icon | Icon for overwriting default icon on the dashboard | string | |
labels | Labels for check | map[string]string | |
test | Evaluate whether a check is healthy | Expression | |
display | Expression to change the formatting of the display | Expression | |
transform | Transform data from a check into multiple individual checks | Expression | |
metrics | Metrics to export from | []Metrics | |
| Connection | |||
connection | Path of an existing connection e.g. connection://aws/instance Mutually exclusive with credentials   | Connection | |
credentials | GCP Access Token File. | EnvVar | Yes | 
Connecting to GCP
There are 3 options when connecting to GCP:
- GKE workload identity (the default if no 
connectionorcredentialsis specified) connection, this is the recommended method, connections are reusable and secure
aws-connection.yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
  name: database-backup-check
spec:
  interval: 60
  folder:
      - name: gcs auth test
        path: gcs://somegcsbucket
        gcpConnection:
          connection: connection://gcp/internal
credentialsEnvVar with the service account json key stored in a secret.
aws.yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
  name: database-backup-check
spec:
  interval: 60
  folder:
      - name: gcs auth test
        path: gcs://somegcsbucket
        gcpConnection:
          credentials:
            valueFrom:
              secretKeyRef:
                name: gcp-credentials
                key: AUTH_ACCESS_TOKEN
To create the secret
kubectl create secret generic gcp-credentials --from-file=AUTH_ACCESS_TOKEN=path/to/your/SA_Key.json