$ kubectl apply -f - <<EOF
apiVersion: v1
kind: LimitRange
metadata:
  name: min-max-memory-demo
spec:
  limits:
  - max:
      memory: 1Gi
    min:
      memory: 500Mi
    type: Container
EOF


$ kubectl create -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
  name: memory-demo-pod
spec:
  containers:
  - name: memory-demo-container
    image: nginx
    resources:
      limits:
        memory: "1.5Gi"
      requests:
        memory: "100Mi"
EOF


When create a pod with memory less than the min-memory or greater than the max memory, the pod creation will fail and display the following error:
Error from server (Forbidden): error when creating "STDIN": pods "memory-demo-pod" is forbidden: [minimum memory usage per Container is 500Mi, but request is 100Mi, maximum memory usage per Container is 1Gi, but limit is 1536Mi]
