Skip to content

Commit

Permalink
Added missing elements in parent relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
kyasbal committed Feb 10, 2025
1 parent a0144a0 commit 9adb827
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/en/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ GKE worker node components logs mainly from kubelet,containerd and dockerd.

|Timeline type|Short name on chip|
|:-:|:-:|
|![CCCCCC](https://placehold.co/15x15/CCCCCC/CCCCCC.png)[The default resource timeline](./relationships.md#RelationshipChild)|resource|
|![fe9bab](https://placehold.co/15x15/fe9bab/fe9bab.png)[Container timeline](./relationships.md#RelationshipContainer)|container|
|![0077CC](https://placehold.co/15x15/0077CC/0077CC.png)[Node component timeline](./relationships.md#RelationshipNodeComponent)|node-component|

Expand Down Expand Up @@ -199,6 +200,8 @@ GKE audit log including cluster creation,deletion and upgrades.

|Timeline type|Short name on chip|
|:-:|:-:|
|![CCCCCC](https://placehold.co/15x15/CCCCCC/CCCCCC.png)[The default resource timeline](./relationships.md#RelationshipChild)|resource|
|![000000](https://placehold.co/15x15/000000/000000.png)[Operation timeline](./relationships.md#RelationshipOperation)|operation|

<!-- END GENERATED PART: feature-element-output-timelines-gke_audit -->
<!-- BEGIN GENERATED PART: feature-element-target-query-gke_audit -->
Expand Down Expand Up @@ -238,6 +241,7 @@ Compute API audit logs used for cluster related logs. This also visualize operat

|Timeline type|Short name on chip|
|:-:|:-:|
|![CCCCCC](https://placehold.co/15x15/CCCCCC/CCCCCC.png)[The default resource timeline](./relationships.md#RelationshipChild)|resource|
|![000000](https://placehold.co/15x15/000000/000000.png)[Operation timeline](./relationships.md#RelationshipOperation)|operation|

<!-- END GENERATED PART: feature-element-output-timelines-compute_api -->
Expand Down Expand Up @@ -286,6 +290,7 @@ GCE network API audit log including NEG related audit logs to identify when the

|Timeline type|Short name on chip|
|:-:|:-:|
|![000000](https://placehold.co/15x15/000000/000000.png)[Operation timeline](./relationships.md#RelationshipOperation)|operation|
|![A52A2A](https://placehold.co/15x15/A52A2A/A52A2A.png)[NEG timeline](./relationships.md#RelationshipNetworkEndpointGroup)|neg|

<!-- END GENERATED PART: feature-element-output-timelines-gce_network -->
Expand Down Expand Up @@ -332,6 +337,7 @@ Anthos Multicloud audit log including cluster creation,deletion and upgrades.

|Timeline type|Short name on chip|
|:-:|:-:|
|![000000](https://placehold.co/15x15/000000/000000.png)[Operation timeline](./relationships.md#RelationshipOperation)|operation|

<!-- END GENERATED PART: feature-element-output-timelines-multicloud_api -->
<!-- BEGIN GENERATED PART: feature-element-target-query-multicloud_api -->
Expand Down Expand Up @@ -372,6 +378,7 @@ This log type also includes Node Auto Provisioner logs.

|Timeline type|Short name on chip|
|:-:|:-:|
|![CCCCCC](https://placehold.co/15x15/CCCCCC/CCCCCC.png)[The default resource timeline](./relationships.md#RelationshipChild)|resource|
|![FF5555](https://placehold.co/15x15/FF5555/FF5555.png)[Managed instance group timeline](./relationships.md#RelationshipManagedInstanceGroup)|mig|

<!-- END GENERATED PART: feature-element-output-timelines-autoscaler -->
Expand Down Expand Up @@ -412,6 +419,7 @@ Anthos OnPrem audit log including cluster creation,deletion,enroll,unenroll and

|Timeline type|Short name on chip|
|:-:|:-:|
|![000000](https://placehold.co/15x15/000000/000000.png)[Operation timeline](./relationships.md#RelationshipOperation)|operation|

<!-- END GENERATED PART: feature-element-output-timelines-onprem_api -->
<!-- BEGIN GENERATED PART: feature-element-target-query-onprem_api -->
Expand Down Expand Up @@ -452,6 +460,7 @@ Visualize Kubernetes control plane component logs on a cluster

|Timeline type|Short name on chip|
|:-:|:-:|
|![CCCCCC](https://placehold.co/15x15/CCCCCC/CCCCCC.png)[The default resource timeline](./relationships.md#RelationshipChild)|resource|
|![FF5555](https://placehold.co/15x15/FF5555/FF5555.png)[Control plane component timeline](./relationships.md#RelationshipControlPlaneComponent)|controlplane|

<!-- END GENERATED PART: feature-element-output-timelines-k8s_control_plane_component -->
Expand Down
32 changes: 32 additions & 0 deletions docs/en/relationships.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Relationships

KHI timelines are basically placed in the order of `Kind` -> `Namespace` -> `Resource name` -> `Subresource name`.
The relationship its parent and children is basically interpretted as the order of its hierarchy, but some subresources are not actual kubernetes resources and it's associated with the parent timeline for convenience. Each timeline color meanings and type of logs put on them are different by this relationship.

<!-- BEGIN GENERATED PART: relationship-element-header-RelationshipChild -->
## [The default resource timeline](#RelationshipChild)
<!-- END GENERATED PART: relationship-element-header-RelationshipChild -->
Expand All @@ -9,9 +14,11 @@ This timeline can have the following revisions.
<!-- BEGIN GENERATED PART: relationship-element-header-RelationshipChild-revisions-table -->
|State|Source log|Description|
|---|---|---|
|![#997700](https://placehold.co/15x15/997700/997700.png)Resource may be existing|![#000000](https://placehold.co/15x15/000000/000000.png)k8s_audit|This state indicates the resource exits at the time, but this existence is inferred from the other logs later. The detailed resource information is not available.|
|![#0000FF](https://placehold.co/15x15/0000FF/0000FF.png)Resource is existing|![#000000](https://placehold.co/15x15/000000/000000.png)k8s_audit|This state indicates the resource exits at the time|
|![#CC0000](https://placehold.co/15x15/CC0000/CC0000.png)Resource is deleted|![#000000](https://placehold.co/15x15/000000/000000.png)k8s_audit|This state indicates the resource is deleted at the time.|
|![#CC5500](https://placehold.co/15x15/CC5500/CC5500.png)Resource is under deleting with graceful period|![#000000](https://placehold.co/15x15/000000/000000.png)k8s_audit|This state indicates the resource is being deleted with grace period at the time.|
|![#4444ff](https://placehold.co/15x15/4444ff/4444ff.png)Resource is being provisioned|![#AA00FF](https://placehold.co/15x15/AA00FF/AA00FF.png)gke_audit|This state indicates the resource is being provisioned. Currently this state is only used for cluster/nodepool status only.|

<!-- END GENERATED PART: relationship-element-header-RelationshipChild-revisions-table -->
<!-- BEGIN GENERATED PART: relationship-element-header-RelationshipChild-events-header -->
Expand All @@ -24,6 +31,10 @@ This timeline can have the following events.
|---|---|
|![#000000](https://placehold.co/15x15/000000/000000.png)k8s_audit|An event that related to a resource but not changing the resource. This is often an error log for an operation to the resource.|
|![#3fb549](https://placehold.co/15x15/3fb549/3fb549.png)k8s_event|An event that related to a resource|
|![#0077CC](https://placehold.co/15x15/0077CC/0077CC.png)k8s_node|An event that related to a node resource|
|![#FFCC33](https://placehold.co/15x15/FFCC33/FFCC33.png)compute_api|An event that related to a compute resource|
|![#FF3333](https://placehold.co/15x15/FF3333/FF3333.png)control_plane_component|A log related to the timeline resource related to control plane component|
|![#FF5555](https://placehold.co/15x15/FF5555/FF5555.png)autoscaler|A log related to the Pod which triggered or prevented autoscaler|

<!-- END GENERATED PART: relationship-element-header-RelationshipChild-events-table -->
<!-- BEGIN GENERATED PART: relationship-element-header-RelationshipResourceCondition -->
Expand Down Expand Up @@ -55,6 +66,14 @@ This timeline can have the following revisions.
|---|---|---|
|![#004400](https://placehold.co/15x15/004400/004400.png)Processing operation|![#FFCC33](https://placehold.co/15x15/FFCC33/FFCC33.png)compute_api||
|![#333333](https://placehold.co/15x15/333333/333333.png)Operation is finished|![#FFCC33](https://placehold.co/15x15/FFCC33/FFCC33.png)compute_api||
|![#004400](https://placehold.co/15x15/004400/004400.png)Processing operation|![#AA00FF](https://placehold.co/15x15/AA00FF/AA00FF.png)gke_audit||
|![#333333](https://placehold.co/15x15/333333/333333.png)Operation is finished|![#AA00FF](https://placehold.co/15x15/AA00FF/AA00FF.png)gke_audit||
|![#004400](https://placehold.co/15x15/004400/004400.png)Processing operation|![#33CCFF](https://placehold.co/15x15/33CCFF/33CCFF.png)network_api||
|![#333333](https://placehold.co/15x15/333333/333333.png)Operation is finished|![#33CCFF](https://placehold.co/15x15/33CCFF/33CCFF.png)network_api||
|![#004400](https://placehold.co/15x15/004400/004400.png)Processing operation|![#AA00FF](https://placehold.co/15x15/AA00FF/AA00FF.png)multicloud_api||
|![#333333](https://placehold.co/15x15/333333/333333.png)Operation is finished|![#AA00FF](https://placehold.co/15x15/AA00FF/AA00FF.png)multicloud_api||
|![#004400](https://placehold.co/15x15/004400/004400.png)Processing operation|![#AA00FF](https://placehold.co/15x15/AA00FF/AA00FF.png)onprem_api||
|![#333333](https://placehold.co/15x15/333333/333333.png)Operation is finished|![#AA00FF](https://placehold.co/15x15/AA00FF/AA00FF.png)onprem_api||

<!-- END GENERATED PART: relationship-element-header-RelationshipOperation-revisions-table -->
<!-- BEGIN GENERATED PART: relationship-element-header-RelationshipEndpointSlice -->
Expand Down Expand Up @@ -106,6 +125,19 @@ This timeline can have the following events.
<!-- BEGIN GENERATED PART: relationship-element-header-RelationshipNodeComponent -->
## [![#0077CC](https://placehold.co/15x15/0077CC/0077CC.png) node-component - Node component timeline](#RelationshipNodeComponent)
<!-- END GENERATED PART: relationship-element-header-RelationshipNodeComponent -->
<!-- BEGIN GENERATED PART: relationship-element-header-RelationshipNodeComponent-revisions-header -->
### Revisions

This timeline can have the following revisions.
<!-- END GENERATED PART: relationship-element-header-RelationshipNodeComponent-revisions-header -->
<!-- BEGIN GENERATED PART: relationship-element-header-RelationshipNodeComponent-revisions-table -->
|State|Source log|Description|
|---|---|---|
|![#997700](https://placehold.co/15x15/997700/997700.png)Resource may be existing|![#0077CC](https://placehold.co/15x15/0077CC/0077CC.png)k8s_node||
|![#0000FF](https://placehold.co/15x15/0000FF/0000FF.png)Resource is existing|![#0077CC](https://placehold.co/15x15/0077CC/0077CC.png)k8s_node||
|![#CC0000](https://placehold.co/15x15/CC0000/CC0000.png)Resource is deleted|![#0077CC](https://placehold.co/15x15/0077CC/0077CC.png)k8s_node||

<!-- END GENERATED PART: relationship-element-header-RelationshipNodeComponent-revisions-table -->
<!-- BEGIN GENERATED PART: relationship-element-header-RelationshipNodeComponent-events-header -->
### Events

Expand Down
72 changes: 72 additions & 0 deletions pkg/model/enum/parent_relationship.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ var ParentRelationships = map[ParentRelationship]ParentRelationshipFrontendMetad
LabelBackgroundColor: "#CCCCCC",
SortPriority: 1000,
GeneratableRevisions: []GeneratableRevisionInfo{
{
State: RevisionStateInferred,
SourceLogType: LogTypeAudit,
Description: "This state indicates the resource exits at the time, but this existence is inferred from the other logs later. The detailed resource information is not available.",
},
{
State: RevisionStateExisting,
SourceLogType: LogTypeAudit,
Expand All @@ -101,6 +106,11 @@ var ParentRelationships = map[ParentRelationship]ParentRelationshipFrontendMetad
SourceLogType: LogTypeAudit,
Description: "This state indicates the resource is being deleted with grace period at the time.",
},
{
State: RevisionStateProvisioning,
SourceLogType: LogTypeGkeAudit,
Description: "This state indicates the resource is being provisioned. Currently this state is only used for cluster/nodepool status only.",
},
},
GeneratableEvents: []GeneratableEventInfo{
{
Expand All @@ -111,6 +121,22 @@ var ParentRelationships = map[ParentRelationship]ParentRelationshipFrontendMetad
SourceLogType: LogTypeEvent,
Description: "An event that related to a resource",
},
{
SourceLogType: LogTypeNode,
Description: "An event that related to a node resource",
},
{
SourceLogType: LogTypeComputeApi,
Description: "An event that related to a compute resource",
},
{
SourceLogType: LogTypeControlPlaneComponent,
Description: "A log related to the timeline resource related to control plane component",
},
{
SourceLogType: LogTypeAutoscaler,
Description: "A log related to the Pod which triggered or prevented autoscaler",
},
},
},
RelationshipResourceCondition: {
Expand Down Expand Up @@ -155,6 +181,38 @@ var ParentRelationships = map[ParentRelationship]ParentRelationshipFrontendMetad
State: RevisionStateOperationFinished,
SourceLogType: LogTypeComputeApi,
},
{
State: RevisionStateOperationStarted,
SourceLogType: LogTypeGkeAudit,
},
{
State: RevisionStateOperationFinished,
SourceLogType: LogTypeGkeAudit,
},
{
State: RevisionStateOperationStarted,
SourceLogType: LogTypeNetworkAPI,
},
{
State: RevisionStateOperationFinished,
SourceLogType: LogTypeNetworkAPI,
},
{
State: RevisionStateOperationStarted,
SourceLogType: LogTypeMulticloudAPI,
},
{
State: RevisionStateOperationFinished,
SourceLogType: LogTypeMulticloudAPI,
},
{
State: RevisionStateOperationStarted,
SourceLogType: LogTypeOnPremAPI,
},
{
State: RevisionStateOperationFinished,
SourceLogType: LogTypeOnPremAPI,
},
},
},
RelationshipEndpointSlice: {
Expand Down Expand Up @@ -230,6 +288,20 @@ var ParentRelationships = map[ParentRelationship]ParentRelationshipFrontendMetad
LabelBackgroundColor: "#0077CC",
Hint: "Non container resource running on a node",
SortPriority: 6000,
GeneratableRevisions: []GeneratableRevisionInfo{
{
State: RevisionStateInferred,
SourceLogType: LogTypeNode,
},
{
State: RevisionStateExisting,
SourceLogType: LogTypeNode,
},
{
State: RevisionStateDeleted,
SourceLogType: LogTypeNode,
},
},
GeneratableEvents: []GeneratableEventInfo{
{
SourceLogType: LogTypeNode,
Expand Down

0 comments on commit 9adb827

Please sign in to comment.