|
37 | 37 | logger.setLevel(logging.INFO) |
38 | 38 | LOGGER_FORMAT = '%(asctime)s - %(levelname)s - %(message)s' |
39 | 39 | logging.basicConfig(format=LOGGER_FORMAT) |
40 | | -VERSION_LOG_COLLECTOR = "7.4.6-6" |
| 40 | +VERSION_LOG_COLLECTOR = "7.4.6-2" |
41 | 41 |
|
42 | 42 | TIME_FORMAT = time.strftime("%Y%m%d-%H%M%S") |
43 | 43 |
|
@@ -1420,44 +1420,40 @@ def check_not_negative(value): |
1420 | 1420 | if __name__ == "__main__": |
1421 | 1421 |
|
1422 | 1422 | # pylint: disable=locally-disabled, invalid-name |
1423 | | - parser = argparse.ArgumentParser(description='Redis Enterprise Log Collector for Kubernetes\n\n' |
1424 | | - 'For additional details and usage instructions, see ' |
1425 | | - 'https://redis.io/docs/latest/operate/kubernetes/logs/collect-logs/', |
1426 | | - formatter_class=argparse.RawTextHelpFormatter) |
| 1423 | + parser = argparse.ArgumentParser(description='Redis Enterprise' |
| 1424 | + ' K8s log collector') |
1427 | 1425 |
|
1428 | 1426 | parser.add_argument('-n', '--namespace', action="store", type=str, |
1429 | | - help="Sets the namespace(s) to collect from.\n" |
1430 | | - "Can be set to a single namespace, multiple namespaces (comma-separated), or 'all'.\n" |
1431 | | - "When left empty, will use the current context's namespace from kubeconfig.") |
1432 | | - parser.add_argument('-o', '--output_dir', action="store", type=str, |
1433 | | - help="Sets the output directory.\n" |
1434 | | - "Defaults to current working directory.") |
| 1427 | + help="pass namespace name or comma separated list or 'all' " |
| 1428 | + "when left empty will use namespace from kube config") |
| 1429 | + parser.add_argument('-o', '--output_dir', action="store", type=str) |
1435 | 1430 | parser.add_argument('-a', '--logs_from_all_pods', action="store_true", |
1436 | | - help="Collect logs from all pods in the selected namespace(s),\n" |
1437 | | - "and otherwise collect only from the operator and pods run by the operator.") |
| 1431 | + help="collect logs from all pods, not only the operator and pods run by the operator") |
1438 | 1432 | parser.add_argument('-t', '--timeout', action="store", |
1439 | 1433 | type=check_not_negative, default=TIMEOUT, |
1440 | | - help="Time to wait for external commands to finish execution (Linux only).\n" |
1441 | | - "Default to 180s. Specify 0 to disable timeout.") |
| 1434 | + help="time to wait for external commands to " |
| 1435 | + "finish execution " |
| 1436 | + "(default: 180s, specify 0 to not timeout) " |
| 1437 | + "(Linux only)") |
1442 | 1438 | parser.add_argument('--k8s_cli', action="store", type=str, |
1443 | | - help="The K8s cli client to use (kubectl/oc/auto-detect).\n" |
1444 | | - "Defaults to auto-detect (chooses between 'kubectl' and 'oc').\n" |
| 1439 | + help="Which K8s cli client to use (kubectl/oc/auto-detect). " |
| 1440 | + "Defaults to auto-detect (chooses between \"kubectl\" and \"oc\"). " |
1445 | 1441 | "Full paths can also be used.") |
1446 | 1442 | parser.add_argument('-m', '--mode', action="store", type=str, |
1447 | 1443 | choices=[MODE_RESTRICTED, MODE_ALL], |
1448 | | - help="Controls which resources are collected:\n" |
1449 | | - "In 'restricted' mode, only resources associated with the operator " |
1450 | | - "and have the label 'app=redis-enterprise' are collected.\n" |
1451 | | - "In 'all' mode, all resources are collected.\n" |
1452 | | - "Defaults to 'restricted' mode.") |
| 1444 | + help="Which mode to run the log collector. The options are:" |
| 1445 | + "1. restricted (default for clusters of version 6.2.18 and newer) - " |
| 1446 | + "collect only resources that are related to the operator," |
| 1447 | + " and has the label \"app=redis-enterprise\". " |
| 1448 | + "2. all - collect all resources") |
1453 | 1449 | parser.add_argument('--collect_istio', action="store_true", |
1454 | | - help="Collect data from istio-system namespace to debug potential\n" |
1455 | | - "problems related to istio ingress method.") |
| 1450 | + help="collect data from istio-system namespace to debug potential " |
| 1451 | + "problems related to istio ingress method") |
1456 | 1452 | parser.add_argument('--skip_support_package', action="store_true", |
1457 | | - help="Disable collection of RS support package from Redis Enterprise nodes.") |
| 1453 | + help="not collect RS support package") |
1458 | 1454 | parser.add_argument('--collect_empty_files', action="store_true", |
1459 | | - help='Collect empty log files for missing resources.') |
| 1455 | + help='collect empty log files for missing resources') |
1460 | 1456 | parser.add_argument('--helm_release_name', action="store", type=str, |
1461 | | - help='Collect resources related to the given Helm release name.') |
| 1457 | + help='collect resources related to helm release name') |
1462 | 1458 | parser.set_defaults(collect_istio=False) |
1463 | 1459 | run(parser.parse_args()) |
0 commit comments