tag:blogger.com,1999:blog-60143663746704638422024-03-12T16:42:44.364-07:00知識過客k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comBlogger254125tag:blogger.com,1999:blog-6014366374670463842.post-22764640206101500402018-02-19T23:43:00.003-08:002018-02-19T23:51:53.586-08:00新一代LB - Traefik<h1 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;">
新一代LB<span class="Apple-converted-space"> </span>-<span class="Apple-converted-space"> </span>Traefik</h1>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
Traefik突破以往我們對load<span class="Apple-converted-space"> </span>balancer的觀點,他是一套直接與docker整合的load<span class="Apple-converted-space"> </span>balancer套件...<span class="Apple-converted-space"> </span>透過Traefik,我們可以使用label的方式將後面啟動的docker<span class="Apple-converted-space"> </span>instance掛載到loadbalancer中,且無需重新啟動Traefik,可直接生效...</div>
<h2 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Traefik基本介紹</h2>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
Traefik是以動態重載新加入的docker<span class="Apple-converted-space"> </span>instance的方式來替有附加相同domain<span class="Apple-converted-space"> </span>label的dockerinstance建立網路附載平衡的關聯...<span class="Apple-converted-space"> </span>因此,設定上,與一般我們建立reverse<span class="Apple-converted-space"> </span>proxy的過程剛好相反(一般我們會先建立服務,再建立reverse<span class="Apple-converted-space"> </span>proxy將服務串連起來)...</div>
<h3 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.5em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Step1<span class="Apple-converted-space"> </span>-<span class="Apple-converted-space"> </span>建立Traefik服務</h3>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
下面我們用官方的compose<span class="Apple-converted-space"> </span>file來說明...</div>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
File:<span class="Apple-converted-space"> </span>docker-compose.yaml</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">version: '2'
services:
proxy:
image: traefik
command: --api --docker --docker.domain=docker.localhost --logLevel=DEBUG
networks:
- webgateway
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /dev/null:/traefik.toml
networks:
webgateway:
driver: bridge</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
其中traefik啟動時候,我們需要指定docker.domain來告訴taefik要聆聽的domain是哪一個,然後要事先開啟對應的port,讓外部服務可以連到traefik...,另外,我們將dockersocket掛載進來,這是必要的設定,讓traefik可以透過docker<span class="Apple-converted-space"> </span>socket來操控一些東西...,最後,traefik.toml檔案,我們保留空的,讓treafik自己建立...</div>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
啟動:</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker-compose -f docker-compose.yaml up -d</code></pre>
<h3 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.5em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Step2<span class="Apple-converted-space"> </span>-<span class="Apple-converted-space"> </span>建立你的服務並加入Traefik</h3>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
接下來,我們可以啟動我們的服務(ex:<span class="Apple-converted-space"> </span>網站),讓traefik掛載...</div>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
File:<span class="Apple-converted-space"> </span>whoami.yaml</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">version: '2'
services:
whoami:
image: emilevauge/whoami
networks:
- web
labels:
- "traefik.backend=whoami"
- "traefik.frontend.rule=Host:whoami.docker.localhost"
networks:
web:
external:
name: traefik_webgateway</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
官方的說明是以whoami為例,他會顯示你連入的http協定與主機資訊...</div>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
上述的設定中,指定traefik的backend為whoami這個service,並且指定fontend<span class="Apple-converted-space"> </span>rule為whoami.docker.local...<span class="Apple-converted-space"> </span>這個呼應traefik啟動時候所指定的domain,讓traefik可以知道該container<span class="Apple-converted-space"> </span>instance要加入這個domain的路由群組...</div>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
啟動:</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker-compose -f whoami.yaml up -d</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
接下來你就可以用下面的方式測試</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">curl -H Host:whoami.docker.localhost http://127.0.0.1</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
這邊比較特別的是,traefik是透過domain的方式掛載你的服務,因此我們必須透過指定domain的方式來存取,如果使用curl,最快的就是加上Host header... 如果需要使用網路,那Mac的用戶建議修改/etc/hosts來對應whoami.docker.localhost到127.0.0.1... Windiws用戶可以參考<a href="http://blog.xuite.net/vexed/tech/22067064-%E5%9C%A8+Windows+XP+%E7%89%B9%E5%AE%9A+Domain+%E8%B7%B3%E9%81%8E+DNS+%E7%9B%B4%E6%8E%A5%E9%80%A3%E5%BE%80%E6%8C%87%E5%AE%9A%E7%9A%84+IP" style="background: 0px 0px; box-sizing: border-box; color: #4183c4; font-size: inherit; text-decoration-line: none;">相關設定</a>。</div>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
官方文件中,另外還針對service做scale<span class="Apple-converted-space"> </span>out,讓traefik可以round<span class="Apple-converted-space"> </span>rabin的跑在scale出來的instance上,對於使用docker作為操控的開發者來說,真的相當方便唷!</div>
<h2 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Traefik透過LetsEncrypt啟用SSL</h2>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
下面介紹以啟用SSL憑證到Traefik服務為主...</div>
<h3 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.5em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
準備動作</h3>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
建立自己的network,讓其他後續啟動的instance可以共用這個network...</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker network create web</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
建立docker-compose.yaml,<span class="Apple-converted-space"> </span>traefik.toml,<span class="Apple-converted-space"> </span>acme.json三個檔案...<span class="Apple-converted-space"> </span>該三個檔案需要在traefik啟動時候用到,下面會說明compose<span class="Apple-converted-space"> </span>file跟toml檔案的內容...<span class="Apple-converted-space"> </span>acme.json只要保持空的即可...</div>
<h3 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.5em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
啟動Traefik</h3>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
首先介紹Traefik的compose<span class="Apple-converted-space"> </span>file,Traefik是透過掛載docker<span class="Apple-converted-space"> </span>volume的方式來操控docker的實體,聆聽新加入的docker服務的相關資訊,再加上相關的load<span class="Apple-converted-space"> </span>balancer設定來轉導相關的流量到指定的instance...</div>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
File:<span class="Apple-converted-space"> </span>docker-compose.yaml</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">version: '2'
services:
traefik:
image: traefik
restart: always
ports:
- 80:80
- 443:443
networks:
- web
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/traefik/traefik.toml:/traefik.toml
- /opt/traefik/acme.json:/acme.json
container_name: traefik
networks:
web:
external: true</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
traefik.yaml是traefik的設定檔案,下面描述要開啟http,<span class="Apple-converted-space"> </span>https的協定,並且聆聽label中domain為arecord.us的instance,將它掛載到traefik中...</div>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
File:<span class="Apple-converted-space"> </span>traefik.toml</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">debug = true
logLevel = "INFO"
defaultEntryPoints = ["https","http"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[retry]
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "arecord.us" #掛載你的domain
watch = true
exposedbydefault = false
[acme]
email = "simonsu@arecord.us" #你的信箱
storage = "acme.json"
entryPoint = "https"
OnHostRule = true
[acme.httpChallenge]
entryPoint = "http"</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
啟動:</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker-compose -f docker-compose.yaml up -d</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
啟動後,除非有打開traefik的管理介面,不然目前瀏覽應該都是404的錯誤ㄛ...,我們再往下,啟動backend的服務後,才可以瀏覽...</div>
<h3 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.5em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
啟動你的docker<span class="Apple-converted-space"> </span>instance</h3>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
接著,我們可以啟動我們自己的服務...<span class="Apple-converted-space"> </span>下面以nginx為例,希望將網站掛載到gcpdemo.arecord.us這個網域名稱上...</div>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
File:<span class="Apple-converted-space"> </span>web.yaml</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">version: '2'
services:
gcpdemo:
image: nginx
restart: always
networks:
- web
- default
labels:
- "traefik.backend=gcpdemo"
- "traefik.docker.network=web"
- "traefik.frontend.rule=Host:gcpdemo.arecord.us"
- "traefik.enable=true"
- "traefik.default.protocol=http"
networks:
web:
external: true</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
上述的設定檔中,指定traefik要掛載名為gcpdemo的instance,並且使用web這個network...最重要的是frontend<span class="Apple-converted-space"> </span>rule這段,是指定真實打到該主機外部IP的domain(因此我們還是需要到DNS<span class="Apple-converted-space"> </span>server上指定一筆紀錄,讓gcpdemo.arecord.us這個domain可以對應到這台機器的實體ip)...</div>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
啟動:</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker-compose -f web.yaml up -d</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
啟動後,需要稍微等待traefik跟LetsEncrypt取回SSL憑證,接下來就可以直接使用<a href="https://gcpdemo.arecord.us/" style="background: 0px 0px; box-sizing: border-box; color: #4183c4; font-size: inherit; text-decoration-line: none;">https://gcpdemo.arecord.us</a><span class="Apple-converted-space"> </span>來瀏覽您的網站了!</div>
<h2 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
參考</h2>
<ul style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0px !important; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px 0px 0px 2em;">
<li style="box-sizing: border-box; font-size: inherit;">官方文件 -<span class="Apple-converted-space"> </span><a href="https://docs.traefik.io/" style="background: 0px 0px; box-sizing: border-box; color: #4183c4; font-size: inherit; text-decoration-line: none;">https://docs.traefik.io/</a></li>
<li style="box-sizing: border-box; font-size: inherit;">官方文件 - 設定Traefik SSL:<span class="Apple-converted-space"> </span><a href="https://docs.traefik.io/user-guide/docker-and-lets-encrypt/" style="background: 0px 0px; box-sizing: border-box; color: #4183c4; font-size: inherit; text-decoration-line: none;">https://docs.traefik.io/user-guide/docker-and-lets-encrypt/</a></li>
<li style="box-sizing: border-box; font-size: inherit;">本文同步刊登於Gitbook:<a href="https://peihsinsu.gitbooks.io/docker-note-book/content/xin-yi-dai-lb-traefik.html">https://peihsinsu.gitbooks.io/docker-note-book/content/xin-yi-dai-lb-traefik.html</a></li>
</ul>
k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-35461924520582823192018-02-19T23:41:00.000-08:002018-02-19T23:41:11.441-08:00Auto SSL - Using OpenResty<h1 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;">
Auto<span class="Apple-converted-space"> </span>SSL</h1>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
Auto SSL中,目前筆者有接觸過的是<a href="https://letsencrypt.org/" style="background: 0px 0px; box-sizing: border-box; color: #4183c4; font-size: inherit; text-decoration-line: none;">LetsEncrypt</a>的服務,設定上可以搭配<a href="https://certbot.eff.org/" style="background: 0px 0px; box-sizing: border-box; color: #4183c4; font-size: inherit; text-decoration-line: none;">CertBot</a>來做設定... 當然有更簡單的方式...</div>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
下面是Github上的公開專案,是基於OpenResty與Lua開發的工具,可以讓我們透過LetsEncrypt自動附加、更新SSL憑證,一切的一切,只需要把server啟動即可...</div>
<h2 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Step1<span class="Apple-converted-space"> </span>-<span class="Apple-converted-space"> </span>下載專案</h2>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
由於該專案並未有太多其他附加的設定,我們可以直接下載該專案然後做修改,或是fork到自己的repo做其他開發...</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">$ git clone https://github.com/rmoriz/docker_openresty_autossl</code></pre>
<h2 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Step2<span class="Apple-converted-space"> </span>-<span class="Apple-converted-space"> </span>建立自己的docker</h2>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
待需要修改的部分完成,我們可以在本機將他build成docker<span class="Apple-converted-space"> </span>image供後續使用...</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">$ cd docker_openresty_autossl
$ docker build -t autossl .</code></pre>
<h2 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Step3<span class="Apple-converted-space"> </span>-<span class="Apple-converted-space"> </span>啟動docker</h2>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
最後,我們只需要將該docker<span class="Apple-converted-space"> </span>image啟動,即可同時有HTTPS與HTTP協定的入口...</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">$ docker run -d -p 80:80 -p 443:443 rmoriz/openresty_autossl</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
其中,由於openresty的設定檔與nginx的設定相同,我們可以參考nginx.conf然後修改掛載我們需要載入的virtual<span class="Apple-converted-space"> </span>host相關設定,讓openresty可以Load<span class="Apple-converted-space"> </span>Balance我們所要提供的服務。</div>
<h2 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
注意事項</h2>
<ul style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0px !important; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px 0px 0px 2em;">
<li style="box-sizing: border-box; font-size: inherit;">由於此模組會需要在公網上認證該Domain的設定,因此,我們必須要讓DNS可以指定到一個可以聯繫到該主機的地方... 換句話說... 如果想要用127.0.0.1測試就會有問題... 因為DNS反解後外部仍無法聯繫到該IP...</li>
</ul>
k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-389018880913744812017-10-24T05:38:00.002-07:002017-10-24T05:38:36.079-07:00使用 minikube 輕鬆上手 kubernetes<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">安裝minikube</span></h2>
<b id="docs-internal-guid-76ac40f0-4e63-6bff-2caa-cd23f5369621" style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">macOS只需要透過brew即可快速安裝... </span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">brew</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> cask install minikube</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Linux環境可以直接下載執行檔,放到環境變數可以吃到的路徑即可...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">curl -Lo minikube </span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">https:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && \</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">chmod +x minikube && \</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sudo mv minikube /usr/local/bin/</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Windows的下載網址如下:</span></div>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<a href="https://storage.googleapis.com/minikube/releases/latest/minikube-windows-amd64.exe" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://storage.googleapis.com/minikube/releases/latest/minikube-windows-amd64.exe</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">如果您的kubectl尚未安裝,可以直接使用google cloud sdk來安裝:</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">curl</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> https://sdk.cloud.google.com | bash</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">gcloud components install kubectl</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">安裝完成後,原則上minikube會在本地端加入minikube的k8s context,我們可以透過下面指令來使用該context…</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">kubectl config </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">use</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">context</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> minikube</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">然後,可檢查一下您的minikube node是否正常運作....</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ kubectl get node -o wide</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NAME STATUS AGE VERSION EXTERNAL-</span><span style="background-color: #f0f0f0; color: #397300; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">IP</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> OS-IMAGE KERNEL-VERSION</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">minikube Ready </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2d</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> v1</span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.7.5</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> <none> Buildroot </none></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2017.02</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4.9</span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.13</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">基本使用</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">由於這邊主要介紹minikube,先暫時不介紹kubernetes的概念與操作... 有需要可以先切換到kubernetes的基本篇來看看^^ </span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">在minikube中,有提供一些不錯的工具,可以供您操作minikube的環境... 我們可以用minikube help來檢視可以使用的指令...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ minikube help</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Minikube is a CLI tool that provisions and manages single-node Kubernetes clusters optimized </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> development workflows.</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Usage:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> minikube [command]</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Available Commands:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> addons Modify minikube</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'s</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> kubernetes addons</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> completion Outputs minikube shell completion </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> the given shell (bash)</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> config Modify minikube config</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> dashboard Opens/displays the kubernetes dashboard URL </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> your local cluster</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> delete Deletes a local kubernetes cluster</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> docker-env Sets up docker env variables; similar to '$(docker-machine env)'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> get-k8s-versions Gets the list of available kubernetes versions available </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> minikube</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ip Retrieves the IP address of the running cluster</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> logs Gets the logs of the running localkube instance, used </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> debugging minikube, not user code</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> mount Mounts the specified directory into minikube</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> profile Profile sets the current minikube profile</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> service Gets the kubernetes URL(s) </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> the specified service </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> your local cluster</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ssh Log into or run a command on a machine with SSH; similar to </span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'docker</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-machine ssh'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ssh-key Retrieve the ssh identity key path of the specified cluster</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> start Starts a local kubernetes cluster</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> status Gets the status of a local kubernetes cluster</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> stop Stops a running local kubernetes cluster</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> update-context Verify the IP address of the running cluster </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> kubeconfig.</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> version Print the version of minikube</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Flags:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> --alsologtostderr log to standard error </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">as</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> well </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">as</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> files</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> -b, --bootstrapper string The name of the cluster bootstrapper that will set up the kubernetes cluster. (</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">default</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"localkube"</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">default</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> :</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> --log_dir string If non-empty, write log files </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> this directory</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> --loglevel int Log level (</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> = DEBUG, </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> = FATAL) (</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">default</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> --logtostderr log to standard error instead of files</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> -p, --profile string The name of the minikube VM being used.</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This can </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">be</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> modified to allow </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> multiple minikube instances to </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">be</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> run independently (</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">default</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"minikube"</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> --stderrthreshold severity logs at or above this threshold go to stderr (</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">default</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> -v, --v Level log level </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> V logs</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> --vmodule moduleSpec comma-separated list of pattern=N settings </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> file-filtered logging</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Use </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"minikube [command] --help"</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> more information about a command.</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<h3 dir="ltr" style="line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;">
<span style="background-color: transparent; color: #434343; font-family: Arial; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">啟動與關閉minikube</span></h3>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">畢竟minikube會實際使用主機的資源,如果在不需要操作時候,可以透過stop將minikube關閉,當然,也可以start他...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ minikube </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">stop</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Stopping local Kubernetes cluster...</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Machine stopped.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ minikube </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">start</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Starting local Kubernetes v1.7.5 cluster...</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Starting VM...</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Getting VM IP address...</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Moving files into cluster...</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Setting up certs...</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Connecting to cluster...</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Setting up kubeconfig...</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Starting cluster components...</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Kubectl is now configured to use the cluster.</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<h3 dir="ltr" style="line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;">
<span style="background-color: transparent; color: #434343; font-family: Arial; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">確認minikube狀態</span></h3>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">minikube啟動後,我們可以透過status來確認目前minikube的執行狀態,他也會同時顯示minikube所在的ip位置...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">minikube</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">status</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">minikube: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Running</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cluster: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Running</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">kubectl: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Correctly</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Configured: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">pointing</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">to</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">minikube-vm</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">at</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">192.168.99.100</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<h3 dir="ltr" style="line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;">
<span style="background-color: transparent; color: #434343; font-family: Arial; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">檢視minikube實際ip位置</span></h3>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">minikube另外提供一個更簡單的指令來顯示ip位置,未來可以透過這個指令來結合一些自動化程式...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ minikube </span><span style="background-color: #f0f0f0; color: #397300; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ip</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">192.168</span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.99.100</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<h3 dir="ltr" style="line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;">
<span style="background-color: transparent; color: #434343; font-family: Arial; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">切入minikube所在的linux環境</span></h3>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">由於minikube也是啟動在linux的環境上,所以minikube也提供了讓您連入minikube底層linux的指令...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ minikube ssh</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ( ) ( )</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> __</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> (</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">) __</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> (</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)| |/</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">') _ _ | |_ __</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">` _ `</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">\| |/</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">' _ `\| || , < ( ) ( )| '_`\ /'__`</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">\</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">| ( ) ( ) || || ( ) || || |\</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">`\ | (_) || |_) )( ___/</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(_) (_) (_)(_)(_) (_)(_)(_) (_)`</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">\__</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'(_,__/'`\____)</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<h3 dir="ltr" style="line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;">
<span style="background-color: transparent; color: #434343; font-family: Arial; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">連線minikube部署的服務</span></h3>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">下面是我們透過簡單的k8s操作來建立起的服務,然後可以展示如何連線到minikube上的應用...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: blue; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ kubectl run nginx --image=nginx --port=80</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">deployment "nginx" created</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ kubectl get all</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NAME READY STATUS RESTARTS AGE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">po/nginx-1423793266-svb16 0/1 ContainerCreating 0 1m</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">svc/kubernetes 10.0.0.1 <none> 443/TCP 2d</none></span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">deploy/nginx 1 1 1 0 1m</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NAME DESIRED CURRENT READY AGE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">rs/nginx-1423793266 1 1 0 1m</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: blue; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ kubectl expose deploy/nginx --type=NodePort</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">service "nginx" exposed</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ kubectl get all</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NAME READY STATUS RESTARTS AGE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">po/nginx-1423793266-svb16 1/1 Running 0 2m</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">svc/kubernetes 10.0.0.1 <none> 443/TCP 2d</none></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">svc/nginx 10.0.0.227 <nodes> 80:31659/TCP 1m</nodes></span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">deploy/nginx 1 1 1 1 2m</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NAME DESIRED CURRENT READY AGE</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">rs/nginx-1423793266 1 1 1 2m</span></div>
<br /><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: blue; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ minikube service nginx --url</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://192.168.99.100:31659</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">上面的步驟中,主要是先建立nginx的deployment,然後透過export service來將nginx deployment的端口呈現在minikube的node上... 最後,我們可以透過minikube來show出該service最後binding在哪個位置...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">如果您嚐試建立mysql的服務... 您會發現最後minikube service還是會用http來顯示連線資訊... 這部分是因為service連接layer 4的網路,在協定上有太多可能性.. minikube無法逐一判斷,因此用一個大家最熟悉也最可能的方式呈現,最主要的資訊其實是port,minikube已經很人性化了^^... 另外,如果沒有加上”--url”的參數,則minikube會直接使用browser開啟網頁,就可以直接瀏覽了ㄛ^^</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">開啟minikube的擴充套件</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">minikube提供addons來擴充minikube,我們可以使用minikube addons list來查看哪些addons可以使用... 然後把他enable或是disable...</span></div>
<h3 dir="ltr" style="line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;">
<span style="background-color: transparent; color: #434343; font-family: Arial; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">開啟ingress服務</span></h3>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">上面所介紹的簡單操作,最後minikube service nginx是以k8s service的部分顯示nginx可以連線的位置,由於minikube為單機服務,因此也沒有很需要使用真正的service(真正的service將會有特定的主機擔任traffic forwarding的任務,在開通的過程中,會需要通知該主機把port對應上所要導向的pod… 而在雲服務,service則會與layer 4 load balancer結合...)。而ingress因為為layer 7層的網路服務,其中包含load balancer的特殊功能,因此minikube特地把ingress放在addons list中,讓使用者可以快速的啟用他... 下面是檢視目前addons與啟用ingress的方式...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># minikube addons list</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">- addon-manager: enabled</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">- kube-dns: enabled</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">- heapster: enabled</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">- registry-creds: disabled</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">- dashboard: enabled</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">- default-storageclass: enabled</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">- ingress: enabled</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">- registry: disabled</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># minikube addon </span><span style="background-color: #f0f0f0; color: #397300; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">enable</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ingress</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">啟用後,我們可以再次檢視是否已經完成啟用... 等待一切就緒,我們就可以建立一個ingress來試試...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">首先,我們需要建立ingress的yaml檔案,以上面的nginx服務為例,我們以nginx service來建立80 port的服務對應... 把下面的檔案存成ingress.yaml</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">apiVersion: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">extensions/v1beta1</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">kind: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ingress</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">metadata:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> name: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">nginx</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">spec:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> backend:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> serviceName: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">nginx</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> servicePort: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">80</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">儲存完成後,我們可以透過下面指令將ingress建立起來...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ kubectl </span><span style="background-color: #f0f0f0; color: #397300; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">create</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> -f ingress.yaml</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ingress </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"nginx"</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> created</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">接下來,我們需要等待一點時間,讓ingress取到可以用的ip位置... </span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> kubectl get ingress</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NAME HOSTS ADDRESS PORTS AGE</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">nginx * 192.168.99.100 80 4m</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">然後我們就可以直接連線 http://192.168.99.100 來測試了,沒問題的話,應該可以直接顯示nginx的歡迎畫面...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">由於ingress有不少東西可以玩,這邊不贅述ingress的功能,留給大家試試ingress強大的功能^^</span></div>
<h3 dir="ltr" style="line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;">
<span style="background-color: transparent; color: #434343; font-family: Arial; font-size: 13.999999999999998pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">開啟heapster服務</span></h3>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">heapster是kubernetes中負責蒐集k8s內container運作的相關資訊的服務,他通常會結合Grafana來做BI的查詢... 同ingress的啟用方式,我們也可以快速的將heapster addon啟動...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ minikube addon </span><span style="background-color: #f0f0f0; color: #397300; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">enable</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> heapster</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">接下來可以開啟heapster的UI… 這邊會直接開啟Grafana作為客製化報表查詢的地方...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> minikube addon open heapster</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">如果想要知道heapster的連線資訊,也可以直接用minikube service來show出url位置,但因為heapster是屬於kube-system這個namespace,所以這邊就需要多指定namespace為kube-system…</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ minikube service monitoring-grafana -n kube-system --url</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http:</span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//192.168.99.100:31644</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b><br />
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">參考</span></h2>
<br />
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">minikube github:</span><a href="https://github.com/kubernetes/minikube" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://github.com/kubernetes/minikube</span></a></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">minikube進階篇:</span><a href="https://github.com/kubernetes/minikube/blob/master/docs/README.md" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://github.com/kubernetes/minikube/blob/master/docs/README.md</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">關於addons:</span><a href="https://github.com/kubernetes/minikube/blob/master/docs/addons.md" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://github.com/kubernetes/minikube/blob/master/docs/addons.md</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">如果還是想要service load balancer:</span><a href="https://github.com/kubernetes/contrib/tree/master/service-loadbalancer" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://github.com/kubernetes/contrib/tree/master/service-loadbalancer</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
</li>
</ul>
k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-33343974944522040112017-10-16T04:33:00.000-07:002017-10-16T04:33:24.546-07:00使用Docker執行Percona XDB<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
本篇介紹Percona<span class="Apple-converted-space"> </span>XDB的Cluster架構,其中由於需要提供Cluster<span class="Apple-converted-space"> </span>Member溝通,因此需要建立一層可以溝通的網路。在Docker中,我們可以用overlay<span class="Apple-converted-space"> </span>network的方式提供集群溝通的管道。</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker network create cluster1_net</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
接下來有兩種方式可以建立所屬的cluster...<br style="box-sizing: border-box; font-size: inherit;" />1. 透過join cluster name的方式<br style="box-sizing: border-box; font-size: inherit;" />2. 透過etcd的discovery方式</div>
<h3 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.5em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Join<span class="Apple-converted-space"> </span>Cluster<span class="Apple-converted-space"> </span>Name</h3>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
首先建立Master<span class="Apple-converted-space"> </span>Node,並指定Cluster<span class="Apple-converted-space"> </span>Name為cluster1...<span class="Apple-converted-space"> </span>在此我們指定master<span class="Apple-converted-space"> </span>node的instance名稱為master,這樣有助於其他member在加入的時候可以使用該機器名稱識別cluster的位置...</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker run -d --name master -p 3306 \
--net=cluster1_net \
-e MYSQL_ROOT_PASSWORD=1234qwer \
-e CLUSTER_NAME=cluster1 \
-e XTRABACKUP_PASSWORD=1234qwer \
percona/percona-xtradb-cluster</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
接下來可以啟動多台cluster<span class="Apple-converted-space"> </span>member,只需要指定啟動參數中的CLUSTER_JOIN欄位為master(代表透過master的私有ip做認證)即可。</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker run -d -p 3306 --net=cluster1_net \
-e MYSQL_ROOT_PASSWORD=1234qwer \
-e CLUSTER_NAME=cluster1 \
-e CLUSTER_JOIN=master \
-e XTRABACKUP_PASSWORD=1234qwer \
percona/percona-xtradb-cluster</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
接著可以分別登入master與後續啟動的member,分別建立資料,即可了解叢集是否正常運作...</div>
<h3 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.5em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
使用etcd作為叢集discovery頻道</h3>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
使用ETCD的方法,首先需要啟動ETCD,為了讓ETCD可以發佈到外部可以連線,我們將ETCD的IP指定為該docker環境的外部主機IP(即為你電腦的IP)...</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">export HostIP=172.26.8.38</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
然後可以設定第一台master啟動,啟動的參數中,我們指定HostIP作為docker啟動參數,讓啟動時所指定的參數可以由外部指定...</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker run -d -v /tmp:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
-e HostIP=172.26.8.38 \
--name etcd quay.io/coreos/etcd:v2.3.8 \
-name etcd0 \
-advertise-client-urls http://$HostIP:2379,http://$HostIP:4001 \
-listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
-initial-advertise-peer-urls http://$HostIP:2380 \
-listen-peer-urls http://0.0.0.0:2380 \
-initial-cluster-token etcd-cluster-1 \
-initial-cluster etcd0=http://$HostIP:2380 \
-initial-cluster-state new</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
接下來可以啟動其他的member,這邊同樣需要指定discovery<span class="Apple-converted-space"> </span>server(etcd)的ip,也就是啟動etcd時掛載到本機的HostIP...</div>
<pre style="background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.3px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker run -d -p 3306 --net=cluster1_net \
-e HostIP=$HostIP \
-e MYSQL_ROOT_PASSWORD=1234qwer \
-e CLUSTER_NAME=cluster1 \
-e DISCOVERY_SERVICE=$HostIP:2379 \
-e XTRABACKUP_PASSWORD=1234qwer \
percona/percona-xtradb-cluster</code></pre>
<div style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
如果啟動無誤,則可以用docker<span class="Apple-converted-space"> </span>ps檢視一下這些啟動的DB的外部IP,然後連入測試一下^^</div>
<h2 style="background-color: #fafafa; box-sizing: border-box; break-after: avoid; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.3px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Reference</h2>
<ul style="background-color: #fafafa; box-sizing: border-box; color: #333333; font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 0px !important; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding: 0px 0px 0px 2em;">
<li style="box-sizing: border-box; font-size: inherit;">Percona in Docker:<span class="Apple-converted-space"> </span><a href="https://www.percona.com/blog/2016/06/10/percona-xtradb-cluster-in-a-multi-host-docker-network/" style="background: 0px 0px; box-sizing: border-box; color: #4183c4; font-size: inherit; text-decoration-line: none;">https://www.percona.com/blog/2016/06/10/percona-xtradb-cluster-in-a-multi-host-docker-network/</a></li>
<li style="box-sizing: border-box; font-size: inherit;">Etcd in Docker:<span class="Apple-converted-space"> </span><a href="https://coreos.com/etcd/docs/latest/v2/docker_guide.html" style="background: 0px 0px; box-sizing: border-box; color: #4183c4; font-size: inherit; text-decoration-line: none;">https://coreos.com/etcd/docs/latest/v2/docker_guide.html</a></li>
</ul>
k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-58700041208212739752017-10-15T07:00:00.004-07:002017-10-15T07:00:47.625-07:00初探PuppetPuppet是常見的DevOps管理工具,他具備強大且成熟的管理功能,並且支援客製化module的載入,是DevOps不可或缺的好工具..<br />
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">使用Puppet in Docker建置環境</span></h2>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">首先建立puppet連線使用的network</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">docker network </span><span style="background-color: #f0f0f0; color: #397300; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">create</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> puppet</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">將puppt執行在standalone mode</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">docker </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">run</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> --net puppet --name puppet --hostname puppet puppet/puppetserver-standalone</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">執行puppet agent...</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">docker</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">run</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #397300; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">--net</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">puppet</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">puppet/puppet-agent-ubuntu</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Creating</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">a</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SSL</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">key</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">f406170f87f3</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Caching</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">certificate</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ca</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">csr_attributes</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">file</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">loading</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/etc/puppetlabs/puppet/csr_attributes.yaml</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Creating</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">a</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">new</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SSL</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">certificate</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">request</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">f406170f87f3</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Certificate</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Request</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">fingerprint</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(SHA256):</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">E:11:85:D0:0E:7C:71:3F:2D:FB:C4:4C:39:DE:5F:CB:D4:14:BF:1A:47:0D:C8:4C:F0:87:7C:9B:44:FA:11:FB</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Caching</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">certificate</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">f406170f87f3</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Caching</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">certificate_revocation_list</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ca</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Caching</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">certificate</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ca</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Using</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">configured</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">environment</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'production'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Retrieving</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">pluginfacts</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Retrieving</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">plugin</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Caching</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">catalog</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">f406170f87f3</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Applying</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">configuration</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">version</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'1508051547'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Creating</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">state</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">file</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/opt/puppetlabs/puppet/cache/state/state.yaml</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Notice: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Applied</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">catalog</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0.01</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">seconds</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Changes:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Events:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Resources:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Total: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">7</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Time:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Schedule: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0.00</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Config</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> retrieval: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0.76</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Total: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0.76</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Last</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> run: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1508051547</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Filebucket: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0.00</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Version:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Config: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1508051547</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Puppet: </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5.2.0</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">上面的puppet的部分,會直接在機器上執行列出summary的指令,指令如下:</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">puppet agent \</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">--verbose \</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">--onetime \</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">--no-daemonize \</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">--summarize</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">為了進行一些互動,我們可以使用interactive mode執行agent</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">docker </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">run</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> -it --net puppet \</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> --entrypoint bash puppet/puppet-agent-ubuntu</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">接下來可以客製化agent連線的設定檔:</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># sudo vim /etc/puppetlabs/puppet/puppet.conf</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[</span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">main</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> certname = ${client hostname}</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> server = puppet </span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">//server name</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> environment = production</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> runinterval = </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">h</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">然後連線到agent端,透過"puppet agent"指令,即可啟動agent...,我們也可以強制把agent留在前景端,讓debug比較容易...</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">puppet</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> agent --verbose --</span><span style="background-color: #f0f0f0; color: #78a960; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">no</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-daemonize</span></div>
</td></tr>
</tbody></table>
</div>
<h2 dir="ltr" style="background-color: #fafafa; line-height: 1.32; margin-bottom: 11pt; margin-top: 17pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">範例一:為client增加一個檔案</span></h2>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">接下來進入puppet server到/etc/puppetlabs/code/environments/production下,建立manifests/site.pp檔案,內容如下:</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">node </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">default</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> file</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"/tmp/puppet_server.message"</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> content => </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Hello, Puppet Client!"</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">然後,進入agent端,執行"puppet agent --test",即可同步server端的設定</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">root@0fa0658f528b</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:/etc/puppetlabs/puppet</span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># puppet agent --test</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Using configured environment </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'production'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Retrieving pluginfacts</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Retrieving plugin</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Caching catalog </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">for</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 0fa0658f528b</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Applying configuration version </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'1508052730'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Notice:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> /Stage[main]/Main/Node[default]/File[</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/tmp/puppet</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">_server.message]/</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ensure:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">defined</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> content as </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'{md5}38febf090437aaf325733508da57a1cf'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Notice:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Applied catalog </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">02</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> seconds</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">同步完成後,可以檢查一下/tmp下,應該會出現"puppet_server.message"檔案,顯示Hello,Puppet Client!的內容...</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">root@0fa0658f528b</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:/etc/puppetlabs/puppet</span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># ls -l /tmp/</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">total </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-rw-r--r-- </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> root root </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">21</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Oct </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">15</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">07</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">32</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> puppet_server.message</span><span style="background-color: #fafafa;"> </span></div>
</td></tr>
</tbody></table>
</div>
<h2 dir="ltr" style="background-color: #fafafa; line-height: 1.32; margin-bottom: 11pt; margin-top: 17pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">範例二:自建module來安裝Apache HTTPD</span></h2>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">root@puppet</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:/etc/puppetlabs/code</span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># tree</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">|-- environments</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">| </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">`-- production</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">| |-- data</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">| |-- environment.conf</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">| |-- hiera.yaml</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">| |-- manifests</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">| `</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-- modules</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">`-- modules</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">我們先建立apache module的目錄(/etc/puppetlabs/code/modules/apache),然後在該目錄下建立manifest與files資料夾... 然後到 /etc/puppetlabs/code/modules/apache/manifest下依序建立下面的設定檔...</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">── </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">manifests</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ├── </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">init</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.pp</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ├── </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">install</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.pp</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ├── </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">config</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.pp</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ├── </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">service</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.pp</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">manitests/init.pp 是預設被讀取的檔案,通常用來定義變數、引用 class</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">apache</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> (</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> String $package_name = </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'apache2'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> String $package_ensure = </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'installed'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> String $service_name = </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'apache2'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> String $service_ensure = </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'running'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> String $default_site_conf = </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'/etc/apache2/sites-enabled/default.conf'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> String $run_user = </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'www-data'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">){</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> contain apache::install</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> contain apache::config</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> contain apache::service</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Class[</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'::apache::install'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> -> Class[</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'::apache::config'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ~> Class[</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'::apache::service'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">manitests/install.pp 用來定義如何安裝 package</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">apache::install</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">inherits</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">apache</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> package { $apache</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::package_name</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ensure</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> => $apache</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::package_ensure</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">manitests/service.pp 用來處理服務</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">apache::service</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">inherits</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">apache</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> service { </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> $apache</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::service_name</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ensure</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> => $apache</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::service_ensure</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"># subscribe => Package['apache'],</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">require</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> => Class[</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'apache::install'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<b id="docs-internal-guid-8461ce70-2054-6480-e1de-64f810766894" style="font-weight: normal;"><br /></b>
<div dir="ltr" style="background-color: #fafafa; line-height: 1.38; margin-bottom: 9pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">manitests/config.pp 用來處理設定檔</span></div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">apache::config</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">inherits</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">apache</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> {</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> file { $apache</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::default_site_conf</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ensure</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> => file,</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> owner => $apache</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::run_user</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> source => </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"puppet:///modules/${module_name}/default.conf"</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> }</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">files/default.conf 來描述apache的執行設定...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Timeout 60</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">KeepAlive </span><span style="background-color: #f0f0f0; color: #78a960; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">On</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">MaxKeepAliveRequests 100</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">KeepAliveTimeout 5</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">UseCanonicalName </span><span style="background-color: #f0f0f0; color: #78a960; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Off</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">AccessFileName .htaccess</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ServerTokens Full</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ServerSignature </span><span style="background-color: #f0f0f0; color: #78a960; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Off</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">HostnameLookups </span><span style="background-color: #f0f0f0; color: #78a960; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Off</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><ifmodule reqtimeout_module=""></ifmodule></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"></span></div>
</td></tr>
</tbody></table>
</div>
<h2 dir="ltr" style="background-color: #fafafa; line-height: 1.32; margin-bottom: 11pt; margin-top: 17pt;">
<br /></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">設定完成後,我們可以到agent的所在機器執行同步... 如果一切無誤,則client端會透過agent開始安裝與設定apache...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ puppet agent </span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">--test</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: Using configured environment 'production'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: Retrieving pluginfacts</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: Retrieving plugin</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: Caching catalog for 0fa0658f528b</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: Applying configuration version '1508075447'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Notice: /Stage[main]/Apache::</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Install</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Package</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[apache2]/ensure: created</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Notice</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: /Stage[</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">main</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]/Apache::Config/</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">File</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[/etc/apache2/sites-enabled/default.conf]/ensure: defined </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">content</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">as</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'{md5}0c72defe6a4e5486dffb8b38026bb3bf'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Class</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[Apache::Config]: Scheduling </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">refresh</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">of</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Class</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[Apache::Service]</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Class</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[Apache::Service]: Scheduling </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">refresh</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">of</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Service[apache2]</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Notice</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: /Stage[</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">main</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]/Apache::Service/Service[apache2]/ensure: ensure </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">changed</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'stopped'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">to</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">'running'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Info: /Stage[</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">main</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]/Apache::Service/Service[apache2]: Unscheduling </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">refresh</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">on</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Service[apache2]</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Notice</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: Applied </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">catalog</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">261.30</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> seconds</span></div>
</td></tr>
</tbody></table>
</div>
<h2 dir="ltr" style="background-color: #fafafa; line-height: 1.32; margin-bottom: 11pt; margin-top: 17pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">參考網址</span></h2>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: #333333; font-family: Arial; font-size: 10.5pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: #333333; font-family: Arial; font-size: 10.5pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Puppet in Docker: </span><a href="https://github.com/puppetlabs/puppet-in-docker" style="text-decoration: none;"><span style="background-color: transparent; color: #4183c4; font-family: Arial; font-size: 10.5pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://github.com/puppetlabs/puppet-in-docker</span></a></div>
</li>
</ul>
<span style="font-family: Arial; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Puppet manage guide: </span><a href="https://shazi7804.gitbooks.io/puppet-manage-guide/" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: Arial; font-size: 11pt; text-decoration-line: underline; vertical-align: baseline; white-space: pre-wrap;">https://shazi7804.gitbooks.io/puppet-manage-guide/</span></a><span style="font-family: Arial; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"> </span>k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-54019335359325964802017-09-28T08:17:00.000-07:002017-09-28T08:17:27.583-07:00使用GCP Cloud Builder建置CI/CD Flow<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">服務的建置通常是持續性的作業,而部署則一般是專案初期建置一次,未來可以沿用該部署設定... 這樣的流程走向自動化,在Container的環境又更是重要... 本篇介紹一下,在Google雲端,我們可以搭配Source Repository與Build Trigger等服務來完成服務的自動建置與部屬,讓封裝Container與部署到Container Engine的動作可以一氣呵成...</span></div>
<b id="docs-internal-guid-79fd5bd4-c90f-d544-547f-a817c4ca605d" style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">首先幾單瞭解一下一個Container Engine服務的建置與部屬過程...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">使先,建立Container Engine Cluster,透過GCP Winzard可以很快速地開立您的GKE Cluster…</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="279" src="https://lh5.googleusercontent.com/lnKZglXCx-dkL5-a_gu5YPVZlyzGdBM6wvjxE439vShCL5vwuiU5mwoRHtUfWAs_BuaysF2Pu9-EfYyYFD70YQz8Led8eFmtyswH3XJVVhGLk4MIcjwAYriXLJxsI5qH7HZrZgYB" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="642" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">假設您的cluster是叫做demo-cluster,則可以透過下面的指令來跟GKE建立連線</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ gcloud container clusters get-credentials demo-cluster </span><span style="background-color: #f0f0f0; color: #888888; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">--zone asia-east1-a </span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">這串指令不用記ㄛ~可以在Cluster的頁面找到他...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="184" src="https://lh3.googleusercontent.com/1KKB1HhPQUnhNXRDv-ygxy1MG69ZfvriWrax1iwRCOYIEpj9kFyeS0ct_iC8bEpcUXNKaX2hn64gloMV7nCz-mEkQDw_zzushnU-1H3hHZeY-wSgKKKgej9YS2v7bXJF_MEZ7PgC" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="642" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">點選複製,即可貼到您的Terminal執行...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="336" src="https://lh5.googleusercontent.com/Rjw0IE8Itjyffwu8CoEPzFwaJCj28tzc8-weI3pvLyc_gMLfSBtLw2b6sosubt4LJTkontA_oXaQBL68vJnQ9-waZ_sPHyr7cfFdkhM3V4cEQO3T6rZzFwMwDEcUj9_H5SOfVgBN" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="642" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">跟GKE建立鏈結後,接下來可以部署您的城市,這邊我們以我的一個範例程式Demoweb (</span><a href="https://github.com/peihsinsu/demoweb" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://github.com/peihsinsu/demoweb</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">) 為例,</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="183" src="https://lh5.googleusercontent.com/VlyFfrinKRFdUylSLQ-8RJd0JATmVqqm079GT5GvaUC197SsJmVGyJSjHqdlCqGmN7YveVHfqDL8p_hn7Ecc5bEsEIIeh8LK8w-ewc8MBtXwMkHDbL4m2bYlJ5EGhn8gMk3UtCQJ" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="642" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">這個專案中,包含幾個重要結構:</span></div>
<b style="font-weight: normal;"><br /></b>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">app/ : 放置您的程式,在Dockerfile中會將該資料匣複製到Docker Image中</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">k8s/ : 放置k8s的deployment與service描述檔</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Dockerfile : 封裝docker的描述檔,會以node.js的image為基礎來建置執行環境</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cloudbuild.yaml : Google Cloud Build Trigger的步驟描述檔</span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">建置的流程大致描述如下:</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
</div>
<b style="font-weight: normal;"><br /></b>
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">當程式碼push至github後,會觸發hook(由source repository建立的)到GCP source repository</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Source repository更版後,會觸發Cloud Build Trigger來執行cloudbuild.yaml裡面的設定步驟</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cloudbuild.yaml步驟一:建置image,並上傳到gcr.io registry</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cloudbuild.yaml步驟二:觸發GKE上的版本更新</span></div>
</li>
</ul>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">下面針對整個建置步驟描述...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Step1: 建立GCP對應的Source Repository</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="300" src="https://lh3.googleusercontent.com/StN8iB65CUyh2-UZkA8A_wtBLFz22gE1w_ZVLUYJqzT-IhZYfQHi71S4KyfYshNk9LP9uMFrQXygRij77KMRgoHqum-1FgrpZnEl6Wh8SMZRJcAkIdEDWI_xgzrZKlpQL3QsdL9g" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="642" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">由於我們想要直接連動Github上的Repo,這邊選擇Github的Source Code Repo位置...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="303" src="https://lh3.googleusercontent.com/jHfOgV9PphZqDtY83Nrjubx8lIXbKYz4JrySBZMgTiHOo-xrGUtlOFf6Le-s4vAgeH4KopHJAKiA2f2Z_zmaBPsdPg38egva5tPGG0d1yF5r86VOlAoJCH_GaFPWH5VOEL3CfgWZ" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="642" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Step2: 建立Build Trigger,在這邊選擇複製自Github的Cloud Source Repository</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="297" src="https://lh4.googleusercontent.com/HxlFAn0ZhZpXaGMyBJoNaUBXI1fM8kyhuNqULu9xAP1pN94KasthKTIMxO1i_EAqUeDeQHoLrbWicQXg7HUUcDgPpZstsbusQRy7K3GD9spZq7-cLRKBYRS_GqUetvaPvHaZHUuX" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="642" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">然後選擇要建置的Cloud Repository (有filter還滿貼心的^^)</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="367" src="https://lh3.googleusercontent.com/jyxLaP3jVwPRnWtMqlHKl01zKkeWXf2-PIRpXPC4F2s2rH_33dFCzAggFR-xMdUMeQOSTF__zys6seF87l2dMbmfvvGos3alNn1dxmytwp7DTqrPlzqKXLBpEc-jk22aCXjcCHvn" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="642" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">設定Build參數,指定使用自建的cloudbuild.yaml檔案來建置... 另外,Trigger Type部分,選擇Tag Build,並設定Tag Pattern為”v.*”,來聆聽符合該Tag形式的Build動作。</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="508" src="https://lh4.googleusercontent.com/Z3W_ZIvhfryc1sNDKnxdUQLXzc_nAUUGnXH4YVde56VfkXSGt3gP56UcX_LTEcWeyK_P_fSfQJIyBwEhHUoyrTake4xlF7v1W90_gRh5vcGIFrUc2pFLzcBY1vGkpsKAMOP_MPYO" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="642" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">設定的部分就這樣,頗簡單吧... 接下來可以驗證一下設定是否正確...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">剛設定的部分是只針對您的專案建立”v”開頭的tag,即可觸發建置及部署的動作,我們可以實際tag一個v開頭的tag版本,然後可以在Build History中看到建置的過程紀錄與狀態...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">git tag v20170928</span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.001</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">git </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">push</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> origin v20170928</span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.001</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">檢視一下Build History...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img height="463" src="https://lh4.googleusercontent.com/Km4u4LVoQZLwHWoqT_oTWd81Udu_8ohjT8A7O8GWIoSv1cNWRS6McYMONgflRNkszkdT5ZN_tJwMOOmg_j8HrZ-CyTslJpQ2CpT7hPRfPdf907FDXELG_o6P_jFe1T50G-Tuedaz" style="-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);" width="642" /></span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">如果一切無誤,可以在Status欄位看到Successful… 如果失敗,也沒關係,看一下每個步驟的log,確認一下失敗原因,排除後可以rebuild看看 :D</span></div>
<b style="font-weight: normal;"><br /></b><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">參考:</span></div>
<br />
<ul style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cloud Builder的工具Image: </span><a href="https://github.com/GoogleCloudPlatform/cloud-builders" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://github.com/GoogleCloudPlatform/cloud-builders</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Cloud Builder進階建置文件:</span><a href="https://cloud.google.com/container-builder/docs/concepts/custom-build-steps" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://cloud.google.com/container-builder/docs/concepts/custom-build-steps</span></a><span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span></div>
</li>
</ul>
k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-23841495968738218302017-09-03T06:56:00.002-07:002017-09-03T06:56:53.499-07:00使用Cloud Registry - gcr.io來儲存您的docker image<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Google提供每一個Cloud專案一個專屬的gcr.io registry作為docker image的存放地,透過gcr.io可以無限存放您的image,並且有提供簡單的查詢介面供使用者檢視所儲存的image與相關tag… 近一步使用將可透過與其他服務的串連,達到更多樣化的應用~</span></div>
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">從使用流程了解gcr.io</span></h2>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">在使用前,我們先來檢視gcr.io的使用流程</span></div>
<b id="docs-internal-guid-18fdf1f4-4807-201c-d98d-5279a546068e" style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Step 1 - 幫你的image製作tag</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">docker</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> tag</span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> [your-image] gcr.io/[your-project-id]/[your-image-name]</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Step 2 - Push image到gcr.io</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">gcloud docker - </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">push</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> gcr.io</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/[your-project-id]/</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[your-image-name]</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">下面實際使用一個Dockerfile來作為範例,存放到gcr.io上...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">首先,透過node.js的express套件來建立專案... [參考: https://expressjs.com/en/starter/installing.html]</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ mkdir myproject && cd myproject && express -e web</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> warning: option `--ejs</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">' has been renamed to `--view=ejs'</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">package</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.json</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/app.js</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/javascripts</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">│ │ ├── </span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">destroy@</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">1.0.4</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/images</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/stylesheets</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/stylesheets/style.css</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/routes</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/routes/index.js</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/routes/users.js</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/views</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/views/index.ejs</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/views/error.ejs</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/bin</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> create : web/bin/www</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> install dependencies:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> $ cd web && npm install</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> run the app:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> $ DEBUG=web:* npm start</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">接下來我們在myproject下面建立Dockerfile檔案</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">From</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> node</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ADD</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> web /app</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">WORKDIR</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> /app</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RUN</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> npm install</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">CMD</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> [</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"npm"</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">,</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"start"</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">]</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">然後開始build這個Dockerfile,過程中docker會將Dockerfile中每一行建置成image中的一個layer,如果一切沒問題,則會在系統中新增一個”myweb”的image...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> docker build -t myweb .</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Sending build context to Docker daemon 16.9 kB</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Step 1 : FROM node</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">latest: Pulling from library/node</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ad74af05f5a2: Pull complete</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2b032b8bbe8b: Pull complete</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">a9a5b35f6ead: Pull complete</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">49fb60496f63: Pull complete</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">3894583bc464: Pull complete</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">321f9e1d7334: Pull complete</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">cdf9ffbab3ff: Pull complete</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">a76a49ec92c8: Pull complete</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Digest: sha256:0adc410aa5e45b817bc8f29d5845c4941ad03b63e9584bc7f8654562e60424cf</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Status: Downloaded newer image for node:latest</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ---></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 60bea5b86079</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Step 2 : ADD web /app</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ---></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> c2db2b5f5fd9</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Removing intermediate container 287af85ca8f5</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Step 3 : WORKDIR /app</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ---></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Running </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 415faf475d84</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ---></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 0ff5af512bc8</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Removing intermediate container 415faf475d84</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Step 4 : RUN npm install</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ---></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Running </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> af9958080502</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">npm info it worked if it ends with ok</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">npm info using npm@5.3.0</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">...</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">npm info lifecycle undefined~postshrinkwrap: undefined</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">added 63 packages in 14.524s</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">npm info ok </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ---></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> b002146466c3</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Removing intermediate container af9958080502</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Step 5 : CMD npm start</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ---></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Running </span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ebb282a74539</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> ---></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> 19057465c4c6</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Removing intermediate container ebb282a74539</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Successfully built 19057465c4c6</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">我們可以透過”docker images”來查詢新的image是否建置完成...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">假設一切無誤,接著,我們可以透過上面所說的兩個步驟來將image存放至gcr.io…</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ docker tag myweb gcr.io/mitac-simonsu-</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2017</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/myweb</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$ gcloud docker -- push gcr.io/mitac-simonsu-</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2017</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/myweb</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The push refers to a repository [gcr.io/mitac-simonsu-</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2017</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/myweb]</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">5953068074</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">de:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Pushing [==================================================>] </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4.235</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> MB</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">4</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">a296490096d:</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> Pushed</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">…(skip)</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">2c40c66f7667: Pushed</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">latest: digest: sha256:394c8ef825ad3a1aa...39b27ae61e8cd38d500cf size: 2425</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">當push完成,我們可以檢視一下目前image的狀況...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">首先確認一下是否image已經上傳...</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">image list 指令</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">gcloud container images </span><span style="background-color: #f0f0f0; color: #397300; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">list</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">執行範例</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> gcloud container images list</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">NAME</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">gcr.io/mitac-simonsu-2017/demo</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">gcr.io/mitac-simonsu-2017/demoweb</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">gcr.io/mitac-simonsu-2017/jenkins-slave</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">gcr.io/mitac-simonsu-2017/mytest</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">gcr.io/mitac-simonsu-2017/myweb</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">gcr.io/mitac-simonsu-2017/peihsinsu</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">gcr.io/mitac-simonsu-2017/web2</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Only listing images in gcr.io/mitac-simonsu-2017. Use --repository to list images in other repositories.</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">如果上傳無誤,則可以透過list-tags來檢視該image下是否有其他tag存在</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">list-tags指令</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">gloud container images list-tags gcr.io</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/[project-id]/</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[image-name]</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">執行範例</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #1f7199; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> gcloud container images list-tags gcr.io/mitac-simonsu-2017/myweb</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">DIGEST TAGS TIMESTAMP</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">394c8ef825ad latest 2017-09-03T19:43:57</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">要使用該image的話,如果是GKE環境,則可以直接使用,如果是透過docker或外部環境,則可以透過gcloud來認證docker,讓docker具備gcr.io的存取權限。</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup></colgroup><tbody>
<tr style="height: 0pt;"><td style="background-color: #f0f0f0; padding: 5pt 5pt 5pt 5pt; vertical-align: top;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">docker login -u oauth2accesstoken \</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> -p </span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"</span><span style="background-color: #f0f0f0; color: #bc6060; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">$(gcloud auth application-default print-access-token)</span><span style="background-color: #f0f0f0; color: #880000; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"</span><span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> \</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: #f0f0f0; color: #444444; font-family: Consolas; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> https://gcr.io</span></div>
</td></tr>
</tbody></table>
</div>
<b style="font-weight: normal;"><br /></b><br />
<h2 dir="ltr" style="line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;">
<span style="background-color: transparent; color: black; font-family: Arial; font-size: 16pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">參考</span></h2>
<span style="font-family: Arial; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">使用gcloud認證docker指令: </span><a href="https://cloud.google.com/container-registry/docs/advanced-authentication" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: Arial; font-size: 11pt; text-decoration-line: underline; vertical-align: baseline; white-space: pre-wrap;">https://cloud.google.com/container-registry/docs/advanced-authentication</span></a><span style="font-family: Arial; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;"> </span>k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-5758828589661397662017-09-03T04:13:00.000-07:002017-09-03T04:20:09.948-07:00Using docker slave with JenkinsJenkins是一套常用的CICD管理工具,在Container的世界中,要透過Container來操作Jenkins將讓Jenkins變得更方便... 下面是以docker模式啟動常駐型的jenkins slave的方式... <br /><br />首先,我們先透過Jenkins的管理介面來建立新永久節點,這邊要選擇”Permanent Agent”部分<br /><br /><img height="224" src="https://lh3.googleusercontent.com/UkbsxrashqK1F7t017pAuHHCfoz9YlRNvcaWgB4PxAG2K1xz8LeUYVfXML-DDh4M0v0T3Q0MWDlalwyz29VxYO4hUJKHwf7pN-yhw52aE7OJXdetEZDecfpz1pOZqe7y7qQcFrQ0" width="640" /> <br /><br /><br />接著設定該常駐節點的細部設定,包含執行程式數量與目錄等... <br /><br /><br /><img height="255" src="https://lh5.googleusercontent.com/WJAwZtaZPqq4q7hFK0h48KgrlhKKfOh9ipE3dwu6SkP9K6up1AnzFu7hutBF6sv7M48ZOxBfzyHSbKKDTJXQpNVoUcIEDA3Pv_G8VeGUCvzx07yga7cLryVQgQYYGHIe4yKMfigC" width="640" /> <br />設定完後(test-slave),該節點暫時會在無法服務的狀態,我們直接在該slave的名稱上點選進入節點的設定畫面... <br /><br /><img height="210" src="https://lh5.googleusercontent.com/GAXhlpDepuXV-VfwV-2bkOWdAudtdTVrzEYEsOFXPFsFslbsmLL5dXBdm-lYjPx6O81mJ5qbL-4P8T-6MzvuTp8gIsV6xfn_NrJTD15gLr2JKp3D5RFeaXz45hvUBPjVkZaWa5Aa" width="640" /> <br /><br />再詳細設定畫面中,我們可以看到該slave的secret資訊與agent的名稱,這部分可以用來當作之後我們啟動slave的參數... <br /><br /><img height="190" src="https://lh3.googleusercontent.com/nCN4s28AhvaVB4eXS9eRShAmiNwz3gCzClWxIA2IKomMBGNsiH4AwHVEaPw15Sryz6kOpQ9VEXgApAnljnpDti2NnNj_1MiWobV2rkO1qhEa5_bYOackjafXP_ZQ6kBhXb6PvXwK" width="640" /> <br /><br />有了agent的名稱與參數,我們可以透過下面指令啟動slave,然後提供jenkins使用... <br /><br />docker run jenkinsci/jnlp-slave -url http://jenkins-server:port <br /><br />ex: <br />docker run -d jenkinsci/jnlp-slave \<br />-url http://104.199.165.255:8080 \<br />1fe32ff0841d49cf324748d50e08257e79f9cbdf3c3f673ffa780e4f6ddf2a32 \<br />test-slave <br /><br />參考:<a href="https://github.com/jenkinsci/docker-jnlp-slave">https://github.com/jenkinsci/docker-jnlp-slave</a> k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-51982173687955058552016-08-30T19:47:00.002-07:002017-09-03T04:20:09.944-07:00查詢使用某個image的instances<h1 style="-webkit-user-select: text; background-color: white; box-sizing: border-box; break-after: avoid; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 0.2px; line-height: 1.1; margin-bottom: 0.85em; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;">
<span style="font-size: 14px; font-weight: normal; letter-spacing: 0.2px; line-height: 23.8px; orphans: 3; widows: 3;">在Docker中,要查詢所有process很簡單,docker ps就會返回所有執行中的列表,也可以加上-a參數來show所有不管關閉或開啟的機器列表... 而如果希望找到由某個image開起來的instances,可以透過filter + ancestor來做到...</span></h1>
<pre style="-webkit-user-select: text; background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; cursor: text; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.2px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="-webkit-user-select: text; background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; cursor: text; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker ps -f ancestor=[image_name]
</code></pre>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
範例:</div>
<pre style="-webkit-user-select: text; background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; cursor: text; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.2px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="-webkit-user-select: text; background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; cursor: text; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker ps -f ancestor=registry:2
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
54689a3084a4 registry:2 "/bin/registry /etc/d" 6 weeks ago Up 13 hours 0.0.0.0:80->5000/tcp registry
0bcb6beac991 registry:2 "/bin/registry /etc/d" 7 weeks ago Up 13 hours 0.0.0.0:5000->5000/tcp mwciotdemo_registry_1
</code></pre>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
搭配filter也可以透過label的方式來查詢...</div>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
幫啟動的instance加上label...</div>
<pre style="-webkit-user-select: text; background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; cursor: text; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.2px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="-webkit-user-select: text; background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; cursor: text; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;"># docker run -d -l mynginx nginx
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
357ea8c3d80b: Pull complete
0fc04568277e: Pull complete
0bed9719ddcb: Pull complete
Digest: sha256:d33834dd25d330da75dccd8add3ae2c9d7b12302b421b02cecb6cb7b34a1b6
Status: Downloaded newer image for nginx:latest
09386387d9f0681935e01ff058023956cd8c61234344f60e8f4c4aedaaad853
</code></pre>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
透過filter以label的方式來找尋執行中的個體...</div>
<pre style="-webkit-user-select: text; background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; cursor: text; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.2px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="-webkit-user-select: text; background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; cursor: text; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;"># docker ps -f label=mynginx
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
09386387d9f0 nginx "nginx -g 'daemon off" 17 seconds ago Up 17 seconds 80/tcp, 443/tcp determined_swirles
</code></pre>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; orphans: 3; widows: 3;">
以上,搭配filter來做查詢可以減少很多處理上的麻煩,推薦大家善用filter唷~</div>
k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-24243331528303892932016-08-29T18:24:00.002-07:002016-08-29T18:24:25.459-07:00網路監測工具之前用過vnstat... 不過,看起來好多可以用的唷~ 有興趣可以參考:<br />
<br />
http://www.binarytides.com/linux-commands-monitor-network/k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-22781369677168892222016-06-30T02:01:00.003-07:002016-06-30T02:01:23.677-07:00使用CloudFlare來加上SSL<h1 style="-webkit-user-select: text; background-color: white; box-sizing: border-box; break-after: avoid; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 0.2px; line-height: 1.1; margin-bottom: 0.85em; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;">
<span style="font-size: 14px; font-weight: normal; letter-spacing: 0.2px; line-height: 23.8px; orphans: 3; widows: 3;">如果您在建置docker registry的過程中,常因為沒有HTTPS而要去設定client端的docker啟動方式,那這招一定要學一下!</span></h1>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
下面使用apache htpasswd的認證方式,然後透過80 port不加上ssl key,由CloudFlare來提供SSL憑證,這樣Client端就不會在操作的時候報錯,</div>
<h2 style="-webkit-user-select: text; background-color: white; box-sizing: border-box; break-after: avoid; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.2px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Setting CloudFlare</h2>
<h3 style="-webkit-user-select: text; background-color: white; box-sizing: border-box; break-after: avoid; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.5em; letter-spacing: 0.2px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Enable Flexible SSL</h3>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
在Crypto > SSL頁面,我們可以設定SSL成為Flexible,這樣的設定可以直接針對80 port的非SSL頁面加上SSL的功能,操作畫面如下:</div>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
<img alt="Flexible SSL" id="img11990" src="blob:file%3A///5b0cce76-b876-4cfb-a445-c33e88be6128" style="-webkit-user-select: text; border: 0px; box-sizing: border-box; cursor: text; font-size: inherit; max-width: 100%; page-break-inside: avoid;" /></div>
<h3 style="-webkit-user-select: text; background-color: white; box-sizing: border-box; break-after: avoid; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.5em; letter-spacing: 0.2px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Enable CDN</h3>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
接下來需要設定Record並啟動CDN的功能,也就是把Status的雲點一下,他會呈現流量過雲的圖示,這樣就可以直接Enable CDN,接下來ping這個domain name的話,IP就會先繞到CloudFlare。</div>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
<img alt="Enable CDN" id="img11991" src="blob:file%3A///ea0c40a2-dd19-4f4c-9efd-66f7e6357ef8" style="-webkit-user-select: text; border: 0px; box-sizing: border-box; cursor: text; font-size: inherit; max-width: 100%; page-break-inside: avoid;" /></div>
<h2 style="-webkit-user-select: text; background-color: white; box-sizing: border-box; break-after: avoid; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.2px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Create the htpasswd file</h2>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
接下來的動作跟前面介紹差不多,首先先準備您的密碼檔... 指令如下:</div>
<pre style="-webkit-user-select: text; background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; cursor: text; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.2px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="-webkit-user-select: text; background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; cursor: text; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker run --entrypoint htpasswd registry:2 -Bbn [username] [password] >> /data/registry-auth/htpasswd
</code></pre>
<h2 style="-webkit-user-select: text; background-color: white; box-sizing: border-box; break-after: avoid; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.2px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Run registry</h2>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
接下來可以透過docker啟動你的registry... 下面的compose file的volumes部分將會直接載入上面所產生的htpasswd檔案,作為認證資料庫... 另外,registry-data是未來存放image的實際位置,透過這個設定可以讓下次重新啟動的image不會遺失資料...</div>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
docker-compose.yml:</div>
<pre style="-webkit-user-select: text; background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; cursor: text; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.2px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="-webkit-user-select: text; background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; cursor: text; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">registry:
restart: always
image: registry:2
ports:
- 80:5000
environment:
- "REGISTRY_AUTH=htpasswd"
- "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm"
- "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd"
volumes:
- /data/registry-data:/var/lib/registry
- /data/registry-auth:/auth
</code></pre>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
啟動(移到跟上面檔案同個目錄下,在執行下面指令):</div>
<pre style="-webkit-user-select: text; background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; cursor: text; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.2px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="-webkit-user-select: text; background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; cursor: text; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker-compose up -d
</code></pre>
<h2 style="-webkit-user-select: text; background-color: white; box-sizing: border-box; break-after: avoid; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1.75em; letter-spacing: 0.2px; line-height: 1.1; margin-bottom: 0.85em; margin-top: 1.275em; orphans: 3; widows: 3;">
Login your registry</h2>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
在client端註冊您的client可以登入該registry...</div>
<pre style="-webkit-user-select: text; background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; cursor: text; direction: ltr; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.2px; line-height: 1.42857; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="-webkit-user-select: text; background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; cursor: text; direction: ltr; display: inline; font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker login [your.domain.name]
docker tag [your-image-name] [your.domain.name]/[your-image-name]
docker push [your.domain.name]/[your-image-name]</code></pre>
k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-51451869065331678572016-02-26T02:26:00.003-08:002016-02-26T02:26:32.433-08:00Docker Image空間上的巧思<h1 style="-webkit-user-select: text; background-color: white; box-sizing: border-box; break-after: avoid; color: #333333; cursor: text; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; letter-spacing: 0.2px; line-height: 1.1; margin-bottom: 0.85em; margin-left: 0px; margin-right: 0px; margin-top: 0px !important;">
Docker Image空間上的巧思</h1>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
Docker image在儲存時候也是以layer的方式儲存,因此在每個RUN都可以完整的保存中間的紀錄,但是往往也造成其他問題... 例如image空間非常巨大... From一個大的Image通常只會更大,小不下來...</div>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
例如:</div>
<pre style="-webkit-user-select: text; background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; cursor: text; direction: ltr; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.2px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="-webkit-user-select: text; background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; cursor: text; direction: ltr; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">From centos
RUN wget http://xxxx.xxxx/xxx.data #假設這裡有5G
RUN rm xxx.data #本來以為會把5G刪掉
</code></pre>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
在上面的build file中,通常image build起來還會是5G...</div>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
下面是網路上找到可以Flatten Image的方式,透過簡單的export/import就可以讓之間的空間巧妙的縮減下來唷:</div>
<pre style="-webkit-user-select: text; background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; cursor: text; direction: ltr; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.2px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="-webkit-user-select: text; background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; cursor: text; direction: ltr; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">docker export <container id=""> | docker import - some-image-name:latest
</container></code></pre>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; margin-bottom: 0.85em; orphans: 3; widows: 3;">
如果要完整地把Image在建置時候就最小化,可以修改dockerfile:</div>
<pre style="-webkit-user-select: text; background: rgb(247, 247, 247); border-radius: 4px; border: none; box-sizing: border-box; break-inside: avoid; color: #333333; cursor: text; direction: ltr; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; letter-spacing: 0.2px; line-height: 1.42857; margin-bottom: 1.275em; overflow: auto; padding: 0.85em 1em; word-break: break-all; word-wrap: normal;"><code style="-webkit-user-select: text; background: 0px 0px; border-radius: 0px; border: none; box-sizing: border-box; break-inside: avoid; color: inherit; cursor: text; direction: ltr; display: inline; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 0.85em; line-height: inherit; margin: 0px; max-width: initial; overflow: initial; padding: 0px;">From centos
RUN wget http://xxxx.xxxx/xxx.data &&\
rm xxx.data
</code></pre>
<div style="-webkit-user-select: text; background-color: white; box-sizing: border-box; color: #333333; cursor: text; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; letter-spacing: 0.2px; line-height: 23.8px; orphans: 3; widows: 3;">
在一個RUN下面只會有一次的commit,就會有效的縮小image的空間唷~</div>
k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-41580119800609384492015-10-21T08:56:00.001-07:002015-10-21T08:57:52.997-07:00lsync - 簡單操作的Linux同步服務<h1 id="lsync-簡單操作的linux同步服務">lsync - 簡單操作的Linux同步服務</h1>
<p>lsync是一個可以基於rsync傳輸的同步服務,他的好處是可以透過一個簡單的設定檔,即可完成自動化同步作業,讓管理上非常簡單。這邊簡單的以AWS與Google Cloud的兩台雲端主機進行同步作業:</p>
<ul>
<li>Remote: 54.172.25.83 (AWS US-East/N.Virginia)</li>
<li>Local: 130.211.248.60 (GCE asia-east1-c)</li>
</ul>
<h2 id="安裝lsync">安裝lsync</h2>
<p>Debian系列:</p>
<pre class="prettyprint"><code class=" hljs lasso">apt<span class="hljs-attribute">-get</span> update
apt<span class="hljs-attribute">-get</span> install git <span class="hljs-attribute">-y</span>
apt<span class="hljs-attribute">-get</span> install cmake <span class="hljs-attribute">-y</span>
apt<span class="hljs-attribute">-get</span> install build<span class="hljs-attribute">-essential</span> <span class="hljs-attribute">-y</span>
apt<span class="hljs-attribute">-get</span> install lua5<span class="hljs-number">.2</span>
apt<span class="hljs-attribute">-get</span> install liblua5<span class="hljs-number">.2</span><span class="hljs-attribute">-dev</span> <span class="hljs-attribute">-y</span>
git clone https:<span class="hljs-comment">//github.com/axkibe/lsyncd.git</span>
cd lsyncd
cmake <span class="hljs-attribute">-DCMAKE_INSTALL_PREFIX</span><span class="hljs-subst">=</span>/usr/<span class="hljs-built_in">local</span>/lsyncd<span class="hljs-subst">-</span><span class="hljs-number">2.1</span><span class="hljs-number">.5</span>
make <span class="hljs-subst">&&</span> make install</code></pre>
<p>CentOS系列需要自行下載rpm安裝,可以參考附錄的文件:</p>
<h2 id="執行範例">執行範例</h2>
<p>範例設定檔,在這邊是使用rsync的方式作為傳輸方法~</p>
<pre class="prettyprint"><code class=" hljs bash">settings {
logfile =<span class="hljs-string">"/usr/local/lsyncd-2.1.5/var/lsyncd.log"</span>,
statusFile =<span class="hljs-string">"/usr/local/lsyncd-2.1.5/var/lsyncd.status"</span>,
inotifyMode = <span class="hljs-string">"CloseWrite"</span>,
maxProcesses = <span class="hljs-number">8</span>,
}
sync {
default.rsync,
<span class="hljs-built_in">source</span> = <span class="hljs-string">"/var/www/html"</span>,
target = <span class="hljs-string">"ec2-user@54.172.25.83:/home/ec2-user/backup"</span>,
maxDelays = <span class="hljs-number">5</span>,
delay = <span class="hljs-number">30</span>,
rsync = {
binary = <span class="hljs-string">"/usr/bin/rsync"</span>,
archive = <span class="hljs-literal">true</span>,
compress = <span class="hljs-literal">true</span>,
bwlimit = <span class="hljs-number">2000</span>
}
}</code></pre>
<p>其他需要設定的地方包含:</p>
<ul>
<li>建立SSH Key,並且同步到遠端主機</li>
<li>使用此SSH Key登入一次</li>
</ul>
<p>執行設定:</p>
<pre class="prettyprint"><code class=" hljs lua"># /usr/<span class="hljs-keyword">local</span>/lsyncd-<span class="hljs-number">2.1</span><span class="hljs-number">.5</span>/bin/lsyncd -log all\
/usr/<span class="hljs-keyword">local</span>/lsyncd-<span class="hljs-number">2.1</span><span class="hljs-number">.5</span>/etc/lsyncd.conf</code></pre>
<h2 id="參考">參考</h2>
<ul>
<li>Github: <a href="https://github.com/axkibe/lsyncd">https://github.com/axkibe/lsyncd</a></li>
<li>中文文獻: <a href="http://seanlook.com/2015/05/06/lsyncd-synchronize-realtime/">http://seanlook.com/2015/05/06/lsyncd-synchronize-realtime/</a></li>
<li>My Git: <a href="https://github.com/qeek-dockerfiles/lsyncd">https://github.com/qeek-dockerfiles/lsyncd</a></li>
</ul>k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-78673185065178749302015-10-12T19:16:00.004-07:002015-10-12T19:29:25.371-07:00Test upload常用的兩個方法常常忘記,還是寫下來好了...<br />
<br />
<br />
<b>Step1: Configure your upload</b><br />
<br />
Reference: https://github.com/expressjs/multer<br />
<br />
<b><br /></b>
<b>Step2: Make a route for receive upload</b><br />
<br />
<blockquote class="tr_bq">
router.post('/uploadtest', function(req, res, next) {<br />
res.end('done...');<br />
});</blockquote>
<br />
<br />
<b>Step3: Testing</b><br />
<br />
Upload using curl:<br />
<br />
<br />
<blockquote class="tr_bq">
curl -F "image=@/Users/peihsinsu/Pictures/pic2.png" http://localhost:3000/uploadtest -X POST</blockquote>
<br />
<br />
Upload using upload form:<br />
<br />
<blockquote class="tr_bq">
<form method="post" action="/uploadtest" name="submit" enctype="multipart/form-data"><br /> <input type="file" name="fileField"><br /><br /><br /> <input type="submit" name="submit" value="Submit"><br /></form></blockquote>
<h2 style="border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 24px; letter-spacing: 1px; line-height: 38px; margin: 0px 0px 10px; padding: 0px; text-rendering: optimizeLegibility;">
</h2>
<h1 style="font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 28px; line-height: 44px; margin: 0px 0px 10px; padding: 0px; text-rendering: optimizeLegibility;">
<pre style="background-color: #f8f8f8; border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 13px; font-weight: normal; line-height: 19px; margin-bottom: 15px; margin-top: 15px; overflow: auto; padding: 6px 10px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;"></pre>
</h1>
k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-2883893355638298932015-09-03T19:35:00.001-07:002015-09-03T19:35:48.605-07:00電子郵件夾錢~這是什麼概念啊!!<div dir="ltr">偶然中發現,Gmail可以夾錢給收件人唷!這概念還真不賴... 哪時候有人夾錢給我呢@@<div><br> <div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmtr8zC-im8Gn05e_v1iWOLSwT44TzMeVDCAPRI2jjRm8tGAhHXS9V6uIpavcyR1pEDNB6sTGP-OWLW9V_i-Sm6CS4l-RbRYfYzb4ljktMfu8AlvVlvvnofUVPLEA_ApTQhfN87d9hf1rl/s1600/image-748606.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmtr8zC-im8Gn05e_v1iWOLSwT44TzMeVDCAPRI2jjRm8tGAhHXS9V6uIpavcyR1pEDNB6sTGP-OWLW9V_i-Sm6CS4l-RbRYfYzb4ljktMfu8AlvVlvvnofUVPLEA_ApTQhfN87d9hf1rl/s320/image-748606.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6190483034096262610" /></a><br></div><div><br></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh86J3_7MwJn3SEgQZZSua-x69PbrMFkW5TGnv4ikMcDv9rJYfzW2gJdId8XVb90WjyiGYKXjnopiQe5eEkm-7619KopZJvC8RysiudeJ6lVofnZV-YQrzEDd0xEXsl-XpDdP1QTeGqXbvr/s1600/image-752189.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh86J3_7MwJn3SEgQZZSua-x69PbrMFkW5TGnv4ikMcDv9rJYfzW2gJdId8XVb90WjyiGYKXjnopiQe5eEkm-7619KopZJvC8RysiudeJ6lVofnZV-YQrzEDd0xEXsl-XpDdP1QTeGqXbvr/s320/image-752189.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6190483045598578370" /></a><br></div><div><br></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6RKGhv-cIEtkZOpEe3uoaBAQ7YYy_zTf8HBsYpxO6I77LYqHD5-pd1a8N4Xcs31z7zTRqzCd12lGSgiz2KH_1PDXBarad6hGDRJjINIrSc-sR-WEk1J5EiX6KtQk4Jdw1ccazZhFdKgsG/s1600/image-754710.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6RKGhv-cIEtkZOpEe3uoaBAQ7YYy_zTf8HBsYpxO6I77LYqHD5-pd1a8N4Xcs31z7zTRqzCd12lGSgiz2KH_1PDXBarad6hGDRJjINIrSc-sR-WEk1J5EiX6KtQk4Jdw1ccazZhFdKgsG/s320/image-754710.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6190483057157563730" /></a><br></div></div></div> k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-52654015591662957072015-08-12T05:54:00.001-07:002015-08-12T05:54:37.995-07:00You've been added as a contact on Cotap<style type="text/css"> /********************************************** * Ink v1.0.5 - Copyright 2013 ZURB Inc * **********************************************/ /* Client-specific Styles & Reset */ #outlook a { padding: 0; } body { width: 100% !important; min-width: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; margin: 0; padding: 0; } /* .ExternalClass applies to Outlook.com (the artist formerly known as Hotmail) */ .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } #backgroundTable { margin: 0; padding: 0; width: 100% !important; line-height: 100% !important; } img { outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; width: auto; max-width: 100%; float: left; clear: both; display: block; } center { width: 100%; min-width: 500px; } a img { border: none; } p { margin: 0 0 0 10px; } table { border-spacing: 0; border-collapse: collapse; } td { word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; } table, tr, td { padding: 0; vertical-align: top; text-align: left; } hr { color: #d9d9d9; background-color: #d9d9d9; height: 1px; border: none; } /* Responsive Grid */ table.body { height: 100%; width: 100%; } table.container { width: 500px; margin: 0 auto; text-align: inherit; } table.row { padding: 0px; width: 100%; position: relative; } table.container table.row { display: block; } td.wrapper { padding: 5px 20px 0px 0px; position: relative; } table.columns, table.column { margin: 0 auto; } table.columns td, table.column td { padding: 0px 0px 5px; } table.columns td.sub-columns, table.column td.sub-columns, table.columns td.sub-column, table.column td.sub-column { padding-right: 10px; } td.sub-column, td.sub-columns { min-width: 0px; } table.row td.last, table.container td.last { padding-right: 0px; } table.one { width: 23.33333px; } table.two { width: 66.66667px; } table.three { width: 110px; } table.four { width: 153.33333px; } table.five { width: 196.66667px; } table.six { width: 240px; } table.seven { width: 283.33333px; } table.eight { width: 326.66667px; } table.nine { width: 370px; } table.ten { width: 413.33333px; } table.eleven { width: 456.66667px; } table.twelve { width: 500px; } table.one center { min-width: 23.33333px; } table.two center { min-width: 66.66667px; } table.three center { min-width: 110px; } table.four center { min-width: 153.33333px; } table.five center { min-width: 196.66667px; } table.six center { min-width: 240px; } table.seven center { min-width: 283.33333px; } table.eight center { min-width: 326.66667px; } table.nine center { min-width: 370px; } table.ten center { min-width: 413.33333px; } table.eleven center { min-width: 456.66667px; } table.twelve center { min-width: 500px; } table.one .panel center { min-width: 3.33333px; } table.two .panel center { min-width: 46.66667px; } table.three .panel center { min-width: 90px; } table.four .panel center { min-width: 133.33333px; } table.five .panel center { min-width: 176.66667px; } table.six .panel center { min-width: 220px; } table.seven .panel center { min-width: 263.33333px; } table.eight .panel center { min-width: 306.66667px; } table.nine .panel center { min-width: 350px; } table.ten .panel center { min-width: 393.33333px; } table.eleven .panel center { min-width: 436.66667px; } table.twelve .panel center { min-width: 480px; } .body .columns td.one, .body .column td.one { width: 8.33333%; } .body .columns td.two, .body .column td.two { width: 16.66667%; } .body .columns td.three, .body .column td.three { width: 25%; } .body .columns td.four, .body .column td.four { width: 33.33333%; } .body .columns td.five, .body .column td.five { width: 41.66667%; } .body .columns td.six, .body .column td.six { width: 50%; } .body .columns td.seven, .body .column td.seven { width: 58.33333%; } .body .columns td.eight, .body .column td.eight { width: 66.66667%; } .body .columns td.nine, .body .column td.nine { width: 75%; } .body .columns td.ten, .body .column td.ten { width: 83.33333%; } .body .columns td.eleven, .body .column td.eleven { width: 91.66667%; } .body .columns td.twelve, .body .column td.twelve { width: 100%; } td.offset-by-one { padding-left: 43.33333px; } td.offset-by-two { padding-left: 86.66667px; } td.offset-by-three { padding-left: 130px; } td.offset-by-four { padding-left: 173.33333px; } td.offset-by-five { padding-left: 216.66667px; } td.offset-by-six { padding-left: 260px; } td.offset-by-seven { padding-left: 303.33333px; } td.offset-by-eight { padding-left: 346.66667px; } td.offset-by-nine { padding-left: 390px; } td.offset-by-ten { padding-left: 433.33333px; } td.offset-by-eleven { padding-left: 476.66667px; } td.expander { visibility: hidden; width: 0px; padding: 0 !important; } table.columns .text-pad, table.column .text-pad { padding-left: 20px; padding-right: 20px; } table.columns .left-text-pad, table.columns .text-pad-left, table.column .left-text-pad, table.column .text-pad-left { padding-left: 20px; } table.columns .right-text-pad, table.columns .text-pad-right, table.column .right-text-pad, table.column .text-pad-right { padding-right: 20px; } /* Block Grid */ .block-grid { width: 100%; max-width: 500px; } .block-grid td { display: inline-block; padding: 10px; } .two-up td { width: 230px; } .three-up td { width: 146px; } .four-up td { width: 105px; } .five-up td { width: 80px; } .six-up td { width: 63px; } .seven-up td { width: 51px; } .eight-up td { width: 42px; } /* Alignment & Visibility Classes */ table.center, td.center { text-align: center; } h1.center, h2.center, h3.center, h4.center, h5.center, h6.center, p.center { text-align: center; } span.center { display: block; width: 100%; text-align: center; } img.center { margin: 0 auto; float: none; } .show-for-small, .hide-for-desktop { display: none; } /* Typography */ body, table.body, h1, h2, h3, h4, h5, h6, p, td { color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-weight: normal; padding: 0; margin: 0; text-align: left; line-height: 1.3; } h1, h2, h3, h4, h5, h6 { word-break: normal; } h1 { font-size: 40px; } h2 { font-size: 36px; } h3 { font-size: 32px; } h4 { font-size: 28px; } h5 { font-size: 24px; } h6 { font-size: 20px; } body, table.body, p, td { font-size: 14px; line-height: 19px; } p.lead, p.lede, p.leed { font-size: 18px; line-height: 21px; } p { margin-bottom: 10px; } small { font-size: 10px; } a { color: #2ba6cb; text-decoration: none; } a:hover { color: #2795b6 !important; } a:active { color: #2795b6 !important; } a:visited { color: #2ba6cb !important; } h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: #2ba6cb; } h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active { color: #2ba6cb !important; } h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited { color: #2ba6cb !important; } /* Panels */ .panel { background: #f2f2f2; border: 1px solid #d9d9d9; padding: 10px !important; } .sub-grid table { width: 100%; } .sub-grid td.sub-columns { padding-bottom: 0; } /* Buttons */ table.button, table.tiny-button, table.small-button, table.medium-button, table.large-button { width: 100%; overflow: hidden; } table.button td, table.tiny-button td, table.small-button td, table.medium-button td, table.large-button td { display: block; width: auto !important; text-align: center; background: #2ba6cb; border: none none #2284a1; color: #ffffff; padding: 8px 0; } table.tiny-button td { padding: 5px 0 4px; } table.small-button td { padding: 8px 0 7px; } table.medium-button td { padding: 12px 0 10px; } table.large-button td { padding: 21px 0 18px; } table.button td a, table.tiny-button td a, table.small-button td a, table.medium-button td a, table.large-button td a { text-decoration: none; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; color: #ffffff; font-size: 16px; display: block; height: 100%; width: 100%; } table.tiny-button td a { font-size: 12px; font-weight: normal; } table.small-button td a { font-size: 16px; } table.medium-button td a { font-size: 20px; } table.large-button td a { font-size: 24px; } table.button:hover td, table.button:visited td, table.button:active td { background: #2795b6 !important; } table.button:hover td a, table.button:visited td a, table.button:active td a { color: #ffffff !important; } table.button:hover td, table.tiny-button:hover td, table.small-button:hover td, table.medium-button:hover td, table.large-button:hover td { background: #2795b6 !important; } table.button:hover td a, table.button:active td a, table.button td a:visited, table.tiny-button:hover td a, table.tiny-button:active td a, table.tiny-button td a:visited, table.small-button:hover td a, table.small-button:active td a, table.small-button td a:visited, table.medium-button:hover td a, table.medium-button:active td a, table.medium-button td a:visited, table.large-button:hover td a, table.large-button:active td a, table.large-button td a:visited { color: #ffffff !important; } table.secondary td { background: #e9e9e9; border-color: #d0d0d0; color: #555555; } table.secondary td a { color: #555555; } table.secondary:hover td { background: #d0d0d0 !important; color: #555555; } table.secondary:hover td a, table.secondary td a:visited, table.secondary:active td a { color: #555555 !important; } table.success td { background: #5da423; border-color: #457a1a; } table.success:hover td { background: #457a1a !important; } table.alert td { background: #c60f13; border-color: #970b0e; } table.alert:hover td { background: #970b0e !important; } table.radius td { -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } table.round td { -webkit-border-radius: 500px; -moz-border-radius: 500px; border-radius: 500px; } /* Outlook First */ body.outlook p { display: inline !important; } /* Media Queries */ @media only screen and (max-width: 517.24138px) { table[class="body"] img { width: auto !important; height: auto !important; } table[class="body"] center { min-width: 0 !important; } table[class="body"] .container { width: 95% !important; } table[class="body"] .row { width: 100% !important; display: block !important; } table[class="body"] .wrapper { display: block !important; padding-right: 0 !important; } table[class="body"] .columns, table[class="body"] .column { table-layout: fixed !important; float: none !important; width: 100% !important; padding-right: 0px !important; padding-left: 0px !important; display: block !important; } table[class="body"] .wrapper.first .columns, table[class="body"] .wrapper.first .column { display: table !important; } table[class="body"] table.columns td, table[class="body"] table.column td { width: 100% !important; } table[class="body"] .columns td.one, table[class="body"] .column td.one { width: 8.33333% !important; } table[class="body"] .columns td.two, table[class="body"] .column td.two { width: 16.66667% !important; } table[class="body"] .columns td.three, table[class="body"] .column td.three { width: 25% !important; } table[class="body"] .columns td.four, table[class="body"] .column td.four { width: 33.33333% !important; } table[class="body"] .columns td.five, table[class="body"] .column td.five { width: 41.66667% !important; } table[class="body"] .columns td.six, table[class="body"] .column td.six { width: 50% !important; } table[class="body"] .columns td.seven, table[class="body"] .column td.seven { width: 58.33333% !important; } table[class="body"] .columns td.eight, table[class="body"] .column td.eight { width: 66.66667% !important; } table[class="body"] .columns td.nine, table[class="body"] .column td.nine { width: 75% !important; } table[class="body"] .columns td.ten, table[class="body"] .column td.ten { width: 83.33333% !important; } table[class="body"] .columns td.eleven, table[class="body"] .column td.eleven { width: 91.66667% !important; } table[class="body"] .columns td.twelve, table[class="body"] .column td.twelve { width: 100% !important; } table[class="body"] td.offset-by-one, table[class="body"] td.offset-by-two, table[class="body"] td.offset-by-three, table[class="body"] td.offset-by-four, table[class="body"] td.offset-by-five, table[class="body"] td.offset-by-six, table[class="body"] td.offset-by-seven, table[class="body"] td.offset-by-eight, table[class="body"] td.offset-by-nine, table[class="body"] td.offset-by-ten, table[class="body"] td.offset-by-eleven { padding-left: 0 !important; } table[class="body"] table.columns td.expander { width: 1px !important; } table[class="body"] .right-text-pad, table[class="body"] .text-pad-right { padding-left: 20px !important; } table[class="body"] .left-text-pad, table[class="body"] .text-pad-left { padding-right: 20px !important; } table[class="body"] .hide-for-small, table[class="body"] .show-for-desktop { display: none !important; } table[class="body"] .show-for-small, table[class="body"] .hide-for-desktop { display: inherit !important; } } /********************************************** * Cotap Email v1.0.0 - Copyright 2013 Cotap * **********************************************/ body { background: #f7f7f7; } .body { background: #f7f7f7; } .pre-header { height: 0px; overflow: hidden; max-width: 0; display: none; float: left; } .center.body-td { padding: 15px; } header td.six.sub-columns { padding-bottom: 0px; } body p, body a { color: #333; } body h1, body h2, body h3, body h4, body h5, body h6, p, a { color: #db4c3a; font-family: "Avenir", Helvetica, Arial, Geneva, sans-serif; font-weight: 100; } h1 { font-size: 34px; line-height: 38px !important; } h2 { font-size: 32px; line-height: 36px !important; } h3 { font-size: 28px; line-height: 32px !important; } h4 { font-size: 26px; line-height: 30px !important; } h5 { font-size: 24px; line-height: 28px !important; } h6 { font-size: 18px; line-height: 22px !important; } body p { font-weight: 100; font-size: 14px; line-height: 24px; } body h1, body h2, body h3, body h4, body h5, body h6, body p { margin-bottom: 10px; word-wrap: normal; -webkit-hyphens: none; -moz-hyphens: none; hyphens: none; } body small { font-size: 12px; } ul { padding-left: 15px; margin-bottom: 0px; } ol { padding-left: 20px; margin-bottom: 0px; } ol li { color: #db4c3a; } li { padding-bottom: 10px; margin: 0; color: #777; } ul.cotap-red-bullets li { color: #db4c3a; } ul.no-bullets { padding-left: 0; } ul.no-bullets li { list-style: none !important; } table.medium-button a { font-size: 16px !important; } table.button, table.large-button, table.medium-button, table.small-button, table.tiny-button { margin: 0px 0px 15px 0px; } table.center-table { width: 100%; } table.center-table tr, table.center-table td, table.center-table table, table.center-table tr, table.center-table td { text-align: center; } table.center-table table, table.center-table table.button, table.center-table table.tiny-button, table.center-table table.medium-button, table.center-table table.large-button { display: block; margin-left: auto; margin-right: auto; } p.lead { line-height: 28px; } .cotap-center, .cotap-center p, .cotap-center h1, .cotap-center h2, .cotap-center h3, .cotap-center h4, .cotap-center h5, .cotap-center h6 { text-align: center; } table.cotap-white { background: #fff; width: 100%; } table tr td.cotap-white { background: #fff; } table.cotap-red { background: #db4c3a; width: 100%; } table tr td.cotap-red { background: #db4c3a; } table tr td.cotap-red * { color: #fff; } table.cotap-green { background: #18ad7a; width: 100%; } table tr td.cotap-green { background: #18ad7a; } table tr td.cotap-green * { color: #fff; } /* Cotap Padding */ table td.cotap-small { padding: 10px; padding-bottom: 10px; } table td.cotap-medium { padding: 30px; padding-bottom: 20px; } table td.cotap-large { padding: 40px; padding-bottom: 30px; } table td.cotap-xlarge { padding: 70px; padding-bottom: 60px; } table td.cotap-xxlarge { padding: 100px; padding-bottom: 90px; } /*Set padding top and bottom*/ table td.cotap-tall { padding-top: 50px; padding-bottom: 40px; } table td.cotap-short { padding-top: 40px; padding-bottom: 30px; } table td.cotap-xshort { padding-top: 30px; padding-bottom: 20px; } table td.cotap-xxshort { padding-top: 20px; padding-bottom: 10px; } table.footer tr td p { font-size: 12px; line-height: 20px; } table.footer tr td a { font-size: 12px; } .thin-headline { font-weight: 100; color: #9d9d9d; } .cotap-round { border-radius: 50%; } .cotap-marketing-header { font-size: 30px; line-height: 40px; padding-bottom: 15px; font-weight: 600; color: #4A4A4A; margin-left: auto; margin-right: auto; display: block; } /* Cotap Colors */ /* Text */ .cotap-red-text { color: #db4c3a; } .cotap-green-text { color: #18ad7a; } .cotap-light-green-text { color: #32c794; } .cotap-blue-text { color: #3aa0db; } .cotap-gray-text { color: #777; } .cotap-light-gray-text { color: #999; } .cotap-light-gray-alt-text { color: #ACACAC; } .cotap-dark-gray-text { color: #333; } .cotap-dark-gray-alt-text { color: #323c41; } /* Backgound */ .cotap-red-background { background-color: #db4c3a; } .cotap-green-background { background-color: #18ad7a; } .cotap-light-green-background { background-color: #32c794; } .cotap-blue-background { background-color: #3aa0db; } .cotap-gray-background { background-color: #777; } .cotap-light-gray-background { background-color: #999; } .cotap-light-gray-alt-background { color: #ACACAC; } .cotap-dark-gray-background { background-color: #333; } .cotap-dark-gray-alt-background { background-color: #323c41; } /*Cotap Buttons*/ /*Red Button*/ table.cotap-red-button td { background: #db4c3a; border-color: #db4c3a; color: #fff; } table.cotap-red-button td a { color: #fff; } table.cotap-red-button:hover td { background: #d53a27 !important; color: #fff; } table.cotap-red-button:hover td a, table.cotap-red-button td a:visited, table.cotap-red-button:active td a { color: #fff !important; } /* Green Button */ table.cotap-green-button td { background: #18ad7a; border-color: #18ad7a; color: #fff; } table.cotap-green-button td a { color: #fff; } table.cotap-green-button:hover td { background: #15976a !important; color: #fff; } table.cotap-green-button:hover td a, table.cotap-green-button td a:visited, table.cotap-green-button:active td a { color: #fff !important; } /* blue Button */ table.cotap-blue-button td { background: #3aa0db; border-color: #3aa0db; color: #fff; } table.cotap-blue-button td a { color: #fff; } table.cotap-blue-button:hover td { background: #2795d5 !important; color: #fff; } table.cotap-blue-button:hover td a, table.cotap-blue-button td a:visited, table.cotap-blue-button:active td a { color: #fff !important; } /* dark-gray Button */ table.cotap-dark-gray-button td { background: #333333; border-color: #333333; color: #fff; } table.cotap-dark-gray-button td a { color: #fff; } table.cotap-dark-gray-button:hover td { background: #262626 !important; color: #fff; } table.cotap-dark-gray-button:hover td a, table.cotap-dark-gray-button td a:visited, table.cotap-dark-gray-button:active td a { color: #fff !important; } /* Cotap Red Outline */ table.cotap-red-button-outline { border-radius: 5px; border: 1px solid #db4c3a !important; border-collapse: initial; } table.cotap-red-button-outline td { background: #fff; color: #db4c3a; border-radius: 3px; border: 0px transparent !important; } table.cotap-red-button-outline td a { color: #db4c3a !important; } table.cotap-red-button-outline:hover td { background: #db4c3a !important; color: #fff !important; } table.cotap-red-button-outline:hover td a, table.cotap-red-button-outline td a:visited, table.cotap-red-button-outline:active td a { background: #db4c3a !important; } table.gray-table { background-color: #f7f7f7; border-radius: 10px; width: 100%; display: table !important; margin-bottom: 0px; } table.gray-table tr td { padding: 30px 30px; color: #777; text-align: center; } .cotap-red-line { border-bottom: 3px solid #db4c3a; } .cotap-promotion span { text-decoration: underline; } .cotap-promotion p { font-size: 18px; } @media only screen and (max-width: 517.24138px) { table[class="body"] td.cotap-small { padding: 25px 15px 5px 15px !important; } table[class="body"] td.cotap-medium { padding: 25px 15px 5px 15px !important; } table[class="body"] td.cotap-large { padding: 25px 15px 5px 15px !important; } table[class="body"] td.cotap-xlarge { padding: 25px 15px 5px 15px !important; } table[class="body"] td.cotap-xxlarge { padding: 25px 15px 5px 15px !important; } #promotion-text { background: url(https://api.cotap.com/content/f4d2c190d135c18da78447b803460aac-original.png) 15px center no-repeat !important; padding: 20px 15px 20px 90px !important; } #promotion-text p { font-size: 12px !important; } /*Mobile reset H tags*/ h1, h2, h3 { font-size: 24px !important; line-height: 28px !important; } h4, h5, h6 { font-size: 18px !important; line-height: 22px !important; } .cotap-mobile-center { text-align: center !important; } .cotap-mobile-center * { text-align: center !important; } .cotap-mobile-center table { display: inline-block; } .hide-on-gmail { width: auto !important; max-height: 1000px !important; overflow: visible !important; float: none !important; display: block !important; } table[class="body"] td.mobile-side-padding { padding-right: 15px !important; padding-left: 15px !important; } } .mobile-padding { width: 100%; } .hide-on-gmail img { clear: both !important; float: none !important; height: auto !important; max-height: 1000px !important; margin: 0 auto 20px auto; } .align-bottom { vertical-align: bottom; } /* One Off */ .login-number { margin-bottom: 0px; } .login-number span { font-size: 50px; line-height: 40px; font-family: "Avenir", Helvetica, Arial, Geneva, sans-serif; font-weight: 100; padding-bottom: 30px; display: inline-block; border-bottom: 2px solid #ACACAC; } .login-header { padding-top: 30px; } .verification-code { font-size: 50px; letter-spacing: 2.5px; color: #3aa0db; font-weight: 200 !important; } .see-conversation-subject { font-size: 18px; padding-bottom: 15px; } .see-conversation-header { padding-top: 8px; } table.sub-line { width: 175px; max-width: 175px; } .sub-line td { padding-top: 5px; padding-bottom: 20px; width: 175px; } .sub-line td p { margin-bottom: 0; line-height: 5px; border-bottom: 1px solid #D9D9D9; width: 175px; } img.avatar { margin: 0 auto 8px auto !important; } h1.avatar, h2.avatar, h3.avatar, h4.avatar, h5.avatar, h6.avatar { margin: 0 0 2px 0 !important; margin-bottom: 0px; } p.avatar { padding: 0 0 10px 0 !important; margin-bottom: 10px !important; } .sub-line.red-line td p { border-bottom: 1px solid #db4c3a; } @media only screen and (max-width: 517.24138px) { table[class="body"] td.login-number-cell { padding-top: 60px !important; padding-bottom: 60px !important; } table[class="body"] table.columns table.reset td, table[class="body"] table.column table.reset td { width: initial !important; } } /*# sourceMappingURL=main.css.map */ </style> <!-- Start Body --> <table class="body" style="background: #f7f7f7; border-collapse: collapse; border-spacing: 0; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; height: 100%; line-height: 19px; margin: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td class="center body-td" align="center" valign="top" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 15px; text-align: center; vertical-align: top; word-break: break-word;"> <center style="min-width: 500px; width: 100%;"> <!-- Open Container --> <table class="container" style="border-collapse: collapse; border-spacing: 0; margin: 0 auto; padding: 0; text-align: inherit; vertical-align: top; width: 500px;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-break: break-word;"> <!-- Open Row --> <table class="row" style="border-collapse: collapse; border-spacing: 0; display: block; padding: 0px; position: relative; text-align: left; vertical-align: top; width: 100%;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td class=" last wrapper" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 5px 20px 0px 0px; padding-right: 0px; position: relative; text-align: left; vertical-align: top; word-break: break-word;"> <!-- Open Wrapper - Default is twelve unless specified --> <table class="twelve columns" style="border-collapse: collapse; border-spacing: 0; margin: 0 auto; padding: 0; text-align: left; vertical-align: top; width: 500px;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td class="" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0px 0px 5px; text-align: left; vertical-align: top; word-break: break-word;"> <!-- Open Cotap Module - Default is cotap-white unless specified --> <table class=" na " style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td class="" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0px 0px 5px; text-align: left; vertical-align: top; word-break: break-word;"> <a href="https://www.cotap.com/?utm_source=email&utm_medium=logo&utm_campaign=email" target="_blank" style="color: #333; font-family: 'Avenir', Helvetica, Arial, Geneva, sans-serif; font-weight: 100; text-decoration: none;"><img src="https://api.cotap.com/content/09b29d5bb7017af06ab1282aa6a2ba61" alt="Cotap" style="-ms-interpolation-mode: bicubic; border: none; clear: both; display: block; float: left; max-width: 100%; outline: none; text-decoration: none; width: auto;" /></a> </td> </tr> </table> <!-- Close Cotap Module --> </td> <td class="expander" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0; text-align: left; vertical-align: top; visibility: hidden; width: 0px; word-break: break-word;"></td> </tr> </table> <!-- Close Wrapper --> </td> </tr> </table> <!-- Close Row --> </td> </tr> </table> <!-- Close Container --> <!-- Open Container --> <table class="container" style="border-collapse: collapse; border-spacing: 0; margin: 0 auto; padding: 0; text-align: inherit; vertical-align: top; width: 500px;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-break: break-word;"> <!-- Open Row --> <table class="row" style="border-collapse: collapse; border-spacing: 0; display: block; padding: 0px; position: relative; text-align: left; vertical-align: top; width: 100%;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td class=" last wrapper" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 5px 20px 0px 0px; padding-right: 0px; position: relative; text-align: left; vertical-align: top; word-break: break-word;"> <!-- Open Wrapper - Default is twelve unless specified --> <table class="twelve columns" style="border-collapse: collapse; border-spacing: 0; margin: 0 auto; padding: 0; text-align: left; vertical-align: top; width: 500px;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td class="" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0px 0px 5px; text-align: left; vertical-align: top; word-break: break-word;"> <!-- Open Cotap Module - Default is cotap-white unless specified --> <table class=" cotap-white " style="background: #fff; border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td class="cotap-xlarge cotap-center" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 70px; padding-bottom: 60px; text-align: center; vertical-align: top; word-break: break-word;"> <h4 class="avatar" style="-moz-hyphens: none; -webkit-hyphens: none; color: #db4c3a; font-family: 'Avenir', Helvetica, Arial, Geneva, sans-serif; font-size: 26px; font-weight: 100; hyphens: none; line-height: 30px; margin: 0 0 2px 0; margin-bottom: 0px; padding: 0; text-align: center; word-break: normal; word-wrap: normal;">Cotap is a secure texting app for teams.</h4> <h6 class="cotap-gray-text" style="-moz-hyphens: none; -webkit-hyphens: none; color: #777; font-family: 'Avenir', Helvetica, Arial, Geneva, sans-serif; font-size: 18px; font-weight: 100; hyphens: none; line-height: 22px; margin: 0; margin-bottom: 10px; padding: 0; text-align: center; word-break: normal; word-wrap: normal;"> View the Blogger directory. </h6> <br /> <table class="center-table" style="border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"> <tr style="padding: 0; text-align: center; vertical-align: top;"> <td style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0px 0px 5px; text-align: center; vertical-align: top; word-break: break-word;"> <table class="medium-button round cotap-tall cotap-blue-button" style="border-collapse: collapse; border-spacing: 0; display: inline-block; margin: 0 0 0 0; margin-left: auto; margin-right: auto; overflow: hidden; padding: 0; text-align: center; vertical-align: top; width: 140px;"> <tbody> <tr style="padding: 0; text-align: center; vertical-align: top;"> <td style="-moz-border-radius: 500px; -moz-hyphens: auto; -webkit-border-radius: 500px; -webkit-hyphens: auto; background: #3aa0db; border: none none #2284a1; border-collapse: collapse; border-color: #3aa0db; border-radius: 500px; color: #fff; display: block; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 12px 0 10px; text-align: center; vertical-align: top; width: auto; word-break: break-word;"> <a href="https://app.cotap.com/open?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIzMjg2NTQyNjJkZmEzZGMwYWE0M2FjMTcxZjZkODA5MzdhNWY1YjQ5MGRmY2YzNTA1YmYzNjE2MjlmM2IzZDQ3Iiwic3ViIjoic2ltb25zdS5tYWlsLjA5NTM2MDkyNzVAYmxvZ2dlci5jb20iLCJpc3MiOiJjb20uY290YXAuY291cmllciIsImF1ZCI6ImNvbS5jb3RhcC5hcGkudGFsa2VyIiwiZXhwIjoxNDM5OTg4ODA0LCJpYXQiOjE0MzkzODQwMDQsImNvbS5jb3RhcC5wYXlsb2FkIjp7InRhbGtlciI6eyJmaXJzdF9uYW1lIjoiU2ltb24iLCJsYXN0X25hbWUiOiJTdSJ9fX0.QPeU7FVL7_nTDSszzAFknMoHzw5KqI9Z4kgc1P0yu9c" style="color: #fff; display: block; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 16px; font-weight: 100; height: 100%; text-decoration: none; width: 140px;">Get Started</a> </td> </tr> </tbody> </table> </td> </tr> </table> </td> </tr> </table> <!-- Close Cotap Module --> </td> <td class="expander" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0; text-align: left; vertical-align: top; visibility: hidden; width: 0px; word-break: break-word;"></td> </tr> </table> <!-- Close Wrapper --> </td> </tr> </table> <!-- Close Row --> </td> </tr> </table> <!-- Close Container --> <!-- Open Container --> <table class="container" style="border-collapse: collapse; border-spacing: 0; margin: 0 auto; padding: 0; text-align: inherit; vertical-align: top; width: 500px;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-break: break-word;"> <!-- Open Row --> <table class="row" style="border-collapse: collapse; border-spacing: 0; display: block; padding: 0px; position: relative; text-align: left; vertical-align: top; width: 100%;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td class=" last wrapper" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 5px 20px 0px 0px; padding-right: 0px; position: relative; text-align: left; vertical-align: top; word-break: break-word;"> <!-- Open Wrapper - Default is twelve unless specified --> <table class="twelve columns" style="border-collapse: collapse; border-spacing: 0; margin: 0 auto; padding: 0; text-align: left; vertical-align: top; width: 500px;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td class="" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0px 0px 5px; text-align: left; vertical-align: top; word-break: break-word;"> <!-- Open Cotap Module - Default is cotap-white unless specified --> <table class=" cotap-white " style="background: #fff; border-collapse: collapse; border-spacing: 0; padding: 0; text-align: left; vertical-align: top; width: 100%;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td class="cotap-medium cotap-center" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 30px; padding-bottom: 20px; text-align: center; vertical-align: top; word-break: break-word;"> <p class="cotap-gray-text" style="-moz-hyphens: none; -webkit-hyphens: none; color: #777; font-family: 'Avenir', Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: 100; hyphens: none; line-height: 24px; margin: 0; margin-bottom: 10px; padding: 0; text-align: center; word-wrap: normal;"> Are you using WhatsApp, GroupMe, or iMessage to text your coworkers? <a href="https://www.cotap.com/blog/whatsapp-for-work-is-nsfw/" class="cotap-red-text" style="color: #db4c3a; font-family: 'Avenir', Helvetica, Arial, Geneva, sans-serif; font-weight: 100; text-decoration: none;"> See why</a> Cotap is better for work. </p> </td> </tr> </table> <!-- Close Cotap Module --> </td> <td class="expander" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0; text-align: left; vertical-align: top; visibility: hidden; width: 0px; word-break: break-word;"></td> </tr> </table> <!-- Close Wrapper --> </td> </tr> </table> <!-- Close Row --> </td> </tr> </table> <!-- Close Container --> <!-- Start Footer --> <table class="container footer" style="border-collapse: collapse; border-spacing: 0; margin: 0 auto; padding: 0; text-align: inherit; vertical-align: top; width: 500px;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0; text-align: left; vertical-align: top; word-break: break-word;"> <!-- container start above --> <table class="row" style="border-collapse: collapse; border-spacing: 0; display: block; padding: 0px; position: relative; text-align: left; vertical-align: top; width: 100%;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td class="wrapper last" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 5px 20px 0px 0px; padding-right: 0px; position: relative; text-align: left; vertical-align: top; word-break: break-word;"> <table class="twelve columns" style="border-collapse: collapse; border-spacing: 0; margin: 0 auto; padding: 0; text-align: left; vertical-align: top; width: 500px;"> <tr style="padding: 0; text-align: left; vertical-align: top;"> <td align="center" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0px 0px 5px; text-align: left; vertical-align: top; word-break: break-word;"> <center style="min-width: 500px; width: 100%;"> <p class="cotap-light-gray-alt-text" style="-moz-hyphens: none; -webkit-hyphens: none; color: #ACACAC; font-family: 'Avenir', Helvetica, Arial, Geneva, sans-serif; font-size: 12px; font-weight: 100; hyphens: none; line-height: 20px; margin: 5px 0 10px 0; margin-bottom: 10px; margin-top: 5px; padding: 0; text-align: center; word-wrap: normal;"> Sent by <a href="https://www.cotap.com/?utm_source=email&utm_medium=footer&utm_campaign=email" target="_blank" class="cotap-red-text" style="color: #db4c3a; font-family: 'Avenir', Helvetica, Arial, Geneva, sans-serif; font-size: 12px; font-weight: 100; text-decoration: none;">Cotap</a> | 55 New Montgomery Street #888 | San Francisco, CA 94105 </p> <p style="-moz-hyphens: none; -webkit-hyphens: none; color: #ACACAC; font-family: 'Avenir', Helvetica, Arial, Geneva, sans-serif; font-size: 12px; font-weight: 100; hyphens: none; line-height: 20px; margin: 0; margin-bottom: 10px; padding: 0; text-align: center; word-wrap: normal;" class="cotap-light-gray-alt-text"> <a href="https://www.cotap.com/unsubscribed/?address=simonsu.mail.0953609275%40blogger.com" target="_blank" class="cotap-light-gray-alt-text" style="color: #ACACAC; font-family: 'Avenir', Helvetica, Arial, Geneva, sans-serif; font-size: 12px; font-weight: 100; text-decoration: none;">Unsubscribe</a> | <a href="https://www.cotap.com/legal/privacy/" target="_blank" class="cotap-light-gray-alt-text" style="color: #ACACAC; font-family: 'Avenir', Helvetica, Arial, Geneva, sans-serif; font-size: 12px; font-weight: 100; text-decoration: none;">Privacy Policy</a> </p> </center> </td> <td class="expander" style="-moz-hyphens: auto; -webkit-hyphens: auto; border-collapse: collapse; color: #222222; font-family: Avenir, Helvetica, Arial, Geneva, sans-serif; font-size: 14px; font-weight: normal; hyphens: auto; line-height: 19px; margin: 0; padding: 0; text-align: left; vertical-align: top; visibility: hidden; width: 0px; word-break: break-word;"></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <!-- End Footer --> </center> </td> </tr> </table> <!-- End Body --> k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-27672108090476056162015-05-04T07:31:00.000-07:002015-05-04T07:32:17.713-07:00CloudFlare改頭換面!<div dir="ltr">最近流行換新裝?! Cloudflare改頭換面啦 :D<div><br clear="all"><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs-SaLJeiLWA8mnNOaVsMmMbAxntG5FPbq1DAncaR3q1jBhFQqx3BdurPZyiECI4VoCRdoACJXHCTjfNVmZgu6GArj76KQAdCKRKUvyaRR1qwBqPwn7R22T8wsqQ895kRb2pqBzQca1A0p/s1600/image-737714.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhs-SaLJeiLWA8mnNOaVsMmMbAxntG5FPbq1DAncaR3q1jBhFQqx3BdurPZyiECI4VoCRdoACJXHCTjfNVmZgu6GArj76KQAdCKRKUvyaRR1qwBqPwn7R22T8wsqQ895kRb2pqBzQca1A0p/s320/image-737714.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6145024196538314530" /></a><br></div><div><br></div> </div></div> k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-13966028413953102282015-04-10T21:19:00.000-07:002015-04-10T21:20:11.175-07:00docker mysql image encoding change to utf8<div dir="ltr">最近在使用docker的mysql image掛載mysql db時候<div>發現server的語系都是在latin1的狀態</div><div>而mysql image又不允許直接把my.cnf換掉...</div><div>但是可以overwrite /etc/mysql/conf.d這個資料匣</div><div>來重寫mysqld的語系設定...<br> <div><br></div><div>這是原始資料庫啟動後透過"\s"來查看server狀態</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"># mysql -h123.123.123.123 -uroot -p<br>Enter password:<br>Welcome to the MySQL monitor. Commands end with ; or \g.<br>Your MySQL connection id is 3<br>Server version: 5.5.42 MySQL Community Server (GPL)<br>Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.<br>Oracle is a registered trademark of Oracle Corporation and/or its<br>affiliates. Other names may be trademarks of their respective<br>owners.<br>Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.<br>mysql> \s<br>--------------<br>mysql Ver 14.14 Distrib 5.5.41, for debian-linux-gnu (x86_64) using readline 6.2<br>Connection id:<span class="" style="white-space:pre"> </span>3<br>Current database:<br>Current user:<span class="" style="white-space:pre"> </span><a href="mailto:root@123.123.123.123">root@123.123.123.123</a><br>SSL:<span class="" style="white-space:pre"> </span>Not in use<br>Current pager:<span class="" style="white-space:pre"> </span>stdout<br>Using outfile:<span class="" style="white-space:pre"> </span>''<br>Using delimiter:<span class="" style="white-space:pre"> </span>;<br>Server version:<span class="" style="white-space:pre"> </span>5.5.42 MySQL Community Server (GPL)<br>Protocol version:<span class="" style="white-space:pre"> </span>10<br>Connection:<span class="" style="white-space:pre"> </span>211.78.245.67 via TCP/IP<br>Server characterset:<span class="" style="white-space:pre"> latin1<br></span>Db characterset:<span class="" style="white-space:pre"> latin1<br></span>Client characterset:<span class="" style="white-space:pre"> latin1<br></span>Conn. characterset:<span class="" style="white-space:pre"> </span>latin1<br>TCP port:<span class="" style="white-space:pre"> </span>3306<br>Uptime:<span class="" style="white-space:pre"> </span>49 sec<br>Threads: 3 Questions: 25 Slow queries: 0 Opens: 33 Flush tables: 1 Open tables: 26 Queries per second avg: 0.510<br>--------------<br>mysql></blockquote></div><div><br></div><div>我們建立一個docker.cnf檔案如下</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"># cat docker.cnf<br>[mysqld]<br>user = mysql<br>datadir = /var/lib/mysql<br>collation-server = utf8_unicode_ci<br>init-connect='SET NAMES utf8'<br>character-set-server = utf8</blockquote></div><div><br></div><div>我的啟動command:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">docker run --name mydb -p 3306:3306 -v /root/mysql-data:/var/lib/mysql \ </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> -v /root/mysql-config:/etc/mysql/conf.d \ </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.5</blockquote><div><br></div><div>接著應該就可以在登入mysql後透過"\s"看到語系部分已經是utf8</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Server characterset:<span class="" style="white-space:pre"> </span>utf8<br>Db characterset:<span class="" style="white-space:pre"> </span>utf8<br>Client characterset:<span class="" style="white-space:pre"> </span>utf8<br>Conn. characterset:<span class="" style="white-space:pre"> </span>utf8</blockquote></div><div><br></div><div>PS: 關於client部分,需要在[client]部分使用,也就是連線的那端要改my.cnf來使用utf8連線...</div></div></div> k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-52081696249620941352015-03-27T06:48:00.001-07:002015-04-01T01:02:44.497-07:00簡單的SSHFS mount...<div dir="ltr">
<div>
前陣子看到nixCcraft所PO的<a href="http://www.cyberciti.biz/faq/how-to-mount-remote-directory-filesystems-with-sshfs-on-linux/">SSHFS文章</a>,一直想找機會試試看</div>
<div>
今天有機會來玩一下 :D</div>
<div>
<br /></div>
<div>
Debian上還滿簡單,只要直接安裝即可:</div>
<div>
<br /></div>
<blockquote class="gmail_quote" style="border-left-color: rgb(204,204,204); border-left-style: solid; border-left-width: 1px; margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
sudo apt-get install sshfs -y</blockquote>
<div>
<br /></div>
<div>
CentOS上,如果安裝時找不到套件,可以先安裝epel-release後再進行安裝</div>
<div>
<br /></div>
<blockquote class="gmail_quote" style="border-left-color: rgb(204,204,204); border-left-style: solid; border-left-width: 1px; margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
sudo yum install epel-release -y<br />
sudo yum install fuse-sshfs -y</blockquote>
<div>
<br /></div>
<div>
接著,就可以操作mount的動作<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUIqnmKT_szFmKsanXfXo3SLwxHjkCRTwEQlxPaWvzrqvNbSwaiy3ovtA-Fk0cuLEAqeBoUE7PcYv3nDkO1cftzutlzLHxTKf-RHfvblmx9aFddui15WJ_Lgxu0xwUUi4Z1rkCA-bzfVyl/s1600/sshfs-1.png" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUIqnmKT_szFmKsanXfXo3SLwxHjkCRTwEQlxPaWvzrqvNbSwaiy3ovtA-Fk0cuLEAqeBoUE7PcYv3nDkO1cftzutlzLHxTKf-RHfvblmx9aFddui15WJ_Lgxu0xwUUi4Z1rkCA-bzfVyl/s1600/sshfs-1.png" height="195" width="640" /></a><br />
<br /></div>
<div>
實際測試一下速度 - sshfs建立100M檔案:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqemECgcVR8wdIobpV9EZ49P6o52SrZuSgYJVMhLDubrpC4A3itiJBnw-7hRL35xOLvmuRFAsLLX78bzU88R7mSLgsc-VVTPu3haVQBhWOrurVx8vgFS6JPP8waJu7Fmqbxr1pf7RfA3Ot/s1600/sshfs-2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqemECgcVR8wdIobpV9EZ49P6o52SrZuSgYJVMhLDubrpC4A3itiJBnw-7hRL35xOLvmuRFAsLLX78bzU88R7mSLgsc-VVTPu3haVQBhWOrurVx8vgFS6JPP8waJu7Fmqbxr1pf7RfA3Ot/s1600/sshfs-2.png" height="76" width="400" /></a></div>
<br />
<br /></div>
<div>
<div>
<br />
<br />
<br />
<br />
<br />
與自己本身建立100M檔案:</div>
<div>
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4Q09RdRVOcwW31teh9PDXEDUawDHvROI3WwFKd8f-3v0E_JkXzhshBk4wGv35kLy9UwNN4xONCtMuaYPDcUCSWpt6cTKRPLytC4E8q18oVZr8CPqEHPA7bNI9zpHoWqSN2ndWwO2jmCIa/s1600/sshfs-3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4Q09RdRVOcwW31teh9PDXEDUawDHvROI3WwFKd8f-3v0E_JkXzhshBk4wGv35kLy9UwNN4xONCtMuaYPDcUCSWpt6cTKRPLytC4E8q18oVZr8CPqEHPA7bNI9zpHoWqSN2ndWwO2jmCIa/s1600/sshfs-3.png" height="108" width="400" /></a></div>
<br />
<br />
<div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
與iscsi比較一下<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj20J_IFcNPGjvL7Dc_t0IslfClrFFsqQfPFVcYXE7pqta_TsVvoSjPgO4AjE6jsdXoODmrb1SFXLWuRFJWB3MBUtD1stOnyzQvuj6b0hkPyov6_UWY9ebIVYuzAYPDFRonTPCmtC2ScpH-/s1600/sshfs-4.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj20J_IFcNPGjvL7Dc_t0IslfClrFFsqQfPFVcYXE7pqta_TsVvoSjPgO4AjE6jsdXoODmrb1SFXLWuRFJWB3MBUtD1stOnyzQvuj6b0hkPyov6_UWY9ebIVYuzAYPDFRonTPCmtC2ScpH-/s1600/sshfs-4.png" height="95" width="400" /></a></div>
<br />
<br /></div>
<div>
<br />
<br />
<br />
<br />
<br />
<br />
上述測試是在Google Cloud上主機上進行</div>
<div>
100M的檔案在2s左右完成傳輸,實際上效能還不錯</div>
<div>
但跟local比契還來是慢了近20倍</div>
<div>
以方便性而言sshfs的確方便</div>
<div>
但是考慮效能的應用程式,還是需要好好考慮一下唷~<br />
<br />
補充一下大家最常用的NFS<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLUa8q2CB5FqOORVLdGtmOgl7VN9bW38JhfDDHaHBRAcl0-tMElt6cxEu2yU8qYjb1c1qR0pqhSOqAdj8Gb2U8Lc8YTOktOqMV6wpxHLD9i-ZT5f3LhUmM2kJSyu5cX9M8R-6BN6P-7Gt0/s1600/Screen+Shot+2015-04-01+at+3.59.24+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLUa8q2CB5FqOORVLdGtmOgl7VN9bW38JhfDDHaHBRAcl0-tMElt6cxEu2yU8qYjb1c1qR0pqhSOqAdj8Gb2U8Lc8YTOktOqMV6wpxHLD9i-ZT5f3LhUmM2kJSyu5cX9M8R-6BN6P-7Gt0/s1600/Screen+Shot+2015-04-01+at+3.59.24+PM.png" height="118" width="400" /></a><br />
<br />
<br />
<br /></div>
<div>
</div>
</div>
</div>
k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-66393155545017863662015-03-24T22:07:00.001-07:002015-03-24T22:07:47.905-07:00Logstash mutate filter<div dir="ltr">最近在研究Logstash,透過Logstash的input, filter, output可以產生出許多不同的變化... 下面是我前陣子遇到的問題,後來找到解決方案....<div><br></div><div>例如我在抓CentO6.6的rsyslog時候,我把/var/log/message中的一些syslog重倒到logstash中</div><div><br></div><div>$ vi /etc/rsyslog.conf</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">*.info;mail.none;authpriv.none;cron.none @@<a href="http://10.240.58.95:514">10.240.58.95:514</a></blockquote><div><br></div><div>另外,logstash server部分,透過input syslog module開啟514 port接聽syslog input...</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">input {<br> syslog {<br> port => 514<br> type => syslog<br> }<br>}</blockquote></div><div><br></div><div>此時收到的syslog在rubydebug模式下,會類似:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="monospace, monospace">{<br> "message" => "Installed: mysql-5.1.73-3.el6_5.x86_64",<br> "@version" => "1",<br> "@timestamp" => "2015-03-25T03:50:01.000Z",<br> "type" => "syslog",<br> "host" => "10.240.219.254",,<br> "timestamp" => "Mar 25 03:50:01"<br> "priority" => 14,<br> "logsource" => "simon-centos6",<br> "program" => "yum",<br> "pid" => "645",<br> "severity" => 6,<br> "facility" => 1,<br> "facility_label" => "user-level",<br> "severity_label" => "Informational"<br>}</font></blockquote></div><div><br></div><div>其中,會明顯地發現有兩個timestamp的欄位... 雖然有個前面加上"@"</div><div>而這個重複的timestamp欄位會造成其他的output module錯誤,導致一些其他問題...</div><div><br></div><div>在找了很久,後來發現mutate這個filter module.... 透過mutate可以讓欄位改名稱、改內容、刪除欄位、增加欄位... 這樣在input與output之間的銜接,就少掉很多問題...</div><div>下面範例是透過mutate的rename function來置換我所遇到的重複key...</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">input {<br> syslog {<br> port => 514<br> type => syslog<br> }<br>}<br>filter {<br> mutate {<br> rename => [ "timestamp", "timestamp1" ]<br> }<br>}<br>output {<br> stdout { codec => rubydebug }<br>}</blockquote></div><div><br></div><div>如果一切沒有問題,再重新執行logstash之後,可以看到新的output,其中可以看到timestamp1會被排到最後面</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="monospace, monospace">{<br> "message" => "Installed: mysql-5.1.73-3.el6_5.x86_64",<br> "@version" => "1",<br> "@timestamp" => "2015-03-25T03:50:01.000Z",<br> "type" => "syslog",<br> "host" => "10.240.219.254",<br> "priority" => 14,<br> "logsource" => "simon-centos6",<br> "program" => "yum",<br> "pid" => "645",<br> "severity" => 6,<br> "facility" => 1,<br> "facility_label" => "user-level",<br> "severity_label" => "Informational",<br> "timestamp1" => "Mar 25 03:50:01"<br>}</font></blockquote></div><div><br></div><div><br></div><div>這樣傳給output的值就沒有問題了ㄛ :D</div><div><br></div></div> k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-74172757858518786392015-03-12T09:17:00.000-07:002015-03-12T09:18:13.499-07:00Docker in Mac will more easy!!!<div dir="ltr"><div>Kitermatic是Docker新出的一個本地端套件管理工具,讓您可以用視覺化的方式來管理Container服務,未來要在Mac上使用Docker就更方便了!!</div><div><br></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOefpX27E-N6pDjuQYznNQLnOxgVpPqQdvc9-yugPali0GHh1I1kk38w_aqxub1S1PCe1LFg0lbdLIxb53EzUENrNlbESQOo86aj4wAN-A9_l6tva52v8cXrzRp_D5WjDMqKeOh2rxTvie/s1600/image-793500.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOefpX27E-N6pDjuQYznNQLnOxgVpPqQdvc9-yugPali0GHh1I1kk38w_aqxub1S1PCe1LFg0lbdLIxb53EzUENrNlbESQOo86aj4wAN-A9_l6tva52v8cXrzRp_D5WjDMqKeOh2rxTvie/s320/image-793500.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6125383977174307586" /></a><br></div> </div> k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-53725222210361169632015-01-31T22:59:00.000-08:002015-01-31T23:00:19.398-08:00發想自 node-schedule 的 node-schedule-server<div dir="ltr"><h1 style="font-size:2.25em;margin-right:0px;margin-bottom:16px;margin-left:0px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.2;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);margin-top:0px!important">node-schedule</h1><p style="margin:0px 0px 16px;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px">node-schedule是一個time base的排程器,透過給定簡單的時間物件或是給與cron job的時間格式字串,就可以指定時間觸發所給定的task。 這在Java的世界,與一套叫Quartz的服務相像...</p><h2 style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.225;margin-top:1em;margin-bottom:16px;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51)">Github repository</h2><p style="margin:0px 0px 16px;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px"><a href="https://github.com/mattpat/node-schedule" target="_blank" style="color:rgb(65,131,196);text-decoration:none;background:transparent">https://github.com/mattpat/node-schedule</a></p><h2 style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.225;margin-top:1em;margin-bottom:16px;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51)">Installation</h2><pre style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12.75px;white-space:pre-wrap;padding:16px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-break:break-all;word-wrap:normal;color:rgb(51,51,51);border:none;border-radius:3px;overflow:auto;background-color:rgb(247,247,247)"><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px;color:inherit;white-space:pre;border-radius:3px;border:0px;margin:0px;display:inline;max-width:initial;overflow:initial;line-height:inherit;word-wrap:normal;background:transparent">npm install node-schedule </code></pre><h2 style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.225;margin-top:1em;margin-bottom:16px;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51)">Sample Usage</h2><p style="margin:0px 0px 16px;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px">下面範例展示一個簡單的排程作業,其中date指定為現在時間過30秒,而date2指定為一個未來的時間... 程式起動時候,會先列印現在時間,並開始設定兩個(j, j2) Job分別在指定的date, date2時間啟動...</p><pre style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12.75px;white-space:pre-wrap;padding:16px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-break:break-all;word-wrap:normal;color:rgb(51,51,51);border:none;border-radius:3px;overflow:auto;background-color:rgb(247,247,247)"><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px;color:inherit;white-space:pre;border-radius:3px;border:0px;margin:0px;display:inline;max-width:initial;overflow:initial;line-height:inherit;word-wrap:normal;background:transparent">var schedule = require('node-schedule'); var date = new Date(new Date().getTime() + 1*1000*30); var date2 = new Date('2015/1/31 21:28:00'); console.log(new Date()); console.log('j will start at:', date); var j = schedule.scheduleJob(date, function(){ console.log('The job j is going to end...'); }); console.log('j2 will start at:',date2); var j2 = schedule.scheduleJob(date2, function(){ console.log('The job j2 is going to end...'); }); </code></pre><p style="margin:0px 0px 16px;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px">上面程式起動後,會執行列印現在時間,並且開始將Job置入排程時間,等候執行...</p><pre style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12.75px;white-space:pre-wrap;padding:16px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-break:break-all;word-wrap:normal;color:rgb(51,51,51);border:none;border-radius:3px;overflow:auto;background-color:rgb(247,247,247)"><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px;color:inherit;white-space:pre;border-radius:3px;border:0px;margin:0px;display:inline;max-width:initial;overflow:initial;line-height:inherit;word-wrap:normal;background:transparent">$ node examples/node-schedule/sample01.js Sun Feb 01 2015 14:40:34 GMT+0800 (CST) j will start at: Sun Feb 01 2015 14:41:03 GMT+0800 (CST) j2 will start at: Sat Feb 2 2015 21:28:00 GMT+0800 (CST) The job j2 is going to end... (waitting...) </code></pre><p style="margin:0px 0px 16px;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px">等到執行的時間到了,系統就會執行定義於j, j2中callback function中的內容... 等到所有Job執行完成,程式就會關閉...</p><h2 style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.225;margin-top:1em;margin-bottom:16px;font-size:1.75em;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51)">Sample Project</h2><p style="margin:0px 0px 16px;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px">因為Schedule服務非常實用,筆者花了一些時間把這些動作建置成一個RESTful操控的服務器,透過簡單的動作,就可以提供RESTful的Endpoint來操控排程...</p><h3 style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.43;margin-top:1em;margin-bottom:16px;font-size:1.5em;color:rgb(51,51,51)">安裝服務</h3><p style="margin:0px 0px 16px;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px">目前服務release在github上,有興趣使用的朋友可以直接git clone下來或是fork回去改...</p><pre style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12.75px;white-space:pre-wrap;padding:16px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-break:break-all;word-wrap:normal;color:rgb(51,51,51);border:none;border-radius:3px;overflow:auto;background-color:rgb(247,247,247)"><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px;color:inherit;white-space:pre;border-radius:3px;border:0px;margin:0px;display:inline;max-width:initial;overflow:initial;line-height:inherit;word-wrap:normal;background:transparent">$ git clone git@github.com:peihsinsu/node-schedule-server.git $project_home $ cd $project_home && npm install </code></pre><h3 style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.43;margin-top:1em;margin-bottom:16px;font-size:1.5em;color:rgb(51,51,51)">啟動服務</h3><p style="margin:0px 0px 16px;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px">因為使用express 4來實作,因此可以透過npm start來啟動... 真正的啟動程式定義在package.json,位置為bin/www。</p><pre style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12.75px;white-space:pre-wrap;padding:16px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-break:break-all;word-wrap:normal;color:rgb(51,51,51);border:none;border-radius:3px;overflow:auto;background-color:rgb(247,247,247)"><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px;color:inherit;white-space:pre;border-radius:3px;border:0px;margin:0px;display:inline;max-width:initial;overflow:initial;line-height:inherit;word-wrap:normal;background:transparent">$ cd $project_home $ npm start </code></pre><h3 style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.43;margin-top:1em;margin-bottom:16px;font-size:1.5em;color:rgb(51,51,51)">撰寫服務執行者(Worker)</h3><p style="margin:0px 0px 16px;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px">預設我只提供了一個RESTful Client來在排程時間到之後透過Url的方式來執行服務,這個RESTful Client(workers/restclient.js)的目的在使用前端傳入的opts參數內容來使用request模組來達到呼叫的目的。</p><p style="margin:0px 0px 16px;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px">每個Worker的必要條件如下:</p><ul style="margin-top:0px;margin-bottom:16px;padding:0px 0px 0px 2em;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px"><li>必須放置在$project_home/workers下面</li><li>名稱必須與呼叫時候給定的"catg"參數值相同</li><li>可參考restclient.js實作Worker:<ul style="margin-top:0px;margin-bottom:16px;padding:0px 0px 0px 2em"><li>必須具備exec這個function</li><li>這個 exec function 必須有一個opts的json字串輸入,這個值是由呼叫時候給訂opts參數傳入。</li></ul></li></ul><pre style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12.75px;white-space:pre-wrap;padding:16px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-break:break-all;word-wrap:normal;color:rgb(51,51,51);border:none;border-radius:3px;overflow:auto;background-color:rgb(247,247,247)"><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px;color:inherit;white-space:pre;border-radius:3px;border:0px;margin:0px;display:inline;max-width:initial;overflow:initial;line-height:inherit;word-wrap:normal;background:transparent">var request = require('request'); var log = require('nodeutil').simplelog; exports.exec = function(opts) { if(typeof(opts) == 'string') opts = JSON.parse(opts); //Here you can do the job... request(opts, function(e, r, d) { if(e) log.error('Job[%s] execute error:', e); <a href="http://log.info">log.info</a>('Job[%s] execute result:', d); }); } </code></pre><h3 style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:1.43;margin-top:1em;margin-bottom:16px;font-size:1.5em;color:rgb(51,51,51)">新增加一筆服務</h3><p style="margin:0px 0px 16px;color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:15px;line-height:21px">一切準備就緒後,在服務啟動完成,就可以透過下面方式呼叫新增一筆排程工作...</p><pre style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12.75px;white-space:pre-wrap;padding:16px;margin-top:0px;line-height:1.45;word-break:break-all;word-wrap:normal;color:rgb(51,51,51);border:none;border-radius:3px;overflow:auto;margin-bottom:0px!important;background-color:rgb(247,247,247)"><code style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px;color:inherit;white-space:pre;border-radius:3px;border:0px;margin:0px;display:inline;max-width:initial;overflow:initial;line-height:inherit;word-wrap:normal;background:transparent">curl -X POST -sS <a href="http://127.0.0.1:3000/schedule/testjob">http://127.0.0.1:3000/schedule/testjob</a> \ -d "jobtime=2015/2/1 1:59:00" \ -d catg=restclient \ -d 'opts={"url":"<a href="http://localhost:3000">http://localhost:3000</a>","method":"GET"}'</code></pre> <div><br></div><div><br></div><div>以上內容,收錄於<a href="http://peihsinsu.gitbooks.io/node-js-500-samples/">Node.js in Example</a>!</div></div> k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-57186568342546477432014-12-14T23:22:00.001-08:002014-12-14T23:22:59.919-08:00Commit docker into private repository<div dir="ltr"><div class="gmail_quote">Docker無限好,只是怎麼擁有自己的repository呢?!如果你跟我想要的一樣,可以參考自建docker registry...</div><div class="gmail_quote"><br></div><div class="gmail_quote">懶人版,直接用docker跑registry server然後儲存空間接google cloud storage作為永久保存...</div><div class="gmail_quote">參考:<a href="https://registry.hub.docker.com/u/google/docker-registry/">https://registry.hub.docker.com/u/google/docker-registry/</a></div><div class="gmail_quote"><br></div><div class="gmail_quote">強人版,完全自建,加上用Nginx作為registry的https通道...</div><div class="gmail_quote">參考:<a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-docker-registry-on-ubuntu-14-04">https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-docker-registry-on-ubuntu-14-04</a></div><div class="gmail_quote"><br></div><div class="gmail_quote">厲害高手太多,這邊只分享一個遇到的狀況... Mac版本升級到最新的boot2docker後,居然不支援非ssl協定的registry...</div><div class="gmail_quote">錯誤如下:<br><div dir="ltr"><br></div><div dir="ltr"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOYKSP4vNMZeKwDRPFNZfwV_91EVVQgoNRCJPgYa3RYIj4RqUaHW0ugfxbdJWJeQHEAudLVlpxSza4T_deyFQt_3lic_wgldSGER4oGZ_fDbBuD9ZcODns8ewJoSeI8Ui-NjxvfK4xvQvr/s1600/image-779921.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOYKSP4vNMZeKwDRPFNZfwV_91EVVQgoNRCJPgYa3RYIj4RqUaHW0ugfxbdJWJeQHEAudLVlpxSza4T_deyFQt_3lic_wgldSGER4oGZ_fDbBuD9ZcODns8ewJoSeI8Ui-NjxvfK4xvQvr/s320/image-779921.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6092961640859237826" /></a><br><div><br></div><div>找了一下Google... 原來1.3.1之後的docker預設不支援非https的registry,應該是安全性上的問題...</div><div>相關的說明如下:</div><div><br></div><div><a href="https://github.com/boot2docker/boot2docker" target="_blank">https://github.com/boot2docker/boot2docker</a><br></div><div><br></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVFvYE4Tm8u-141hLnnS3VdAu04PHEKdNbzrB8RjjFkTVxqzHI1Z_kslTuaJC0WsyEjEm3dHZx1M4gKUS_5F3hOMfAe2go3PjflnQd04SZuRyWQXI4_DqsSxo2B7xgPkKlgTQtadqufTdH/s1600/image-782611.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVFvYE4Tm8u-141hLnnS3VdAu04PHEKdNbzrB8RjjFkTVxqzHI1Z_kslTuaJC0WsyEjEm3dHZx1M4gKUS_5F3hOMfAe2go3PjflnQd04SZuRyWQXI4_DqsSxo2B7xgPkKlgTQtadqufTdH/s320/image-782611.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6092961650747664050" /></a><br></div><div>試試看... </div><div><br></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7gCO219rQtQxIXRBGE9pOYdjNzrTs31QawDUxkaqIS1PVIbwSqkO12fXmTVbDugqnTiLcOKAFVc8UQZFbUpa1hvZQACN67IUfyyHGwlAYoSaOEoD9VOlcGZa5A9Kte_3evvKDs_S-95o9/s1600/image-784617.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7gCO219rQtQxIXRBGE9pOYdjNzrTs31QawDUxkaqIS1PVIbwSqkO12fXmTVbDugqnTiLcOKAFVc8UQZFbUpa1hvZQACN67IUfyyHGwlAYoSaOEoD9VOlcGZa5A9Kte_3evvKDs_S-95o9/s320/image-784617.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6092961656317129218" /></a><br></div><div><br></div><div>再透過boot2docker ssh可以切入到container的平台...</div><div><br></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJok1IOT1nWRT2wQvdWoG6wMeTAc-IYU8RewWN9yBWQHG0t1FLwoF7VU68acKQqF8oIB10DbKCWLq9mR4P70AAuKT95CaSov_gXc8Z7QtXtzXbOXnt3AuTvIhwJnkscO5YwTCNUCrExjzX/s1600/image-786825.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJok1IOT1nWRT2wQvdWoG6wMeTAc-IYU8RewWN9yBWQHG0t1FLwoF7VU68acKQqF8oIB10DbKCWLq9mR4P70AAuKT95CaSov_gXc8Z7QtXtzXbOXnt3AuTvIhwJnkscO5YwTCNUCrExjzX/s320/image-786825.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6092961671851127730" /></a><br></div></div> <br> <div>然後執行文件中提示的環境設定後,重啟docker....</div><div>之後push到private registry就都沒問題拉 :D</div></div> </div> k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-74400393165308915332014-10-23T22:50:00.001-07:002014-10-23T22:50:53.113-07:00Mac OS 10.10 ruby bad interpreter issue<div dir="ltr"><div>應該不少人更新了Mac OS 10.10</div><div>在使用上可能跟我一樣會發生ruby的執行錯誤問題,這個問題一般是在console mode開啟當下發生:</div><div><br></div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWJ39Lz0xZLc9jmGE4xy8_t3coELeeLKEhBBYP0aCW5oxgo8ABcNi6_eoVXufY_EMkn23UGLCTBASJdTYvkLMPq3nCU6k86XUFpd8XlLedz0iFiVbulrVuQ537O_sqUPu6qxemA6dcz4VK/s1600/image-753114.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWJ39Lz0xZLc9jmGE4xy8_t3coELeeLKEhBBYP0aCW5oxgo8ABcNi6_eoVXufY_EMkn23UGLCTBASJdTYvkLMPq3nCU6k86XUFpd8XlLedz0iFiVbulrVuQ537O_sqUPu6qxemA6dcz4VK/s320/image-753114.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6073641472764848322" /></a><div><br></div><div>修正方式很簡單,該錯誤是因為ruby interpreter找不到...</div><div>在/usr/local/Library/brew.rb這個檔案修改一開始的執行程式位置定義即可</div><div><br></div><div>$ vi /usr/local/Library/brew.rb<br></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVrbqlNLMf_m4Qew3yINQ28eX9erfQ7hLJgpEagKs_Zw_Vp5_utxSdZVVPoIpJ4p_kQSGx_YiRv-ps5j8R4di1fnl7Gn7enf1z-EhfFLwKkhwBlPQggZvlkAfRhGAbD_yEusCV2tv_D15L/s1600/image-756100.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVrbqlNLMf_m4Qew3yINQ28eX9erfQ7hLJgpEagKs_Zw_Vp5_utxSdZVVPoIpJ4p_kQSGx_YiRv-ps5j8R4di1fnl7Gn7enf1z-EhfFLwKkhwBlPQggZvlkAfRhGAbD_yEusCV2tv_D15L/s320/image-756100.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6073641487352851586" /></a><br> <div><br></div><div>如上所示,只要把原本的"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0"移除,然後改成"/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby -W0",存擋後就可以正常了!</div><div><br></div><div>Reference: <a href="http://jcvangent.com/fixing-homebrew-os-x-10-10-yosemite/">http://jcvangent.com/fixing-homebrew-os-x-10-10-yosemite/</a></div></div></div> k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.comtag:blogger.com,1999:blog-6014366374670463842.post-88952134603124554682014-06-25T08:58:00.000-07:002014-06-25T08:59:04.434-07:00Node.js implements Google API in Command Line<div dir="ltr"><div>很高興在Google IO Taipei講了一場關於Node.js跟BigQuery結合的分享</div><div>跟杭JS同樣的講題,但補充了sql2bq與gcli兩個套件</div><div>其中gcli是idea自google api explore裡面的api結構</div><div>關於gcli可以參考Github: <a href="https://github.com/peihsinsu/gapis">https://github.com/peihsinsu/gapis</a></div> <div>下面簡介一下CLI操作上跟API Explore的對應:</div><div><br></div><div>1. "-a [api name]": 帶入的api name是關於目前使用的api是哪一個,其中名稱的簡寫通常是右邊的function名稱的第一個,在這邊即是compute這個字。另外"-v [version]"則是帶入欲操作的api version</div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmDhPtFCqxXBVk6Z20aOrRn-i6XQHfrfah4eF7wd9WDTRmF8isAGgUL4WI8_iywuNhkGXanUnW3sKmEpUumOWp5MhALosU6ma26D8PrJ1TOQxGbjSS8lrOtGNs2Nc_2vsRkYy0gN59cvfn/s1600/gcli-1-744435.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmDhPtFCqxXBVk6Z20aOrRn-i6XQHfrfah4eF7wd9WDTRmF8isAGgUL4WI8_iywuNhkGXanUnW3sKmEpUumOWp5MhALosU6ma26D8PrJ1TOQxGbjSS8lrOtGNs2Nc_2vsRkYy0gN59cvfn/s320/gcli-1-744435.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6028896897727813058" /></a><br> </div><div><br></div><div>2. "-s [scope]"讓操作當下帶入認證所需要的scope資訊,可以讓工具所取到的access token可以binding所給予的授權,增加安全性... </div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6toxYlXyoc1xcDm6E_a1zcsazAqL-778rGBJs3Fio0IJiaQKq9uqqxjSKDfO9p5aH2snm31nQDsWwCY3zc5JWBKu6QAJ97_UbLU6gkBlYQ-f0sQFmYDzqhvTWNncEXgpKCzM5BXgEzP3j/s1600/gcli-2-747542.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6toxYlXyoc1xcDm6E_a1zcsazAqL-778rGBJs3Fio0IJiaQKq9uqqxjSKDfO9p5aH2snm31nQDsWwCY3zc5JWBKu6QAJ97_UbLU6gkBlYQ-f0sQFmYDzqhvTWNncEXgpKCzM5BXgEzP3j/s320/gcli-2-747542.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6028896909781700786" /></a><br></div><div><br> </div><div><br></div><div>3. "-f [function name]",這邊指的就是"compute.images.list"這串字,讓使用者可以直接敲入api的function結構去使用每一個google的api</div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2ChOlpQVxGPEYHB3KG5pM41Fcc7LWCQDRnKwPehVz4UqDo731sUbX4JFOCvCfaRfgsMjOjhsFXFMb9MjXL9DxaLBbYJgW11Zd-d9qCm_g-x103KyzdilWUWkgrg_STc8gHnr-QKOFdr9P/s1600/gcli-3-755947.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2ChOlpQVxGPEYHB3KG5pM41Fcc7LWCQDRnKwPehVz4UqDo731sUbX4JFOCvCfaRfgsMjOjhsFXFMb9MjXL9DxaLBbYJgW11Zd-d9qCm_g-x103KyzdilWUWkgrg_STc8gHnr-QKOFdr9P/s320/gcli-3-755947.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6028896947517956066" /></a><br> </div><div><br></div><div>4. "-d [conditions]"是讓您放入網址列的變動參數部分,例如某個操作用到這樣的網址:<span style="color:rgb(0,0,0);font-size:13px;white-space:pre-wrap"><a href="https://www.googleapis.com/bigquery/v2/projects/">https://www.googleapis.com/bigquery/v2/projects/</a></span><span style="font-size:13px;white-space:pre-wrap"><font color="#ff0000">mitac-cp300</font></span><span style="color:rgb(0,0,0);font-size:13px;white-space:pre-wrap">/queries,其中紅色部分是提供在網址列嵌入的,這是REST API的一個特性,我們把它用"-d"的方式來帶入指令...</span>,與scope一樣,可以透過多個-b來輸入多個參數</div> <div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7NGJOKhasPLGuzDS-1Hn-Uz-9k9cEDcoYp6YYxnSzon2nlCWesz5dsxI6DC3km-j7_76f4UcQghd1PuWQKggDNsYQ6jFzD5XAZmhW1iHXH0cn7sg-wg_tVbX7KRMSPVTuq9EKCb9494vm/s1600/gcli-4-758661.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7NGJOKhasPLGuzDS-1Hn-Uz-9k9cEDcoYp6YYxnSzon2nlCWesz5dsxI6DC3km-j7_76f4UcQghd1PuWQKggDNsYQ6jFzD5XAZmhW1iHXH0cn7sg-wg_tVbX7KRMSPVTuq9EKCb9494vm/s320/gcli-4-758661.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6028896958985218290" /></a><br></div><div><br></div><div>5. "-b [body]"是用來帶入API call中的一些payload參數,讓屬於post form的一些參數可以直接被帶入做查詢...,與scope一樣,可以透過多個-b來輸入多個參數</div> <div> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc9wVyTrj86nMaj9aaKzS0eipA6d_hneAKZNkOgQQDWeCM7ZXX5Ny7rKDQ-40jggJzyJBTCdZwzzXj5ACAmZpkbazmq4g-StOcYaG7tENG0kRD7Yo5sEZrS5gk6979DUsnjq6wqnrNdhjZ/s1600/gcli-5-760752.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc9wVyTrj86nMaj9aaKzS0eipA6d_hneAKZNkOgQQDWeCM7ZXX5Ny7rKDQ-40jggJzyJBTCdZwzzXj5ACAmZpkbazmq4g-StOcYaG7tENG0kRD7Yo5sEZrS5gk6979DUsnjq6wqnrNdhjZ/s320/gcli-5-760752.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6028896961500639714" /></a><br></div><br> <div>於是,整個操作就會類似下面這樣:</div><div><br></div><div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8pc3PJZByjrfk_ABd4zp9ywerw87fJd-itJkBwaS-pyG1AYHQ0KTTtv-tnVTj7yP6cKPTjWlfFrYp1udzbbr5ZiKt8x-rd_jpMzYmvB0buTDyvGzurCH9dD2PLmOmNgJx96csJaaxVaVC/s1600/image-763338.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8pc3PJZByjrfk_ABd4zp9ywerw87fJd-itJkBwaS-pyG1AYHQ0KTTtv-tnVTj7yP6cKPTjWlfFrYp1udzbbr5ZiKt8x-rd_jpMzYmvB0buTDyvGzurCH9dD2PLmOmNgJx96csJaaxVaVC/s320/image-763338.png" border="0" alt="" id="BLOGGER_PHOTO_ID_6028896975216365714" /></a><br></div></div> k8s-studyhttp://www.blogger.com/profile/15291073043196262423noreply@blogger.com