iT邦幫忙

2019 iT 邦幫忙鐵人賽

DAY 2
0
Cloud Native

30 天準備 LPI DevOps Tools Engineer 證照系列 第 2

[Day 02] LPI DevOps Tools Engineer 證照介紹 (2)

在開始之前,我想先說明一下這三十天可能的進行方式:

  1. 我自己不是一個有實務經驗的 DevOps 人員,對於接下來要介紹的這些工具,雖然有一些曾使用過,但也還沒到熟悉的程度,因此與其說是工具的介紹教學或實務的經驗分享,更不如說是且戰且走的學習記錄,摸索試驗的過程分享。
  2. 這類的學習記錄或技術分享,對比原始程式碼或是官方文件,都算是二三手的資訊,即使資料來源都是官方文件,多多少少還是會有誤「譯」或誤「義」的狀況,尤其當自身語文能力或是技術能力不足時,這樣的錯誤更是會經常發生。關於這點,我的想法是,在有疑慮的地方,我會寫明這裡「可能」是這樣。雖然會盡量確保自己所寫的內容是正確的,但在三十天的挑戰過程中,難免會有時間不夠以致於胡亂發文的狀況,這點還請有機會看到這系列文章的夥伴多多見諒。
  3. 我自己覺得 IT 人還挺自虐的,新的技術一直推陳出新,很多時候並不是因為工作得用到而去學習它們,而是興趣使然,或是想給自己一個挑戰,又或者只是覺得自己應該要會。然而因為工作上用不到,所以學了之後很快就忘記了,然後等之後真的要用到時,一切又要重頭開始。因此在這種狀況下,我覺得學習的重點不是在學到很深很細,記得很多指令,而是知道有這個工具存在,它是為了解決什麼問題而發展出來的,大致上的原理概念是什麼,大概有那些功能可以用,然後最重要的一點,是把這些要點在自己的知識庫中記錄下來,如果可以加上自己的思考脈絡就更好。如果只是要知道工具怎麼用、指令怎麼下,網路上已經有很多詳盡的教學文件了,自己的學習記錄,和其他人的網路教學文件,最大的差異,在於自我學習會有自己思路發展的過程。把這些思考過程也記錄下來,當下次有機會要用到時,就可以順著自己的思考脈絡,很快地在知識庫中取出,而不必每次都重頭來過。這表示我接下來的分享,可能會有很多自己的碎碎念,也請大家多多包涵。

接下來回到今天的主題,工具介紹的部分。LPI 網站對於此認證有另一份指引文件 (Exam Guide) http://www.lpi.org/sites/default/files/LPI_DevOps_Exam_Guide.pdf,在指引文件中列出了一份工具清單如下:

I am comfortable using the following tools:

  • Git
  • Jenkins
  • Docker
  • Docker Swarm
  • Kubernetes
  • Vagrant
  • Cloud-init
  • Packer
  • Ansible
  • Prometheus
  • ELK Stack

這裡列了 11 項工具,對照昨天應試目標能力中提及的工具,有些並不在這份清單中,但我們還是先以這裡提到的工具為主,其中有些是我第一次看到。首先我們先來看一下這些工具到底是幹什麼的。

  • Git - 這個大家應該都很熟悉了,分散式版本管理工具的王者。
  • Jenkins - CI/CD pipeline 常用的工具,Jenkins 的官網是這麼描述它的:Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software
    它是一個提供「自動化」的伺服器,可以用來自動化諸如建置、測試、交付、部署等功能。所謂的自動化,應該是指當達到某些條件時會自動觸發去做某些事的過程。
  • Docker - 這個大家應該也很熟悉,最近很火紅的虛擬化容器工具。
  • Docker Swarm - Docker 叢集管理,我想它應該不算是一個獨立的工具,而已經被整合到 Docker 的功能之中。Docker 官網對 Swarm 的定義是 a cluster of one or more Docker Engines running in swarm mode,也就是說在 Docker 容器跑起來時,可以指定它是否要以 swarm 模式執行,若以 swarm 模式執行,這一個或一群 Docker 容器就可以稱為 Swarm,而 Docker swarm 可視作管理 swarm 的相關指令集合。
  • Kubernetes - Google 發展出來的容器管理工具,用於自動部署或擴展。官網上的說明,Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery。它將一個應用程式所用到的容器組織成易於管理的邏輯單位。它是「容器」管理工具,而不只是針對 Docker,也就是說可以管理其他的 container runtime,不過 Docker 還是大宗就是了。
  • Vagrant - 官網的說明 Vagrant is a tool for building and managing virtual machine environments in a single workflow. Vagrant provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team. Vagrant 能在單一的工作流程中打造及管理虛擬機器環境,提供易於設定、可重製且可攜的工作環境。它是一個虛擬機器的管理工具,讓你可以依設定檔快速地建立虛擬機器。
  • Cloud-init - 由官網上的說明直翻,Cloud-init 是用來客製化雲端實例的工具。Cloud images are operating system templates and every instance starts out as an identical clone of every other instance. It is the user data that gives every cloud instance its personality and cloud-init is the tool that applies user data to your instances automatically. 我覺得這個描述不是很清楚噢,但之前沒有用過這個工具,所以之後再來研究吧。
  • Packer - 和 Vagrant 一樣都是 HashiCorp 這家公司所開發的產品,用來建造虛擬機器所需的映象檔,支援多種平台,如 Amazon EC2、VMWare、VirtualBox 等等。之前也沒用過,所以也是以後再研究。
  • Ansible - 官網上的介紹,Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs. 它是一個自動化的引擎,提供各種自動化的功能。簡單地說,它是利用設定檔達到在多台機器完成相同工作的自動化工具。而在目的機器上不需要另外安裝 agent,可透過 SSH 直接完成,也讓它成為很受歡迎的自動化工具。
  • Prometheus - 系統狀態監控及警示的工具。
  • ELK Stack - 現在叫作 Elastic Stack 了,主要包含三種工具,Elasticsearch、Logstash 及 Kibana,這個組合堆疊最主要是用來集中不同機器的 log、進行剖析 (parsing) 、編製索引用以搜尋,並提供儀表板等 Web 介面以方便使用者利用。

接下來我們根據應試目標能力來對應這些工具,順便看看有那些工具是前面列表中沒有提到的。

Topic 701: 軟體工程 Software Engineering

  • 701.1 現代軟體開發 Modern Software Development
    工具:無

  • 701.2 軟體標準元件及平台 Standard Components and Platforms for Software (2)
    工具(平台): OpenStack、OpenShift

  • 701.3 源碼管理 Source Code Management (5)
    工具:Git

  • 701.4 持續整合及交付 Continuous Integration and Continuous Delivery (5)
    工具:Jenkins

Topic 702 - 容器管理 Container Management (16)

  • 702.1 容器使用 Container Usage (7)
    工具:Docker

  • 702.2 容器部署及編配 Container Deployment and Orchestration (5)
    工具:Docker (swarm)、Kubernetes

  • 702.3 容器設施 Container Infrastructure (4)
    工具:Docker

Topic 703 - 機器部署 Machine Deployment (8)

  • 703.1 虛擬機器部署 Virtual Machine Deployment (4)
    工具:Vagrant

  • 703.2 雲端部署 Cloud Deployment (2)
    工具:Cloud-init

  • 703.3 系統咉像檔創建 System Image Creation (2)
    工具:Packer

Topic 704 - 設置管理 Configuration Management (10)

  • 704.1 Ansible (8)
    工具:Ansible

  • 704.2 其他設置管理工具 Other Configuration Management Tools (2)
    工具:Puppet、Chef

Topic 705 - 服務維運 Service Operation (8)

  • 705.1 IT維運及監控 IT Operations and Monitoring (4)
    工具:Prometheus

  • 705.2 Log管理及分析 Log Management and Analysis (4)
    工具:Logstash、Elasticsearch、Kibana

看來除了 OpenStack、OpenShift 這類的平台外,在工具的部分,列表中沒有提到但有可能會考的就是 Puppet 和 Chef,共有 2 題。

大概瞭解考試的範圍和方向後,我們來看一下官方給的幾個例題:

第一題

In the case where the file app.yml contains the following content:

version: “3”
services:
 lb:
   image: haproxy
   ports:
    - “443:443”
 web:
   image: nginx
   deploy:
replicas: 2

Which of the following commands makes Docker process this file?
A. docker exec --compose-file app.yml
B. docker service create --compose-file app.yml
C. docker swarm compose up --compose-file app.yml
D. docker stack deploy myapp --compose-file app.yml
E. docker-compose up --swarm --compose-file app.yml

答案:D

第二題

Which of the following Git subcommands can be used to put a new file existing in a Git repository under version control? (Choose TWO correct answers.)
A. git add
B. git status
C. git version
D. git commit
E. git tag

答案:A、D

第三題

By default, which file in a build context is read by docker build to gather information about the steps required to create a new container image? (Specify the filename only without any path.)

答案:Dockerfile

第四題

Which command included in Kubernetes is the main tool that is used to deploy and manage applications on a Kubernetes cluster? (Specify ONLY the command without any path or parameters.)

答案:kubectl

關於這張證照的介紹就到此為止,明天開始正式進入主題。


上一篇
[Day 01] LPI DevOps Tools Engineer 證照介紹 (1)
下一篇
[Day 03] Vagrant (1)
系列文
30 天準備 LPI DevOps Tools Engineer 證照30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言