Monitoring your Resources

Getting information on your resources

You can use kubectl to get information on your resources.

Before you begin

To complete these steps, you need existing Config Connector resources. For an example resource, see Getting started with Config Connector.

Listing all resources

You can list your resources managed by Config Connector with kubectl get gcp.

kubectl get gcp

Describing a resource

Use kubectl describe to get details on a resource.

For example, to view the Cloud Spanner instance, run the following command:

kubectl --namespace [CC_NAMESPACE] describe spannerinstance spannerinstance-sample

Replace [CC_NAMESPACE] with the namespace Config Connector manages resources from.

Waiting for resources to be ready

You can determine if you resource is ready by looking at its status.condition. Config Connector will always update the status to reflect the current state of your resource.

For example, to check if your Cloud Spanner instance is ready, run the following command:

kubectl --namespace [CC_NAMESPACE] wait --for=condition=READY spannerinstance spannerinstance-sample

Replace [CC_NAMESPACE] with the namespace Config Connector manages resources from.

Viewing events

Config Connector creates Kubernetes events with information and errors about managing resources. You can view events for a specific resource, or all events in your Config Connector environment.

Viewing events for a single resource

You can view the events for a single resource by examining the Events field in the output of the following command:

kubectl --namespace [CC_NAMESPACE] describe [KIND] [NAME]

Replace:

  • [CC_NAMESPACE] with the namespace Config Connector manages resources from
  • [KIND] with your resource's Kind
  • [NAME] with your resource's name

For example, if you had a Config Connector SpannerInstance resource named spannerinstance-sample in a project named myproject, use the following command to view its Events:

kubectl --namespace myproject describe spannerinstance spannerinstance-sample

View events for a Namespace

To see the events for all Kubernetes resources in a given Namespace, including your Config Connector resources, run the following command replacing [NAMESPACE_NAME] with your Namespace:

kubectl --namespace [CC_NAMESPACE] get events

Replace [CC_NAMESPACE] with the namespace Config Connector manages resources from.

Config Connector-specific events

In addition to regular Kubernetes events, Config Connector can create the following Event types.

DependencyNotReady
Occurs when a referenced resource is not Ready.
DependencyNotFound
Occurs when a referenced resource or Secret object is not found.
DependencyInvalid
Occurs when the dependency exists, but is not valid. For example, the Config Connector controller creates a DependencyInvalid Event if a Secret exists, but the secretKeyRef is not found.

What's next