Monitoring migrated workloads

You can view logs and metrics from your migrated workloads in the Google Cloud Platform Console. You can also view logs from the command line with kubectl.

Viewing metrics on the GKE console

The GKE console and Stackdriver provide a suite of tools to monitor your containers. To get started:

  1. Open GKE Workloads
  2. Click on the name of the workload you would like to monitor.

From here, you can see details about this workload, including aggregate graphs of performance across all of the pods.

Viewing Logs in Stackdriver

Once you enable Stackdriver, you can view workload logs in the Stackdriver user interface.

You can view system logs that are in Stackdriver from the GCP Console. To do so:

  1. Open GKE Workloads.
  2. Find your workload and click on its Name. The Deployment Details page appears.
  3. Find the row labeled Logs and click on Container logs.

This loads Stackdriver, showing logs for this workload only.

Container logs in Stackdriver

Viewing logs in kubectl

You can use kubectl to retrieve logs from a running container. To view the logs for a pod:

  1. Find the name of your pod from the output of kubectl get pods. In the example below, the pod's name is suitecrm-app-0.

    kubectl get pods
    NAME                       READY     STATUS    RESTARTS   AGE
    csi-vlsdisk-controller-0   3/3       Running   4          4d
    csi-vlsdisk-node-5t922     3/3       Running   3          4d
    csi-vlsdisk-node-5tdcp     3/3       Running   3          4d
    csi-vlsdisk-node-86c2t     3/3       Running   3          4d
    csi-vlsdisk-node-8785n     3/3       Running   3          4d
    suitecrm-app-0       1/1       Running   0          17h
  2. View the logs from your pod with kubectl logs.

    kubectl logs [POD_NAME]
    I0529 07:01:26.000000    12 hclog.py:48] [suitecrm-app-0] - Auto-detected template: centos
    D0529 07:01:26.000000    12 hclog.py:42] [util] - SHELL OUTPUT: UNIT FILE                                     STATE
    D0529 07:01:26.000000    12 hclog.py:42] [util] - SHELL OUTPUT: adservice.service                             enabled
    

The pod's recent logs are displayed.

For more information on logging and Kubernetes, see the Kubernetes Logging documentation.

Was this page helpful? Let us know how we did:

Send feedback about...

Migrate for Anthos Documentation