<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>OCI - 東東 GCP 教學 - GCP 實戰講師</title>
	<atom:link href="https://dongdonggcp.com/tag/oci/feed/" rel="self" type="application/rss+xml" />
	<link>https://dongdonggcp.com</link>
	<description>助你考取證照，轉職成功</description>
	<lastBuildDate>Mon, 07 Apr 2025 06:12:37 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://dongdonggcp.com/wp-content/uploads/2025/04/cropped-340838097_121391010914395_5443948698124160121_n-32x32.jpg</url>
	<title>OCI - 東東 GCP 教學 - GCP 實戰講師</title>
	<link>https://dongdonggcp.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">243235092</site>	<item>
		<title>[GKE 教學] Helm Charts 是什麼？什麼是 OCI 格式的 Charts？</title>
		<link>https://dongdonggcp.com/2024/12/02/gke-what-is-helm-charts-what-is-oci-charts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=gke-what-is-helm-charts-what-is-oci-charts</link>
					<comments>https://dongdonggcp.com/2024/12/02/gke-what-is-helm-charts-what-is-oci-charts/#respond</comments>
		
		<dc:creator><![CDATA[東東]]></dc:creator>
		<pubDate>Mon, 02 Dec 2024 13:01:46 +0000</pubDate>
				<category><![CDATA[Google Kubernetes Engine]]></category>
		<category><![CDATA[GKE]]></category>
		<category><![CDATA[Helm]]></category>
		<category><![CDATA[Helm Charts]]></category>
		<category><![CDATA[OCI]]></category>
		<guid isPermaLink="false">https://dongdonggcp.com/?p=8228</guid>

					<description><![CDATA[<p>Helm Charts 是 Kubern [&#8230;]</p>
<p>The post <a href="https://dongdonggcp.com/2024/12/02/gke-what-is-helm-charts-what-is-oci-charts/">[GKE 教學] Helm Charts 是什麼？什麼是 OCI 格式的 Charts？</a> first appeared on <a href="https://dongdonggcp.com">東東 GCP 教學 - GCP 實戰講師</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Helm Charts 是 Kubernetes 應用程式的打包格式，可以想像成是一個&#8221;食譜&#8221;，裡面包含了部署應用程式所需的所有 Kubernetes 資源定義。</p>



<p>主要包含：</p>



<ul class="wp-block-list">
<li>應用程式的 Kubernetes YAML 檔案（如 Deployment、Service、ConfigMap 等）</li>



<li>版本資訊</li>



<li>應用程式的配置選項</li>



<li>相依性設定</li>
</ul>



<p>舉例來說，如果要部署一個 WordPress 網站，一個 WordPress Chart 會包含：</p>



<pre class="wp-block-code"><code>wordpress/
  Chart.yaml          # Chart 的版本和資訊
  values.yaml         # 預設配置值
  templates/          # Kubernetes 資源模板
    deployment.yaml   # WordPress 的部署設定
    service.yaml      # 服務設定
    ingress.yaml      # 入口設定</code></pre>



<p></p>



<p>OCI（Open Container Initiative）原本是用來定義容器映像檔的標準格式，現在這個標準也被用來儲存 Helm Charts。</p>



<p>主要優點：</p>



<ul class="wp-block-list">
<li>可以和容器映像檔使用相同的儲存庫</li>



<li>有標準的版本控制</li>



<li>支援數位簽名，提高安全性</li>



<li>可以使用相同的存取控制機制</li>
</ul>



<p>比較傳統方式和 OCI 格式：</p>



<p>傳統 Chart 儲存：</p>



<pre class="wp-block-code"><code>helm repo add bitnami https://charts.bitnami.com/bitnami
helm install wordpress bitnami/wordpress</code></pre>



<p>OCI 格式儲存：</p>



<pre class="wp-block-code"><code>helm install wordpress oci://registry.example.com/charts/wordpress:1.0.0</code></pre>



<p>在 Google Cloud 的情境下，使用 Artifact Registry 儲存 OCI 格式的 Charts 特別有優勢：</p>



<ol class="wp-block-list">
<li>可以集中管理容器映像檔和 Charts</li>



<li>整合 Google Cloud 的存取控制</li>



<li>支援 VPC Service Controls 提高安全性</li>



<li>有完整的版本追蹤和稽核記錄</li>
</ol>



<p>那你可能會問 WordPress 不是一整包 php 程式檔嗎？它們存在哪裡？</p>



<p>Helm Charts 本身<strong>不包含</strong> WordPress 的 PHP 檔案。Charts 只包含了 Kubernetes 的部署設定檔。實際的 WordPress PHP 檔案是存在於<strong>容器映像檔</strong>（Container Image）中。</p>



<p>讓我用 WordPress 為例子來說明整個架構：</p>



<ol class="wp-block-list">
<li><strong>容器映像檔（Container Image）</strong>
<ul class="wp-block-list">
<li>包含 WordPress 的所有 PHP 檔案</li>



<li>包含 Apache/PHP 運行環境</li>



<li>通常存放在像 Docker Hub 這樣的容器登錄庫</li>



<li>例如：<code>wordpress:6.4.3</code></li>
</ul>
</li>



<li><strong>Helm Chart</strong>
<ul class="wp-block-list">
<li>只包含 Kubernetes 的設定檔</li>



<li>會在設定中<strong>引用</strong>上面的容器映像檔</li>



<li>例如在 <code>deployment.yaml</code> 中：</li>
</ul>
</li>
</ol>



<pre class="wp-block-code"><code>spec:
  containers:
  - name: wordpress
    image: wordpress:6.4.3   # 這裡引用包含實際 PHP 檔案的容器映像檔
    ports:
    - containerPort: 80</code></pre>



<p>所以完整的部署流程是：</p>



<ol class="wp-block-list">
<li>Kubernetes 讀取 Helm Chart 的設定</li>



<li>根據設定去下載指定的容器映像檔</li>



<li>將容器映像檔（包含 PHP 檔案）部署到 Kubernetes 集群中</li>
</ol>



<p>這種設計的好處是：</p>



<ul class="wp-block-list">
<li>關注點分離：部署設定（Chart）和應用程式程式碼（容器映像檔）可以分開管理</li>



<li>重用性：同一個容器映像檔可以用不同的 Chart 設定來部署</li>



<li>版本控制：程式碼和部署設定可以分別進行版本控制</li>
</ul>



<p></p><p>The post <a href="https://dongdonggcp.com/2024/12/02/gke-what-is-helm-charts-what-is-oci-charts/">[GKE 教學] Helm Charts 是什麼？什麼是 OCI 格式的 Charts？</a> first appeared on <a href="https://dongdonggcp.com">東東 GCP 教學 - GCP 實戰講師</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://dongdonggcp.com/2024/12/02/gke-what-is-helm-charts-what-is-oci-charts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">8228</post-id>	</item>
	</channel>
</rss>
