<p>Consider the below .yaml file :</p>

<pre><code>application/guestbook/redis-slave-deployment.yaml  
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: redis-slave
  labels:
    app: redis
spec:
  selector:
    matchLabels:
      app: redis
      role: slave
      tier: backend
  replicas: 2
  template:
    metadata:
      labels:
        app: redis
        role: slave
        tier: backend
    spec:
      containers:
      - name: slave
        image: gcr.io/google_samples/gb-redisslave:v1
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        env:
        - name: GET_HOSTS_FROM
          value: dns

        ports:
        - containerPort: 6379
</code></pre>

<p>The resource section isn't clear to me! If I have 16G RAM and 4core CPU, each core 2GHz, then how much are the requested resources which come above? </p>

<p>So you have a total of 4 CPU cores and 16GB RAM. This Deployment will start two Pods (replicas) and each will start with 0.1 cores and 0.1GB reserved on the Node on which it starts. So in total 0.2 cores and 0.2GB will be reserved, leaving up to 15.8GB and 3.8cores. However the actual usage may exceed the reservation as this is only a the requested amount. To specify an upper limit you use a limits section. </p>

<p>It can be <a href="https://github.com/kubernetes/kubernetes/issues/60787" rel="nofollow noreferrer">counter-intuitive that CPU allocation is based on cores rather than GHz</a> - there's a <a href="https://www.google.co.uk/amp/s/gweb-cloudblog-publish.appspot.com/products/gcp/kubernetes-best-practices-resource-requests-and-limits/amp/" rel="nofollow noreferrer">fuller explanation in the GCP docs</a> and more on the arithmetic <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#specify-a-cpu-request-and-a-cpu-limit" rel="nofollow noreferrer">in the official kubernetes docs</a></p>
