You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Learn the basic cluster and workload components of Kubernetes and how they relate to features in Azure Kubernetes Service (AKS)
4
4
services: container-service
5
5
ms.topic: conceptual
6
-
ms.date: 03/05/2020
6
+
ms.date: 10/31/2022
7
7
8
8
---
9
9
@@ -196,7 +196,7 @@ Most stateless applications in AKS should use the deployment model rather than s
196
196
197
197
You don't want to disrupt management decisions with an update process if your application requires a minimum number of available instances. *Pod Disruption Budgets* define how many replicas in a deployment can be taken down during an update or node upgrade. For example, if you have *five (5)* replicas in your deployment, you can define a pod disruption of *4 (four)* to only allow one replica to be deleted or rescheduled at a time. As with pod resource limits, best practice is to define pod disruption budgets on applications that require a minimum number of replicas to always be present.
198
198
199
-
Deployments are typically created and managed with `kubectl create` or `kubectl apply`. Create a deployment by defining a manifest file in the YAML format.
199
+
Deployments are typically created and managed with `kubectl create` or `kubectl apply`. Create a deployment by defining a manifest file in the YAML format.
200
200
201
201
The following example creates a basic deployment of the NGINX web server. The deployment specifies *three (3)* replicas to be created, and requires port *80* to be open on the container. Resource requests and limits are also defined for CPU and memory.
202
202
@@ -229,6 +229,32 @@ spec:
229
229
memory: 256Mi
230
230
```
231
231
232
+
A breakdown of the deployment specifications in the YAML manifest file is as follows:
233
+
234
+
| Specification | Description |
235
+
| ----------------- | ------------- |
236
+
| `.apiVersion` | Specifies the API group and API resource you want to use when creating the resource. |
237
+
| `.kind` | Specifies the type of resource you want to create. |
238
+
| `.metadata.name` | Specifies the image to run. This file will run the *nginx* image from Docker Hub. |
239
+
| `.spec.replicas` | Specifies how many pods to create. This file will create three deplicated pods. |
240
+
| `.spec.selector` | Specifies which pods will be affected by this deployment. |
241
+
| `.spec.selector.matchLabels` | Contains a map of *{key, value}* pairs that allows the deployment to find and manage the created pods. |
242
+
| `.spec.selector.matchLabels.app` | Has to match `.spec.template.metadata.labels`. |
243
+
| `.spec.template.labels` | Specifies the *{key, value}* pairs attached to the object. |
244
+
| `.spec.template.app` | Has to match `.spec.selector.matchLabels`. |
245
+
| `.spec.spec.containers` | Specifies the list of containers belonging to the pod. |
246
+
| `.spec.spec.containers.name` | Specifies the name of the container specified as a DNS label. |
247
+
| `.spec.spec.containers.image` | Specifies the container image name. |
248
+
| `.spec.spec.containers.ports` | Specifies the list of ports to expose from the container. |
249
+
| `.spec.spec.containers.ports.containerPort` | Specifies the number of port to expose on the pod's IP address. |
250
+
| `.spec.spec.resources` | Specifies the compute resources required by the container. |
251
+
| `.spec.spec.resources.requests` | Specifies the minimum amount of compute resources required. |
252
+
| `.spec.spec.resources.requests.cpu` | Specifies the minimum amount of CPU required. |
253
+
| `.spec.spec.resources.requests.memory` | Specifies the minimum amount of memory required. |
254
+
| `.spec.spec.resources.limits` | Specifies the maximum amount of compute resources allowed. This limit is enforced by the kubelet. |
255
+
| `.spec.spec.resources.limits.cpu` | Specifies the maximum amount of CPU allowed. This limit is enforced by the kubelet. |
256
+
| `.spec.spec.resources.limits.memory` | Specifies the maximum amount of memory allowed. This limit is enforced by the kubelet. |
257
+
232
258
More complex applications can be created by including services (such as load balancers) within the YAML manifest.
233
259
234
260
For more information, see [Kubernetes deployments][kubernetes-deployments].
0 commit comments