Setting the Startup Script of a Node

Last updated: 2020-04-26 16:40:45

    Scenario

    The startup script of a node can help you initialize the node before the node becomes ready. The configured script is executed when the node starts. If you purchase multiple CVM instances at a time, the custom data will run on all of them.

    Use Limits

    • Do not modify configurations such as those for kubelet, kube-proxy, and docker on the TKE node in the startup script.
    • If the startup script fails to be executed, it will not be executed again. Therefore, you must ensure the executability of the script or ensure that a retry mechanism is available.
    • You can view the script and its log file in the /usr/local/qcloud/tke/userscript path of the node.

    Directions

    You can configure the startup script for a node in the following scenarios:

    Configuring the node startup script when creating a cluster or a node

    • When creating a cluster, click Advanced Settings on the "CVM Configuration" page and complete custom data as a startup script, as shown in the following figure:
    • When adding a node, click Advanced Settings on the "CVM Configuration" page and complete custom data as a startup script, as shown in the following figure:

    Configuring the node startup script when adding an existing node

    • When adding an existing node, click Advanced Settings on the "CVM Configuration" page and complete custom data as a startup script, as shown in the following figure:

    Configuring the node startup script when creating a scaling group

    • When creating a scaling group, click Advanced Settings on the "Launch Configuration" page and complete custom data as a startup script, as shown in the following figure:

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help