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

Activity: Running a Web Server after Content Preparation

Scenario

You are assigned the task of making a Kubernetes installation for a web server. However, there are some manual tasks to be carried out to change the files before serving them. You need to ensure that changes are always applied before the content is served. Besides this, show the status of the initialization and check the final output of the web server.

Aim

With the successful deployment, there should be a pod running in Kubernetes with one main container and one initialization container. In the initialization container, write Welcome from Packt to the main index file. This file should be served by the main container when started.

Prerequisites

  • Use a basic Docker image for the initialization container, such as busybox.
  • For the main container, a web server capable image should be used, such as nginx.

Steps for Completion

  1. Create a pod definition.
  2. Include one initialization container:
    • Change the content of the files.
  3. Include one main container:
    • Create a web server.
  4. Deploy the pod.
  5. Check the status of the initialization container.
  6. Check the output of the web server.

You should see the following output:


All of the code files for the activities in this chapter are provided on GitHub in the Lesson-1 folder at https://goo.gl/gM8W3p.

主站蜘蛛池模板: 嘉鱼县| 监利县| 龙游县| 紫阳县| 田阳县| 吕梁市| 余江县| 万州区| 德令哈市| 晋中市| 开远市| 克东县| 阿克陶县| 太仓市| 伊宁县| 寻乌县| 古丈县| 博罗县| 龙口市| 宁蒗| 资中县| 平远县| 澜沧| 苍梧县| 于田县| 阿拉善盟| 韶山市| 通河县| 苏尼特左旗| 宁陵县| 永胜县| 华池县| 河东区| 邮箱| 普宁市| 钟山县| 阳谷县| 敦化市| 津市市| 红安县| 乌拉特前旗|