Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Memantau workload yang dimigrasikan
Anda dapat melihat log dan metrik dari beban kerja yang dimigrasikan di konsol Google Cloud .
Anda juga dapat melihat log dari command line dengan
kubectl.
Anda dapat menjalankan perintah bash di penampung dengan workload yang dimigrasikan. Untuk mengetahui informasi selengkapnya, lihat Topik pemecahan masalah.
Melihat metrik di konsol GKE
Konsol GKE dan Cloud Monitoring menyediakan rangkaian alat untuk memantau penampung Anda. Untuk memulai:
Temukan beban kerja Anda, lalu klik Nama. Halaman Deployment Details akan muncul.
Temukan baris berlabel Log, lalu klik Log penampung.
Tindakan ini akan memuat Cloud Logging, yang hanya menampilkan log untuk workload ini.
Melihat log di kubectl
Anda dapat menggunakan kubectl untuk mengambil log dari penampung yang sedang berjalan. Anda juga dapat
memantau progres ekspor dari penyimpanan jangka pendek ke jangka panjang.
Untuk melihat log pod:
Temukan nama pod Anda dari output kubectl get pods. Dalam
contoh di bawah, nama pod adalah suitecrm-app-0.
kubectl get pods
NAME READY STATUS RESTARTS AGE
csi-disk-controller-0 3/3 Running 4 4d
csi-disk-node-5t922 3/3 Running 3 4d
csi-disk-node-5tdcp 3/3 Running 3 4d
csi-disk-node-86c2t 3/3 Running 3 4d
csi-disk-node-8785n 3/3 Running 3 4d
suitecrm-app-0 1/1 Running 0 17h
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-19 UTC."],[],[],null,["# Monitor migrated workloads\n==========================\n\nYou can view logs and metrics from your migrated workloads in the Google Cloud console.\nYou can also view logs from the command line with\n[`kubectl`](https://kubernetes.io/docs/reference/kubectl/overview/).\n\nYou can execute `bash` commands on the container with your migrated workload. For\nmore, see the [Troubleshooting topic](/migrate/containers/docs/troubleshooting#executing-bash-commands).\n\nView metrics on the GKE console\n-------------------------------\n\nThe GKE console and [Cloud Monitoring](/monitoring/docs)\nprovide a suite of tools to monitor your containers. To get started:\n\n1. [Open GKE Workloads](https://console.cloud.google.com/kubernetes/workload)\n2. Click the name of the workload you would like to monitor.\n\nFrom here, you can see details about this workload, including aggregate graphs\nof performance across all Pods.\n\nView logs in Cloud Logging\n--------------------------\n\n\nOnce you [enable monitoring](/monitoring/api/enable-api), you can view workload logs\nin the Cloud Monitoring user interface.\n\n\nYou can use Cloud Logging to view logs for the following aspects of your migration:\n\n- Logs written to `stdout` by processes launched by `init`.\n- The content of var/log/syslog.\n- Optionally, application logs written to the file system.\n\n\nYou can view system logs that are in Cloud Logging from the Google Cloud console. To do so:\n\n1. [Open GKE Workloads](https://console.cloud.google.com/kubernetes/workload).\n2. Find your workload and click its **Name** . The **Deployment Details** page appears.\n3. Find the row labeled **Logs** and click **Container logs**.\n\n\nThis loads Cloud Logging, showing logs for this workload only.\n\nView logs in kubectl\n--------------------\n\nYou can use `kubectl` to retrieve logs from a running container. You can also\nmonitor the progress of export from short-term to long-term storage.\n\nTo view the logs for a pod:\n\n1. Find the name of your pod from the output of `kubectl get pods`. In the\n example below, the pod's name is `suitecrm-app-0`.\n\n kubectl get pods\n NAME READY STATUS RESTARTS AGE\n csi-disk-controller-0 3/3 Running 4 4d\n csi-disk-node-5t922 3/3 Running 3 4d\n csi-disk-node-5tdcp 3/3 Running 3 4d\n csi-disk-node-86c2t 3/3 Running 3 4d\n csi-disk-node-8785n 3/3 Running 3 4d\n suitecrm-app-0 1/1 Running 0 17h\n\n2. View the logs from your pod with [`kubectl logs`](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs).\n\n kubectl logs \u003cvar class=\"edit\" translate=\"no\"\u003e[POD_NAME]\u003c/var\u003e\n I0529 07:01:26.000000 12 hclog.py:48] [suitecrm-app-0] - Auto-detected template: centos\n D0529 07:01:26.000000 12 hclog.py:42] [util] - SHELL OUTPUT: UNIT FILE STATE\n D0529 07:01:26.000000 12 hclog.py:42] [util] - SHELL OUTPUT: adservice.service enabled\n\nThe pod's recent logs are displayed.\n\nFor more information on logging and Kubernetes, see the\n[Kubernetes Logging documentation](https://kubernetes.io/docs/concepts/cluster-administration/logging/).\n\nWhat's next\n-----------\n\n- Learn how to [upgrade container workloads for enhanced runtime](/migrate/containers/docs/convert-runtime)."]]