steampipe schedule

This commit is contained in:
havelight-ee
2023-06-02 13:15:07 +09:00
parent d586497878
commit 3b84184b1d
2 changed files with 58 additions and 60 deletions

View File

@@ -34,8 +34,6 @@ __query_exec (){
__log_sed (){
sed -i 's/+/|/g' ${exec_log}
sed -i "s/node-role.kubernetes.io\///g" ${exec_log}
sed -i "s/31/32/g" ${exec_log}
sed -i "s/62/64/g" ${exec_log}
sed -i '1d;$d' ${exec_log}
}
#------------------------------------------------------------------------------------------------------
@@ -46,7 +44,7 @@ SELECT
COALESCE(taints -> 0 ->> 'key', '-') AS Taints_key,
COALESCE(tags ->> 'kops.k8s.io/instancegroup', '-') AS Instance_group,
capacity ->> 'cpu' AS CPU,
CEIL((CAST(regexp_replace(capacity ->> 'memory', 'Ki', '') AS DECIMAL) / POWER(2, 20))) AS Memory,
CEIL((CAST(regexp_replace(capacity ->> 'memory', 'Ki', '') AS FLOAT) / 1024 / 1024)) AS Memory,
tags ->> 'topology.kubernetes.io/zone' AS Zone,
tags ->> 'beta.kubernetes.io/instance-type' AS Instance_type,
node_info ->> 'osImage' AS OS,
@@ -111,7 +109,7 @@ FROM
kubernetes_service,
jsonb_array_elements(ports) as p
WHERE
type='NodePort' AND
type='NodePort'
ORDER BY
Node_Port
"""