Viewing operations with a Managed Service for Kubernetes cluster
All actions with Managed Service for Kubernetes resources are logged as a list of operations. Each operation gets its own unique ID.
Operations enable you to monitor actions with your cluster in real-time. This may be relevant in automating infrastructure creation, where the state of an operation determines the next steps. For example, before creating a node group, you need to track the status of the cluster creation operation.
The service retains operation records for a limited time. To monitor the state of the cluster and log actions with it, use Yandex Monitoring, Yandex Cloud Logging, and Yandex Audit Trails.
Getting a list of operations
To view operations with all Kubernetes clusters, in the left-hand panel, select
You can get a list of operations for a specific cluster:
-
In the management console
, open the folder with the cluster. -
Select Managed Service for Kubernetes.
-
Select the cluster.
-
Go to the
Operations panel for the selected cluster.You will see a list of operations with the selected cluster.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameters.
To get a list of operations for a Managed Service for Kubernetes cluster, run this command:
yc managed-kubernetes cluster list-operations <cluster_name_or_ID>
Result:
+----------------------+---------------------+----------------------+---------------------+--------+----------------+
| ID | CREATED AT | CREATED BY | MODIFIED AT | STATUS | DESCRIPTION |
+----------------------+---------------------+----------------------+---------------------+--------+----------------+
| cat5g6mqaccn******** | 2024-05-14 18:40:02 | aje9k8luj4qf******** | 2024-05-14 18:40:03 | DONE | Update cluster |
| cati1flsiarv******** | 2024-05-14 18:29:13 | aje9k8luj4qf******** | 2024-05-14 18:36:17 | DONE | Create cluster |
+----------------------+---------------------+----------------------+---------------------+--------+----------------+
By default, information about operations is output as text. To get detailed information, specify the yaml
or json
output data format using the --format
flag:
yc managed-kubernetes cluster list-operations <cluster_name_or_ID> --format yaml
Result:
- id: cat5g6mqaccn********
description: Update cluster
created_at: "2024-05-14T18:40:02Z"
created_by: aje9k8luj4qf********
modified_at: "2024-05-14T18:40:03Z"
done: true
metadata:
'@type': type.googleapis.com/yandex.cloud.k8s.v1.UpdateClusterMetadata
cluster_id: cathr91hiupd********
response:
'@type': type.googleapis.com/yandex.cloud.k8s.v1.Cluster
id: cathr91hiupd********
folder_id: b1g681qpemb4********
created_at: "2024-05-14T18:29:13Z"
name: my-k8s-logs
status: RUNNING
health: HEALTHY
network_id: enpphqi8uvcm********
...
service_account_id: ajeevjv1lv01********
node_service_account_id: ajeevjv1lv01********
release_channel: REGULAR
- id: cati1flsiarv********
description: Create cluster
created_at: "2024-05-14T18:29:13Z"
created_by: aje9k8luj4qf********
modified_at: "2024-05-14T18:36:17Z"
done: true
metadata:
'@type': type.googleapis.com/yandex.cloud.k8s.v1.CreateClusterMetadata
cluster_id: cathr91hiupd********
response:
'@type': type.googleapis.com/yandex.cloud.k8s.v1.Cluster
id: cathr91hiupd********
folder_id: b1g681qpemb4********
created_at: "2024-05-14T18:29:13Z"
name: my-k8s
status: RUNNING
health: HEALTHY
network_id: enpphqi8uvcm********
...
node_service_account_id: ajeevjv1lv01********
release_channel: REGULAR
Use either the listOperations REST API method for the Cluster resource or the ClusterService/ListOperations gRPC API call.
Getting detailed information about an operation
-
Get a list of operations for the Managed Service for Kubernetes cluster.
-
Copy the operation ID.
-
Get detailed information about the operation:
CLIAPIIf you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the
--folder-name
or--folder-id
parameters.Run this command:
yc operation get <operation_ID>
Result:
id: cat5g6mqaccn******** description: Update cluster created_at: "2024-05-14T18:40:02Z" created_by: aje9k8luj4qf******** modified_at: "2024-05-14T18:40:03Z" done: true metadata: '@type': type.googleapis.com/yandex.cloud.k8s.v1.UpdateClusterMetadata cluster_id: cathr91hiupd******** response: '@type': type.googleapis.com/yandex.cloud.k8s.v1.Cluster id: cathr91hiupd******** folder_id: b1g681qpemb4******** created_at: "2024-05-14T18:29:13Z" name: my-k8s-logs status: RUNNING health: HEALTHY network_id: enpphqi8uvcm******** ... service_account_id: ajeevjv1lv01******** node_service_account_id: ajeevjv1lv01******** release_channel: REGULAR
Use the OperationService/Get gRPC API call.