To create a global TCP health check "tcp-health-check", run:
gdcloud compute health-checks create tcp tcp-health-check \
--port=8080 \
--global
To create a zonal TCP health check "tcp-health-check", run:
gdcloud compute health-checks create tcp tcp-health-check \
--port=8080
INDICATEURS FACULTATIFS
--check-interval int Amount of time in seconds from the start of one probe to the start of the next one. Defaults to 5. (default 5)
--global If set, the global health check object is created.
--healthy-threshold int Number of sequential probes that must succeed for the endpoint to be considered healthy. Defaults to 2. (default 2)
--port int Port to use for the health check. If not specified, the backend service's port is used.
--timeout int Time (in seconds) to wait before claiming failure. Defaults to 5. (default 5)
--unhealthy-threshold int Number of sequential probes that must fail for the endpoint to be considered unhealthy. Defaults to 2. (default 2)
--zone string Zone to use for this invocation. To preset the zone flag for all commands that require it, run: "gdcloud config set core/zone ZONE". The zone flag is available only in multi-zone environments.
OPTIONS GCLOUD GÉNÉRALES
Ces options sont disponibles pour toutes les commandes : --configuration, --format, --help, --project, --quiet.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eThe command \u003ccode\u003egdcloud compute health-checks create tcp\u003c/code\u003e is used to create a TCP health check for a load balancer.\u003c/p\u003e\n"],["\u003cp\u003eYou can create both global and zonal TCP health checks by using the \u003ccode\u003e--global\u003c/code\u003e flag, or omitting it, respectively.\u003c/p\u003e\n"],["\u003cp\u003eOptional flags like \u003ccode\u003e--check-interval\u003c/code\u003e, \u003ccode\u003e--healthy-threshold\u003c/code\u003e, \u003ccode\u003e--port\u003c/code\u003e, \u003ccode\u003e--timeout\u003c/code\u003e, and \u003ccode\u003e--unhealthy-threshold\u003c/code\u003e allow customization of the health check's behavior.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e--port\u003c/code\u003e flag specifies the port for the health check, defaulting to the backend service's port if not specified.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e--zone\u003c/code\u003e flag is available in multi-zone environments to specify the zone for the health check, and the command includes gdcloud wide flags that are available to all commands.\u003c/p\u003e\n"]]],[],null,["# gdcloud compute health-checks create tcp\n\nNAME\n----\n\ngdcloud compute health-checks create tcp - Create TCP health check for a load balancer.\n\nSYNOPSIS\n--------\n\n gdcloud compute health-checks create tcp HEALTH_CHECK_NAME [flags]\n\n### EXAMPLES\n\n To create a global TCP health check \"tcp-health-check\", run:\n\n gdcloud compute health-checks create tcp tcp-health-check \\\n --port=8080 \\\n --global\n\n To create a zonal TCP health check \"tcp-health-check\", run:\n\n gdcloud compute health-checks create tcp tcp-health-check \\\n --port=8080\n\n### OPTIONAL FLAGS\n\n --check-interval int Amount of time in seconds from the start of one probe to the start of the next one. Defaults to 5. (default 5)\n --global If set, the global health check object is created.\n --healthy-threshold int Number of sequential probes that must succeed for the endpoint to be considered healthy. Defaults to 2. (default 2)\n --port int Port to use for the health check. If not specified, the backend service's port is used.\n --timeout int Time (in seconds) to wait before claiming failure. Defaults to 5. (default 5)\n --unhealthy-threshold int Number of sequential probes that must fail for the endpoint to be considered unhealthy. Defaults to 2. (default 2)\n --zone string Zone to use for this invocation. To preset the zone flag for all commands that require it, run: \"gdcloud config set core/zone ZONE\". The zone flag is available only in multi-zone environments.\n\n### GDCLOUD WIDE FLAGS\n\nThese flags are available to all commands: `--configuration`, `--format`, `--help`, `--project`, `--quiet`.\n\nFor more information, see the [gdcloud CLI reference overview](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-reference/gdcloud) page."]]