Skip to content

Summary data doesn't show information about the pod's parent except for deployment #731

Open
@vishnusomank

Description

Problem Statement

The latest Discovery Engine generates summary information for a pod, stores it in a database, and pushes the same information to the publisher. The table structure has a field deployment_name which will be populated when the pod is the child of a deployment. This information will be empty if the pod is deployed using a StatefulSet/DaemonSet/ReplicaSet.

Current Schema

CREATE TABLE `system_summary` ( 
  `id` INTEGER AUTO_INCREMENT, 
  `cluster_name` varchar(50) DEFAULT NULL, 
  `cluster_id` int DEFAULT NULL,  
  `workspace_id` int DEFAULT NULL, 
  `namespace_name` varchar(50) DEFAULT NULL, 
  `namespace_id` int DEFAULT NULL, 
  `container_name` varchar(50) DEFAULT NULL, 
  `container_image` varchar(100) DEFAULT NULL, 
  `container_id` varchar(150) DEFAULT NULL, 
  `podname` varchar(50) DEFAULT NULL, 
  `operation` varchar(10) DEFAULT NULL,   
  `labels` varchar(100) DEFAULT NULL, 
  `deployment_name` varchar(50) DEFAULT NULL, 
  `source` varchar(100) DEFAULT NULL, 
  `destination` varchar(100) DEFAULT NULL, 
  `destination_namespace` varchar(50) DEFAULT NULL, 
  `destination_labels` varchar(50) DEFAULT NULL,  
  `type` varchar(10) DEFAULT NULL, 
  `ip` int DEFAULT NULL,  
  `port` varchar(10) DEFAULT NULL, 
  `protocol` varchar(10) DEFAULT NULL, 
  `bindport` varchar(10) DEFAULT NULL, 
  `bindaddr` varchar(10) DEFAULT NULL, 
  `action` varchar(10) DEFAULT NULL, 
  `count` int NOT NULL,   
  `updated_time` bigint NOT NULL, 
  PRIMARY KEY (`id`)  
);

Proposed Change
To make sure that the pod's parent information is updated correctly on the database we would need the following

  1. Change the deployment_name to parent_name to make sure that pods deployed using other resources are also getting updated on the database
  2. Add a new field parent_type to store the pod's parent type (StatefulSet/ReplicaSet/DaemonSet/Deployments etc)

Proposed Schema

CREATE TABLE `system_summary` ( 
  `id` INTEGER AUTO_INCREMENT, 
  `cluster_name` varchar(50) DEFAULT NULL, 
  `cluster_id` int DEFAULT NULL,  
  `workspace_id` int DEFAULT NULL, 
  `namespace_name` varchar(50) DEFAULT NULL, 
  `namespace_id` int DEFAULT NULL, 
  `container_name` varchar(50) DEFAULT NULL, 
  `container_image` varchar(100) DEFAULT NULL, 
  `container_id` varchar(150) DEFAULT NULL, 
  `podname` varchar(50) DEFAULT NULL, 
  `operation` varchar(10) DEFAULT NULL,   
  `labels` varchar(100) DEFAULT NULL, 
  `parent_name` varchar(50) DEFAULT NULL, 
  `parent_type` varchar(50) DEFAULT NULL, 
  `source` varchar(100) DEFAULT NULL, 
  `destination` varchar(100) DEFAULT NULL, 
  `destination_namespace` varchar(50) DEFAULT NULL, 
  `destination_labels` varchar(50) DEFAULT NULL,  
  `type` varchar(10) DEFAULT NULL, 
  `ip` int DEFAULT NULL,  
  `port` varchar(10) DEFAULT NULL, 
  `protocol` varchar(10) DEFAULT NULL, 
  `bindport` varchar(10) DEFAULT NULL, 
  `bindaddr` varchar(10) DEFAULT NULL, 
  `action` varchar(10) DEFAULT NULL, 
  `count` int NOT NULL,   
  `updated_time` bigint NOT NULL, 
  PRIMARY KEY (`id`)  
);

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions