<p>i would want to know how can i assign memory resources to a running pod ?</p>
<p>i tried <code>kubectl get po foo-7d7dbb4fcd-82xfr  -o yaml &gt; pod.yaml</code>
but when i run the command <code>kubectl apply -f pod.yaml</code></p>
<pre><code> The Pod &quot;foo-7d7dbb4fcd-82xfr&quot; is invalid: spec: Forbidden: pod updates may not change fields other than `spec.containers[*].image`, `spec.initContainers[*].image`, `spec.activeDeadlineSeconds` or `spec.tolerations` (only additions to existing tolerations)
</code></pre>
<p>thanks in advance for your help .</p>

zyriuse
<p>Pod is the minimal kubernetes resources, and it doesn't not support editing as you want to do.</p>
<p>I suggest you to use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">deployment</a> to run your pod, since it is a &quot;pod manager&quot; where you have a lot of additional features, like pod self-healing, pod liveness/readness etc...</p>
<p>You can define the resources in your deployment file like this:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: echo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: echo
  template:
    metadata:
      labels:
        app: echo
    spec:
      containers:
      - name: echo
        image: mendhak/http-https-echo
        resources:
          limits:
            cpu: 15m
            memory: 100Mi
          requests:
            cpu: 15m
            memory: 100Mi 
        ports:
        - name: http
          containerPort: 80
</code></pre>
