<p>Here is my deployment &amp; service file for Django. The 3 pods generated from deployment.yaml works, but the resource request and limits are being ignored.</p>

<p>I have seen a lot of tutorials about applying resource specifications on Pods but not on Deployment files, is there a way around it?</p>

<p>Here is my yaml file:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app: djangoapi
    type: web
  name: djangoapi
  namespace: "default"
spec:
  replicas: 3
  template:
    metadata:
      labels:
        app: djangoapi
        type: web
    spec:
      containers:
      - name: djangoapi
        image: wbivan/app:v0.8.1a
        imagePullPolicy: Always
        args:
        - gunicorn
        - api.wsgi
        - --bind
        - 0.0.0.0:8000
        resources:
          requests:
            memory: "64Mi"
            cpu: "250m"
          limits:
            memory: "128Mi"
            cpu: "500m"
        envFrom:
        - configMapRef:
            name: djangoapi-config
        ports:
        - containerPort: 8000
        resources: {}
      imagePullSecrets:
        - name: regcred
      restartPolicy: Always

---
apiVersion: v1
kind: Service
metadata:
  name: djangoapi-svc
  namespace: "default"
  labels:
    app: djangoapi
spec:
  ports:
  - port: 8000
    protocol: TCP
    targetPort: 8000
  selector:
    app: djangoapi
    type: web
  type: NodePort  
</code></pre>

<p>There is one extra resource attribute under your container definition after ports.</p>

<pre><code>resources: {}
</code></pre>

<p>This overrides original resource definition.
Remove this one and apply it again.</p>
