-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from eslam-gomaa/feat/add-custom-commands-feature
custom commands feature: done
- Loading branch information
Showing
10 changed files
with
1,029 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
command: | ||
name: Pods Info | ||
description: Kubernetes Pods info of a specific namespace | ||
|
||
variables: | ||
- name: pod | ||
default: .* | ||
cliArgument: | ||
enable: true | ||
short: -po | ||
required: false | ||
- name: namespace | ||
default: default | ||
cliArgument: | ||
enable: true | ||
short: -n | ||
required: false | ||
|
||
execute: | ||
type: advancedTable | ||
columns: | ||
- memory usage: | ||
metric: | | ||
sort_desc(sum(container_memory_usage_bytes{namespace=~"$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone)) | ||
metricUnit: byte | ||
- memory usage %: | ||
metric: | | ||
sort_desc( | ||
( | ||
sum(container_memory_usage_bytes{namespace=~"$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone) | ||
/ | ||
sum(container_spec_memory_limit_bytes{namespace=~"$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone) | ||
) * 100 | ||
) | ||
metricUnit: percentage | ||
- memory limit: | ||
metric: | | ||
sort_desc(sum(container_spec_memory_limit_bytes{namespace=~"$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone)) | ||
metricUnit: byte | ||
- memory cache: | ||
metric: | | ||
sort_desc(sum(container_memory_cache{namespace=~"$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone)) | ||
metricUnit: byte | ||
- memory swap: | ||
metric: | | ||
sum(container_memory_swap{namespace=~"$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone) | ||
metricUnit: byte | ||
- memory max usage: | ||
metric: | | ||
sum(container_memory_max_usage_bytes{namespace=~"$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone) | ||
metricUnit: byte | ||
- file descriptors: | ||
metric: | | ||
sort_desc(sum(container_file_descriptors{namespace=~"$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone)) | ||
metricUnit: counter | ||
- up time: | ||
metric: | | ||
sum(time() - kube_pod_start_time{namespace=~"$namespace", pod=~"$pod"}) by (pod) | ||
metricUnit: seconds | ||
custom_key: "{{pod}}" # "{{pod}} - {{topology_ebs_csi_aws_com_zone}}" | ||
advancedTableOptions: | ||
tableType: plain # https://github.com/astanin/python-tabulate?tab=readme-ov-file#table-format | ||
headersUppercase: true | ||
autoConvertValue: true | ||
showTableIndex: false | ||
updateIntervalSeconds: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
command: | ||
name: Pods Info | ||
description: Kubernetes Pods info of a specific namespace | ||
|
||
# variables: | ||
# - name: topic | ||
# default: .* | ||
# cliArgument: | ||
# enable: true | ||
# short: -T | ||
# required: true | ||
|
||
variables: | ||
- name: pod | ||
default: .* | ||
cliArgument: | ||
enable: true | ||
short: -po | ||
required: false | ||
- name: namespace | ||
default: default | ||
cliArgument: | ||
enable: true | ||
short: -n | ||
required: false | ||
|
||
execute: | ||
type: advancedTable | ||
columns: | ||
- memory usage: | ||
metric: | | ||
sort_desc(sum(container_memory_usage_bytes{namespace="$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone)) | ||
metricUnit: byte | ||
- memory usage %: | ||
metric: | | ||
sort_desc( | ||
( | ||
sum(container_memory_usage_bytes{namespace="$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone) | ||
/ | ||
sum(container_spec_memory_limit_bytes{namespace="$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone) | ||
) * 100 | ||
) | ||
metricUnit: percentage | ||
- memory limit: | ||
metric: | | ||
sort_desc(sum(container_spec_memory_limit_bytes{namespace="$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone)) | ||
metricUnit: byte | ||
- memory cache: | ||
metric: | | ||
sort_desc(sum(container_memory_cache{namespace="$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone)) | ||
metricUnit: byte | ||
- memory swap: | ||
metric: | | ||
sum(container_memory_swap{namespace="$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone) | ||
metricUnit: byte | ||
- memory max usage: | ||
metric: | | ||
sum(container_memory_max_usage_bytes{namespace="$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone) | ||
metricUnit: byte | ||
- file descriptors: | ||
metric: | | ||
sort_desc(sum(container_file_descriptors{namespace="$namespace", pod=~"$pod"}) by (pod, topology_ebs_csi_aws_com_zone)) | ||
metricUnit: counter | ||
- up time: | ||
metric: | | ||
sum(time() - kube_pod_start_time{namespace="$namespace", pod=~"$pod"}) by (pod) | ||
metricUnit: seconds | ||
custom_key: "{{pod}}" # "{{pod}} - {{topology_ebs_csi_aws_com_zone}}" | ||
advancedTableOptions: | ||
tableType: plain # https://github.com/astanin/python-tabulate?tab=readme-ov-file#table-format | ||
headersUppercase: true | ||
autoConvertValue: true | ||
showTableIndex: false | ||
updateIntervalSeconds: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.