Container Lifecycle
Setting Container Lifecycle Parameters
Based on Kubernetes, CCI provides containers with lifecycle hooks. The hooks enable containers to run code triggered by events during their management lifecycle. For example, if you want a container to perform a certain operation before it is stopped, you can register a hook. The following lifecycle hooks are provided:
- Post-Start Processing: triggered immediately after the container is started
- Pre-Stop Processing: triggered immediately before the container is stopped
Currently, CCI supports only hook handlers of the Exec type, which execute a specific command.
During workload creation, expand the Advanced Settings area, and click the Post-Start Processing or Pre-Stop Processing tab in the Lifecycle area.
For example, if you want to run the /postStart.sh all command in the container, configure data on the page as shown in the following figure. The first row indicates the script name and the second row indicates a parameter setting.
Setting Container Lifecycle Parameters Using kubectl
For details, see Lifecycle Management.
Last Article: Setting Container Startup Commands
Next Article: Setting Health Check Parameters
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.