BOSH resource requests and limit

Converting BOSH resource requests and limits to Kubernetes

It is possible to define resource requests and limits (CPU/Memory) for each container generated by the Quarks Operator.

The Quarks Operator, while converting the BPM informations, translates the BPM processes requests and limits to Kubernetes containers and pods, which are generated from instance groups.

It expands the BOSH specification to cover the features offered by Kubernetes, here is a complete example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: ops-scale
data:
  ops: |
    - type: replace
      path: /instance_groups/name=quarks-gora?/instances
      value: 2
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: quarks-gora-manifest
data:
  manifest: |
    ---
    name: quarks-gora-deployment
    releases:
    - name: quarks-gora
      version: "0.0.7"
      url: docker.io/cfcontainerization
      stemcell:
        os: SLE_15_SP1-26.5
        version: 7.0.0_374.gb8e8e6af
    instance_groups:
    - name: quarks-gora
      instances: 1
      jobs:
      - name: quarks-gora
        release: quarks-gora
        properties:
          quarks-gora:
            port: 55556
            ssl: false
          quarks:
            ports:
            - name: "quarks-gora"
              protocol: "TCP"
              internal: 55556
            bpm:
              processes:
              - name: quarks-gora
                requests:
                  cpu: "2m"
                  memory: "128Mi"
                limits:
                  cpu: "4"
                  memory: "2Gi"
---
apiVersion: quarks.cloudfoundry.org/v1alpha1
kind: BOSHDeployment
metadata:
  name: quarks-gora-deployment
spec:
  manifest:
    name: quarks-gora-manifest
    type: configmap
  ops:
  - name: ops-scale
    type: configmap
Complete source code: https://github.com/cloudfoundry-incubator/quarks-operator/blob/master/docs/examples/bosh-deployment/quarks-gora-cpu-mem.yaml

Here is a comprehensive table of the conversion which is done by the Quarks Operator and the respective Kubernetes equivalent:

Job spec in Manifest Kube Pod Container Description
properties.quarks.bpm.processes[n].requests.cpu container.Resources.Requests.cpu Guaranteed CPU
properties.quarks.bpm.processes[n].requests.memory container.Resources.Requests.memory Guaranteed memory
properties.quarks.bpm.processes[n].limits.cpu container.Resources.Limits.cpu Specify a CPU request and a CPU limit
properties.quarks.bpm.processes[n].limits.memory container.Resources.Limits.memory Specify a memory request and a memory limit