Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log Persistent Volumes capacity #7677

Merged
merged 10 commits into from Mar 20, 2020
Merged

Log Persistent Volumes capacity #7677

merged 10 commits into from Mar 20, 2020

Conversation

franpog859
Copy link
Contributor

@franpog859 franpog859 commented Mar 18, 2020

Description

Changes proposed in this pull request:

  • Make Runtime Agent log capacity of the Persistent Volumes from the cluster
See the JSON schema of the log
{
   "type":"object",
   "properties":{
      "clusterInfo":{
         "type":"object",
         "title":"Cluster info.",
         "properties":{
            "resources":{
               "type":"array",
               "title":"List of nodes resources.",
               "items":[
                  {
                     "type":"object",
                     "properties":{
                        "nodeName":{
                           "type":"string",
                           "title":"Name of the Node. Example: minikube"
                        },
                        "instanceType":{
                           "type":"string",
                           "title":"Instance type. Example: n1-standard-4"
                        },
                        "capacity":{
                           "type":"object",
                           "title":"Total resources of the Node.",
                           "properties":{
                              "cpu":{
                                 "type":"string",
                                 "title":"CPU limit if specified. Example: 4"
                              },
                              "ephemeralStorage":{
                                 "type":"string",
                                 "title":"Local ephemeral storage. Example: 25497928Ki"
                              },
                              "memory":{
                                 "type":"string",
                                 "title":"Memory limit if specified. Example: 8163684Ki"
                              },
                              "pods":{
                                 "type":"string",
                                 "title":"Number of Pods. Example: 110"
                              }
                           },
                           "required":[
                              "cpu",
                              "ephemeralStorage",
                              "memory",
                              "pods"
                           ]
                        }
                     },
                     "required":[
                        "nodeName",
                        "instanceType",
                        "capacity"
                     ]
                  }
               ]
            },
            "usage":{
               "type":"array",
               "title":"List of NodeMetrics.",
               "items":[
                  {
                     "type":"object",
                     "properties":{
                        "nodeName":{
                           "type":"string",
                           "title":"Node name. Example: gke-aaaaaa-default-pool-aaaaaaaa-aaaa"
                        },
                        "startCollectingTimestamp":{
                           "type":"string",
                           "title":"Timestamp from when metrics are collected. Example: 2020-02-12T13:33:52.39459378Z"
                        },
                        "usage":{
                           "type":"object",
                           "title":"Memory usage which is the memory working set.",
                           "properties":{
                              "cpu":{
                                 "type":"string",
                                 "title":"CPU limit if specified. Example: 760412892n"
                              },
                              "ephemeralStorage":{
                                 "type":"string",
                                 "title":"DEPRECATED. It is always set to 0"
                              },
                              "memory":{
                                 "type":"string",
                                 "title":"Memory limit if specified. Example: 8163684Ki"
                              },
                              "pods":{
                                 "type":"string",
                                 "title":"DEPRECATED. It is always set to 0"
                              }
                           },
                           "required":[
                              "cpu",
                              "ephemeralStorage",
                              "memory",
                              "pods"
                           ]
                        }
                     },
                     "required":[
                        "nodeName",
                        "startCollectingTimestamp",
                        "usage"
                     ]
                  }
               ],
               "persistentVolumes":{
                  "type":"array",
                  "title":"List of PersistentVolumes.",
                  "items":[
                     {
                        "type":"object",
                        "properties":{
                           "name":{
                              "type":"string",
                              "title":"PersistentVolume name. Example: pvc-aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
                           },
                           "capacity":{
                              "type":"string",
                              "title":"PersistentVolume size in bytes. Example: 10Gi"
                           },
                           "claim":{
                              "type":"object",
                              "title":"Binding between PersistentVolume and PersistentVolumeClaim.",
                              "properties":{
                                 "name":{
                                    "type":"string",
                                    "title":"PersistentVolumeClaim name. Example: data-ory-postgresql-0"
                                 },
                                 "namespace":{
                                    "type":"string",
                                    "title":"PersistentVolumeClaim namespace. Example: kyma-system"
                                 }
                              },
                              "required":[
                                 "name",
                                 "namespace"
                              ]
                           }
                        },
                        "required":[
                           "name",
                           "capacity"
                        ]
                     }
                  ]
               }
            }
         },
         "required":[
            "resources",
            "usage",
            "persistentVolumes"
         ]
      },
      "level":{
         "type":"string",
         "title":"Log level. Example: info"
      },
      "metrics":{
         "type":"boolean",
         "title":"The FluentBit matcher. Example: true"
      },
      "msg":{
         "type":"string",
         "title":"Log message. Example: Cluster metrics logged successfully."
      },
      "time":{
         "type":"string",
         "title":"Time of the log. Example: 2020-02-12T13:33:52.39459378Z"
      }
   },
   "required":[
      "clusterInfo",
      "level",
      "metrics",
      "msg",
      "time"
   ]
}
See the log example
{
   "clusterInfo":{
      "resources":[
         {
            "nodeName":"somename",
            "instanceType":"somelabel",
            "capacity":{
               "cpu":"1",
               "ephemeralStorage":"1",
               "memory":"1",
               "pods":"1"
            }
         }
      ],
      "persistentVolumes":[
         {
            "name":"somename",
            "capacity":"1",
            "claim":{
               "name":"somename",
               "namespace":"somenamespace"
            }
         }
      ],
      "usage":[
         {
            "nodeName":"somename",
            "startCollectingTimestamp":"2020-02-28T15:39:44.885369+01:00",
            "usage":{
               "cpu":"1",
               "ephemeralStorage":"1",
               "memory":"1",
               "pods":"1"
            }
         }
      ]
   },
   "level":"info",
   "metrics":true,
   "msg":"Cluster metrics logged successfully.",
   "time":"2020-02-28T15:39:44+01:00"
}

@franpog859 franpog859 added kind/feature Categorizes issue or PR as related to a new feature. WIP area/logging Issues or PRs related to the logging module (deprecated) area/management-plane Related to all activities around Management Plane labels Mar 18, 2020
@franpog859 franpog859 added this to the Sprint_Framefrog_27 milestone Mar 18, 2020
@franpog859 franpog859 self-assigned this Mar 18, 2020
@netlify
Copy link

netlify bot commented Mar 18, 2020

🥰 Documentation preview ready! 🥰

Built with commit d88cccb

https://deploy-preview-7677--kyma-project-docs-preview.netlify.com

@franpog859
Copy link
Contributor Author

/test pre-kyma-components-compass-runtime-agent

@franpog859
Copy link
Contributor Author

/test pre-master-kyma-gke-upgrade

Copy link
Contributor

@rafalpotempa rafalpotempa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions consulted. Looks good :)

@franpog859 franpog859 merged commit 974770d into kyma-project:master Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging Issues or PRs related to the logging module (deprecated) area/management-plane Related to all activities around Management Plane kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants