Skip to content

Commit

Permalink
Deployed ce83535 with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
antweiss committed Aug 27, 2024
1 parent 2389804 commit 3d7cd16
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,5 +260,5 @@ <h3 id="welcome-to-the-kubernetes-cost-optimization-guide">Welcome to the Kubern

<!--
MkDocs version : 1.5.3
Build Date UTC : 2024-08-27 11:42:54.926671+00:00
Build Date UTC : 2024-08-27 12:00:10.061255+00:00
-->
58 changes: 52 additions & 6 deletions resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@
<a href="#the-economics-of-kubernetes-resource-allocation" class="w3-bar-item w3-button w3-hover-theme w3-theme-l4">The Economics of Kubernetes Resource Allocation</a>
<a href="#resource-allocation-in-kubernetes" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l4">Resource Allocation in Kubernetes</a>
<a href="#cpu-and-memory-allocation" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l4" style="padding-left: 24px;">CPU and memory allocation</a>
<a href="#storage-resource-allocation" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l4" style="padding-left: 24px;">Storage Resource Allocation</a>
<a href="#local-ephemeral-storage" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l4" style="padding-left: 24px;">Local ephemeral storage</a>
<a href="#persistent-storage-resource-allocation" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l4" style="padding-left: 24px;">Persistent Storage Resource Allocation</a>
<a href="#network-resource-allocation" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l4" style="padding-left: 24px;">Network Resource Allocation</a>
</div>
<div class="w3-container w3-large" style="height: 8em;" >&nbsp;</div>
Expand All @@ -188,7 +189,8 @@
<a href="#the-economics-of-kubernetes-resource-allocation" class="w3-bar-item w3-button w3-hover-theme w3-theme-l3">The Economics of Kubernetes Resource Allocation</a>
<a href="#resource-allocation-in-kubernetes" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l3">Resource Allocation in Kubernetes</a>
<a href="#cpu-and-memory-allocation" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l3" style="padding-left: 24px;">CPU and memory allocation</a>
<a href="#storage-resource-allocation" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l3" style="padding-left: 24px;">Storage Resource Allocation</a>
<a href="#local-ephemeral-storage" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l3" style="padding-left: 24px;">Local ephemeral storage</a>
<a href="#persistent-storage-resource-allocation" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l3" style="padding-left: 24px;">Persistent Storage Resource Allocation</a>
<a href="#network-resource-allocation" class="w3-bar-item w3-small w3-button w3-hover-theme w3-theme-l3" style="padding-left: 24px;">Network Resource Allocation</a>
</div>
</div>
Expand All @@ -201,9 +203,15 @@ <h1 id="the-economics-of-kubernetes-resource-allocation">The Economics of Kubern
<p>In cloud native environments (i.e Kubernetes) these resources are highly dynamic in nature and can be allocated and released on demand - just by issuing an API call. The process of allocating additional resources in such an automated manner is called autoscaling.
This automation gives us a lot of power by prividing access to addtional resources when needed (aka just-in-time provisioning). And it also creates undesirable artifacts if not configured correctly such as:</p>
<ul>
<li>Wasted resources (when we allocate more than we actually need)</li>
<li>Reliability issues (when provisioning doesn't work as expected)</li>
<li>Unexpected costs (when we don't have good control over what and when gets provisioned)</li>
<li>
<p>Wasted resources (when we allocate more than we actually need)</p>
</li>
<li>
<p>Reliability issues (when provisioning doesn't work as expected)</p>
</li>
<li>
<p>Unexpected costs (when we don't have good control over what and when gets provisioned)</p>
</li>
</ul>
<h2 id="resource-allocation-in-kubernetes">Resource Allocation in Kubernetes</h2>
<p>Kubernetes has different ways of allocating, limiting and provisioning resources for application containers.</p>
Expand All @@ -225,7 +233,45 @@ <h3 id="cpu-and-memory-allocation">CPU and memory allocation</h3>
cpu: 1
memory: 500Mi
</code></pre>
<h3 id="storage-resource-allocation">Storage Resource Allocation</h3>
<h3 id="local-ephemeral-storage">Local ephemeral storage</h3>
<p>Since v1.25 we can also manage the amount of local epehemeral storage allocated to pods.</p>
<p>"Ephemeral" means that there is no long-term guarantee about durability.</p>
<p>Pods use ephemeral local storage for scratch space, caching, and for logs. The kubelet can provide scratch space to Pods using local ephemeral storage to mount emptyDir volumes into containers.</p>
<p>The kubelet also uses this kind of storage to hold node-level container logs, container images, and the writable layers of running containers.</p>
<p>An example of a pod with ephemeral storage resource defintions:</p>
<pre class="w3-code w3-responsive"><code class="language-yaml">apiVersion: v1
kind: Pod
metadata:
name: my-app
spec:
containers:
- name: app
image: perfectscale.io/my-app:v0.2
resources:
requests:
ephemeral-storage: "1Gi"
limits:
ephemeral-storage: "2Gi"
volumeMounts:
- name: ephemeral
mountPath: "/tmp"
- name: log-collector
image: perfectscale.io/logger:v0.4a
resources:
requests:
ephemeral-storage: "500Mi"
limits:
ephemeral-storage: "1Gi"
volumeMounts:
- name: ephemeral
mountPath: "/tmp"
volumes:
- name: ephemeral
emptyDir:
sizeLimit: 500Mi
</code></pre>
<p>For more details on managing ephemeral storage read <a href="https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#local-ephemeral-storage" target="_blank">the official guide</a></p>
<h3 id="persistent-storage-resource-allocation">Persistent Storage Resource Allocation</h3>
<p>In order to allocate storage Kubernetes allows us to use its PersistentVolume allocation mechanisms in conjunction with one of the multiple supported storage providers (e.g OpenEBS, Portworx, etc.)</p>
<h3 id="network-resource-allocation">Network Resource Allocation</h3>
<p>Network resources aren't managed by Kubernetes itself but instead are delegated to one of the multiple CNI networking providers, which are reponsible for provisioning, allocating and retiring network interfaces and addresses. </p>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit 3d7cd16

Please sign in to comment.