instruction: Explain Configure Pods and Containers
output: Configure Pods and Containers
  Perform common configuration tasks for Pods and containers.
  Assign Memory Resources to Containers and Pods
  Assign CPU Resources to Containers and Pods
  Assign Devices to Pods and Containers
  Assign infrastructure resources to your Kubernetes workloads.
  Assign Pod-level CPU and memory resources
  Configure GMSA for Windows Pods and containers
  Resize CPU and Memory Resources assigned to Containers
  Configure RunAsUserName for Windows pods and containers
  Create a Windows HostProcess Pod
  Configure Quality of Service for Pods
  Assign Extended Resources to a Container
  Configure a Pod to Use a Volume for Storage
  Configure a Pod to Use a PersistentVolume for Storage
  Configure a Pod to Use a Projected Volume for Storage
  Configure a Security Context for a Pod or Container
  Configure Service Accounts for Pods
  Pull an Image from a Private Registry
  Configure Liveness, Readiness and Startup Probes
  Assign Pods to Nodes
  Assign Pods to Nodes using Node Affinity
  Configure Pod Initialization
  Attach Handlers to Container Lifecycle Events
  Configure a Pod to Use a ConfigMap
  Share Process Namespace between Containers in a Pod
  Use a User Namespace With a Pod
  Use an Image Volume With a Pod
  Create static Pods
  Translate a Docker Compose File to Kubernetes Resources
  Enforce Pod Security Standards by Configuring the Built-in Admission Controller
  Enforce Pod Security Standards with Namespace Labels
  Migrate from PodSecurityPolicy to the Built-In PodSecurity Admission Controller
  Was this page helpful?
  Thanks for the feedback. If you have a specific, answerable question about how to use Kubernetes, ask it on
  Stack Overflow
  Open an issue in the
  GitHub Repository
  if you want to
  report a problem
  suggest an improvement
  Last modified January 13, 2023 at 11:05 AM PST:
  Update page weights in /tasks/access-application-cluster, /configure-pod-container, /configmap-secret (97693ff044)
  
  ## Kubernetes Deployment Example
  
  ```yaml
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: my-app
    labels:
      app: my-app
  spec:
    replicas: 3
    selector:
      matchLabels:
        app: my-app
    template:
      metadata:
        labels:
          app: my-app
      spec:
        containers:
        - name: my-app
          image: my-app:latest
          ports:
          - containerPort: 3000
          env:
          - name: NODE_ENV
            value: "production"
          resources:
            requests:
              memory: "128Mi"
              cpu: "100m"
            limits:
              memory: "256Mi"
              cpu: "200m"
          livenessProbe:
            httpGet:
              path: /health
              port: 3000
            initialDelaySeconds: 30
            periodSeconds: 10
          readinessProbe:
            httpGet:
              path: /ready
              port: 3000
            initialDelaySeconds: 5
            periodSeconds: 5
  ---
  apiVersion: v1
  kind: Service
  metadata:
    name: my-app-service
  spec:
    selector:
      app: my-app
    ports:
    - protocol: TCP
      port: 80
      targetPort: 3000
    type: ClusterIP
  ```