官术网_书友最值得收藏!

Initialization Pattern

Initialization is a widespread pattern in every part of software engineering, including programming languages and operating systems. In order to handle the initialization of an application in Kubernetes, initialization containers are proposed. Initialization containers, namely initContainers, are part of a pod's definition. Separation of concerns is handled by separating the life cycles of containers:

  • Init containers
  • Main containers

Containers that are defined as initContainers are executed for completion one by one, and they are all expected to exit successfully. After successful completion, the main containers are started. Some of the example uses of startup containers are as follows:

  • To create configuration files
  • To wait and ensure dependency services are available
  • To create volumes and prepare files
  • To register services to discovery systems

In the following activity, a web server will be installed in Kubernetes. As expected, there should be at least one container running the web server. However, there is an additional requirement of changing the served files before the web server starts. The life cycle of these operations is separated into the initialization container and the main container. These containers could have different container images and executables; however, they are expected to work on a shared resource. Life cycle separation and working together issues are handled in the following activity, and the initialization pattern is implemented in Kubernetes.

主站蜘蛛池模板: 宝清县| 乃东县| 大连市| 夏邑县| 盐池县| 若羌县| 始兴县| 临泉县| 扬州市| 肇东市| 天津市| 普宁市| 万全县| 太白县| 宁海县| 惠州市| 浏阳市| 兴义市| 呼伦贝尔市| 家居| 扬州市| 宾阳县| 云浮市| 玉山县| 白沙| 永昌县| 福泉市| 洪湖市| 永川市| 高邮市| 汾阳市| 永清县| 宣汉县| 甘南县| 通渭县| 喀喇| 襄城县| 北海市| 开江县| 夏河县| 花莲市|