ansible v2 (release 3.4.9)

This commit is contained in:
havelight-ee
2023-02-16 16:20:12 +09:00
parent 7f08fdd9ff
commit 59a199e50f
3525 changed files with 435537 additions and 62726 deletions

View File

@@ -6,6 +6,7 @@ namespace=$1
export ES_NODEPORT=`kubectl -n ${namespace} get svc elasticsearch -o jsonpath='{.spec.ports[*].nodePort}'`
export MASTER_IP=`kubectl get node -o wide | grep control-plane | awk '{print $6}'`
echo $MASTER_IP
export NUM_SHARDS=2
export NUM_REPLICAS=1
@@ -2097,7 +2098,7 @@ curl $PARAM -X PUT $PROTO'://'"${MASTER_IP}"':'"${ES_NODEPORT}"'/_template/jspd_
"type": "text",
"fields": {
"keyword": {
"ignore_above": 102400,
"ignore_above": 32766,
"type": "keyword"
}
}
@@ -2641,7 +2642,7 @@ curl $PARAM -X PUT $PROTO'://'"${MASTER_IP}"':'"${ES_NODEPORT}"'/_template/jspd_
"type": "text",
"fields": {
"keyword": {
"ignore_above": 102400,
"ignore_above": 32766,
"type": "keyword"
}
}

View File

@@ -0,0 +1,6 @@
#!/bin/bash
namespace=$1
pg_pod=`kubectl -n ${namespace} get pod --no-headers | awk '{print $1}' | grep postgres`
kubectl_cmd="kubectl -n ${namespace} exec -it ${pg_pod} --"
${kubectl_cmd} bash -c "echo \"select count(*) from pg_database where datname='keycloak';\" | /usr/bin/psql -U postgres | egrep -iv '(count|---|row)' | tr -d ' ' | tr -d '\n'"

View File

@@ -119,6 +119,8 @@ INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|St
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Statistics & Analysis|Alert Analysis', false, null);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Statistics & Analysis|Container Life Cycle', false, null);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Statistics & Analysis|Service Traces', false, null);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Statistics & Analysis|Log Viewer|Node', false, null);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Statistics & Analysis|Log Viewer|Pod', false, null);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Reports|Documents', false, null);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Reports|Templates', false, null);
@@ -134,7 +136,8 @@ INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Se
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Settings|Agent', false, null);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Settings|Alias', false, null);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Settings|Agent Installation', false, NULL);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Settings|Sparse Logs|Node', false, null);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Settings|Sparse Logs|Container', false, null);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Dashboards|Documents', false, null);
INSERT INTO public.auth_resource3 (name, is_deleted, tenant_id) VALUES ('menu|Dashboards|Templates', false, null);
@@ -207,6 +210,8 @@ INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resou
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (48, 'eventLog Analysis', NULL, 8, 'eventLogSA', (select id from auth_resource3 where name='menu|Statistics & Analysis|Event Logs'), 2);
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (49, 'Container Life Cycle', NULL, 9, 'containerLifecycleSA', (select id from auth_resource3 where name='menu|Statistics & Analysis|Container Life Cycle'), 2);
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (50, 'Service Trace Analysis', NULL, 10, 'serviceTraceSA', (select id from auth_resource3 where name='menu|Statistics & Analysis|Service Traces'), 0);
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (51, 'Log Viewer(Node)', NULL, 11, '', (select id from auth_resource3 where name='menu|Statistics & Analysis|Log Viewer|Node'), 0);
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (52, 'Log Viewer(Pod)', NULL, 12, '', (select id from auth_resource3 where name='menu|Statistics & Analysis|Log Viewer|Pod'), 0);
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (60, 'Reports', '07.Report', 6, NULL, (select id from auth_resource3 where name='menu|Reports'), 2);
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (61, 'Documents', NULL, 0, 'documentReport', (select id from auth_resource3 where name='menu|Reports|Documents'), 2);
@@ -236,6 +241,8 @@ INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resou
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (100, 'Alias', NULL, 9, 'aliasSettings', (select id from auth_resource3 where name='menu|Settings|Alias'), 2);
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (101, 'License', NULL, 10, 'validationLicense', (select id from auth_resource3 where name='menu|Settings|License'), 2);
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (102, 'agent Installation', NULL, 11, 'agentInstallationSettings', (select id from auth_resource3 where name='menu|Settings|Agent Installation'), 2);
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (103, 'Sparse Logs(Node)', NULL, 12, '', (select id from auth_resource3 where name='menu|Settings|Sparse Logs|Node'), 0);
INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (104, 'Sparse Logs(Container)', NULL, 13, '', (select id from auth_resource3 where name='menu|Settings|Sparse Logs|Container'), 0);
-- INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (121, 'Health Check', '09.HealthCheck', 9, 'healthCHeck', (select id from auth_resource3 where name='menu|Health Check'), 0);
-- INSERT INTO public.menu_meta (id, description, icon, "position", url, auth_resource3_id, scope_level) VALUES (122, 'Check Script', NULL, 0, 'checkScript', (select id from auth_resource3 where name='menu|Health Check|Check Script'), 0);
@@ -1059,7 +1066,7 @@ label_replace( rate(cassandra_keyspace_writelatency_seconds_count [1m]), "type",
INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('oracledb_lock_total','Oracledb lock total','oracledb lock total','sum by (xm_clst_id, xm_namespace, xm_node_id, instance, resource_name)
(oracledb_resource_current_utilization{resource_name =~''.+_locks''})','Resource','OracleDB','resource_name',true,false,'oracledb lock total','2020-01-29 11:17:01.000','2020-02-13 01:34:00.720');
INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('imxc_service_http_requests_per_sec_by_api','Service HTTP Requests Count by API (per Second)','the number of HTTP requests counts per second by API','(sum by (xm_clst_id,xm_service_name,xm_entity_type,xm_namespace,api) (rate(imxc_service_request_milliseconds_count{xm_entity_type="Service",protocol="http",{filter}}[1m])) / on (xm_clst_id, xm_namespace, xm_service_name ) group_left imxc_sampling_param_value) or (sum by (xm_clst_id,xm_service_name,xm_entity_type,xm_namespace,api) (rate(imxc_service_request_milliseconds_count{xm_entity_type="Service",protocol="http",{filter}}[1m])) / on (xm_clst_id) group_left imxc_sampling_default_param_value)','Request','Service',NULL,false,false,'not for alarm','2020-02-18 12:12:12.000','2020-06-03 06:52:05.498');
INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('host_cpu_core_count','Host CPU Core Count','Host_cpu_capacity_cores','count without(cpu, mode) (node_cpu_seconds_total{{filter}})','CPU','Host',NULL,true,false,'None','2020-03-23 04:08:05.290','2020-03-23 04:08:05.290');
INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('host_cpu_core_count','Host CPU Core Count','Host_cpu_capacity_cores','count without(cpu, mode) (node_cpu_seconds_total{mode=''idle'', {filter}})','CPU','Host',NULL,true,false,'None','2020-03-23 04:08:05.290','2020-03-23 04:08:05.290');
INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('host_load5','Host CPU Load 5m Average','Host CPU 5m load average','node_load5{{filter}}','CPU','Host',NULL,true,false,'Host:{{$labels.instance}} CPU 5m Load Average:{{humanize $value}}%|{threshold}$.','2020-03-23 04:08:11.655','2020-03-23 04:08:11.655');
INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('pod_phase_count_by_cluster','Pod Phase Count by Cluster','pod phase count by cluster','count by(xm_clst_id, pod_state) (sum by (xm_clst_id, xm_pod_id, pod_state)(rate(imxc_kubernetes_container_resource_limit_cpu{{filter}}[1m])))','Cluster','Pod',NULL,true,false,'CLST:{{$labels.xm_clst_id}} pod phase count:{{humanize $value}}|{threshold}.','2020-08-19 16:45:00.000','2020-08-19 16:45:00.000');
INSERT INTO public.metric_meta2 (id,meta_name,description,expr,resource_type,entity_type,groupby_keys,in_use,anomaly_score,message,created_date,modified_date) VALUES ('host_network_io_byte','host network io byte','host network io byte','sum by (data_type, instance) (

View File

@@ -0,0 +1,31 @@
#!/bin/bash
if [ -z "$BASH_VERSION" ]; then exec bash "$0" "$@"; exit; fi
namespace=$1
if [[ ${namespace} == "" ]]; then
echo "[Usage] $0 <NAMESAPCE>"
exit
fi
pg_check=`sh postgres_check_data imxc`
if [[ ${pg_check} == 1 ]]; then
echo "pg data already!"
exit
fi
echo "pg data insert start"
postgres=`kubectl get pods -n ${namespace} | grep postgres | awk '{print $1}'`
kubectl -n ${namespace} wait --for=condition=ready pod/${postgres} --timeout=1200s
kubectl cp postgres_insert_ddl.psql ${postgres}:/postgres_insert_ddl.psql -n ${namespace}
kubectl cp postgres_insert_dml.psql ${postgres}:/postgres_insert_dml.psql -n ${namespace}
kubectl exec -it ${postgres} -n ${namespace} -- bash -c "PGPASSWORD='eorbahrhkswp' && /usr/bin/psql -h 'localhost' -U 'admin' -d 'postgresdb' -f /postgres_insert_ddl.psql"
kubectl exec -it ${postgres} -n ${namespace} -- bash -c "PGPASSWORD='eorbahrhkswp' && /usr/bin/psql -h 'localhost' -U 'admin' -d 'postgresdb' -f /postgres_insert_dml.psql"