Skip to content

Commit

Permalink
feat: configure standardResources via controller configmap (#1490)
Browse files Browse the repository at this point in the history
Signed-off-by: Nishchith Shetty <inishchith@gmail.com>
  • Loading branch information
inishchith authored and whynowy committed Feb 11, 2024
1 parent ce0a315 commit c71b2ab
Show file tree
Hide file tree
Showing 25 changed files with 1,020 additions and 499 deletions.
30 changes: 25 additions & 5 deletions api/json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -17838,6 +17838,9 @@
},
"io.numaproj.numaflow.v1alpha1.GetDaemonDeploymentReq": {
"properties": {
"DefaultResources": {
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"Env": {
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.EnvVar"
Expand All @@ -17858,7 +17861,8 @@
"ISBSvcType",
"Image",
"PullPolicy",
"Env"
"Env",
"DefaultResources"
],
"type": "object"
},
Expand Down Expand Up @@ -17912,6 +17916,9 @@
"ConfigReloaderImage": {
"type": "string"
},
"DefaultResources": {
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"Labels": {
"additionalProperties": {
"type": "string"
Expand Down Expand Up @@ -17962,7 +17969,8 @@
"ServerEncryptionSecretName",
"ConfigMapName",
"PvcNameIfNeeded",
"StartCommand"
"StartCommand",
"DefaultResources"
],
"type": "object"
},
Expand Down Expand Up @@ -17998,6 +18006,9 @@
"CredentialSecretName": {
"type": "string"
},
"DefaultResources": {
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"HealthConfigMapName": {
"type": "string"
},
Expand Down Expand Up @@ -18059,12 +18070,16 @@
"PvcNameIfNeeded",
"ConfConfigMapName",
"ScriptsConfigMapName",
"HealthConfigMapName"
"HealthConfigMapName",
"DefaultResources"
],
"type": "object"
},
"io.numaproj.numaflow.v1alpha1.GetSideInputDeploymentReq": {
"properties": {
"DefaultResources": {
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"Env": {
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.EnvVar"
Expand All @@ -18085,12 +18100,16 @@
"ISBSvcType",
"Image",
"PullPolicy",
"Env"
"Env",
"DefaultResources"
],
"type": "object"
},
"io.numaproj.numaflow.v1alpha1.GetVertexPodSpecReq": {
"properties": {
"DefaultResources": {
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"Env": {
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.EnvVar"
Expand All @@ -18115,7 +18134,8 @@
"Image",
"PullPolicy",
"Env",
"SideInputsStoreName"
"SideInputsStoreName",
"DefaultResources"
],
"type": "object"
},
Expand Down
30 changes: 25 additions & 5 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -17846,9 +17846,13 @@
"ISBSvcType",
"Image",
"PullPolicy",
"Env"
"Env",
"DefaultResources"
],
"properties": {
"DefaultResources": {
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"Env": {
"type": "array",
"items": {
Expand Down Expand Up @@ -17916,7 +17920,8 @@
"ServerEncryptionSecretName",
"ConfigMapName",
"PvcNameIfNeeded",
"StartCommand"
"StartCommand",
"DefaultResources"
],
"properties": {
"ClientPort": {
Expand All @@ -17933,6 +17938,9 @@
"ConfigReloaderImage": {
"type": "string"
},
"DefaultResources": {
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"Labels": {
"type": "object",
"additionalProperties": {
Expand Down Expand Up @@ -18011,7 +18019,8 @@
"PvcNameIfNeeded",
"ConfConfigMapName",
"ScriptsConfigMapName",
"HealthConfigMapName"
"HealthConfigMapName",
"DefaultResources"
],
"properties": {
"ConfConfigMapName": {
Expand All @@ -18020,6 +18029,9 @@
"CredentialSecretName": {
"type": "string"
},
"DefaultResources": {
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"HealthConfigMapName": {
"type": "string"
},
Expand Down Expand Up @@ -18073,9 +18085,13 @@
"ISBSvcType",
"Image",
"PullPolicy",
"Env"
"Env",
"DefaultResources"
],
"properties": {
"DefaultResources": {
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"Env": {
"type": "array",
"items": {
Expand All @@ -18100,9 +18116,13 @@
"Image",
"PullPolicy",
"Env",
"SideInputsStoreName"
"SideInputsStoreName",
"DefaultResources"
],
"properties": {
"DefaultResources": {
"$ref": "#/definitions/io.k8s.api.core.v1.ResourceRequirements"
},
"Env": {
"type": "array",
"items": {
Expand Down
5 changes: 5 additions & 0 deletions config/advanced-install/namespaced-controller-wo-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ metadata:
apiVersion: v1
data:
controller-config.yaml: |
defaults:
containerResources: |
requests:
memory: "128Mi"
cpu: "100m"
isbsvc:
redis:
# Default Redis settings, could be overridden by InterStepBufferService specs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ metadata:
name: numaflow-controller-config
data:
controller-config.yaml: |+
defaults:
containerResources: |
requests:
memory: "128Mi"
cpu: "100m"
isbsvc:
redis:
# Default Redis settings, could be overridden by InterStepBufferService specs
Expand Down
5 changes: 5 additions & 0 deletions config/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16301,6 +16301,11 @@ metadata:
apiVersion: v1
data:
controller-config.yaml: |
defaults:
containerResources: |
requests:
memory: "128Mi"
cpu: "100m"
isbsvc:
redis:
# Default Redis settings, could be overridden by InterStepBufferService specs
Expand Down
5 changes: 5 additions & 0 deletions config/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16204,6 +16204,11 @@ metadata:
apiVersion: v1
data:
controller-config.yaml: |
defaults:
containerResources: |
requests:
memory: "128Mi"
cpu: "100m"
isbsvc:
redis:
# Default Redis settings, could be overridden by InterStepBufferService specs
Expand Down
45 changes: 45 additions & 0 deletions docs/APIs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,15 @@ Kubernetes core/v1.PullPolicy </a> </em>
<td>
</td>
</tr>
<tr>
<td>
<code>DefaultResources</code></br> <em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#resourcerequirements-v1-core">
Kubernetes core/v1.ResourceRequirements </a> </em>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<h3 id="numaflow.numaproj.io/v1alpha1.GetJetStreamServiceSpecReq">
Expand Down Expand Up @@ -1555,6 +1564,15 @@ Description
<td>
</td>
</tr>
<tr>
<td>
<code>DefaultResources</code></br> <em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#resourcerequirements-v1-core">
Kubernetes core/v1.ResourceRequirements </a> </em>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<h3 id="numaflow.numaproj.io/v1alpha1.GetRedisServiceSpecReq">
Expand Down Expand Up @@ -1719,6 +1737,15 @@ Description
<td>
</td>
</tr>
<tr>
<td>
<code>DefaultResources</code></br> <em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#resourcerequirements-v1-core">
Kubernetes core/v1.ResourceRequirements </a> </em>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<h3 id="numaflow.numaproj.io/v1alpha1.GetSideInputDeploymentReq">
Expand Down Expand Up @@ -1772,6 +1799,15 @@ Kubernetes core/v1.PullPolicy </a> </em>
<td>
</td>
</tr>
<tr>
<td>
<code>DefaultResources</code></br> <em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#resourcerequirements-v1-core">
Kubernetes core/v1.ResourceRequirements </a> </em>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<h3 id="numaflow.numaproj.io/v1alpha1.GetVertexPodSpecReq">
Expand Down Expand Up @@ -1832,6 +1868,15 @@ Kubernetes core/v1.PullPolicy </a> </em>
<td>
</td>
</tr>
<tr>
<td>
<code>DefaultResources</code></br> <em>
<a href="https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#resourcerequirements-v1-core">
Kubernetes core/v1.ResourceRequirements </a> </em>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<h3 id="numaflow.numaproj.io/v1alpha1.GroupBy">
Expand Down
26 changes: 26 additions & 0 deletions docs/operations/controller-configmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,37 @@ metadata:
name: numaflow-controller-config
data:
controller-config.yaml: |
defaults:
containerResources: |
...
isbsvc:
jetstream:
...
```

### Default Controller Configuration

Currently, we support configuring the init and main container resources for steps across all the pipelines. The configuration is under `defaults` key in the ConfigMap.

For example, to set the default container resources for steps across all the pipelines:
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: numaflow-controller-config
data:
controller-config.yaml: |
defaults:
containerResources: |
limits:
memory: "256Mi"
cpu: "200m"
requests:
memory: "128Mi"
cpu: "100m"
```


### ISB Service Configuration

One of the important configuration items in the ConfigMap is about [ISB Service](../core-concepts/inter-step-buffer-service.md). We currently use 3rd party technologies such as `JetStream` to implement ISB Services, if those applications have new releases, to make them available in Numaflow, the new versions need to be added in the ConfigMap.
Expand Down
5 changes: 5 additions & 0 deletions docs/operations/numaflow-controller-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ metadata:
name: numaflow-controller-config
data:
controller-config.yaml: |
defaults:
containerResources: |
requests:
memory: "128Mi"
cpu: "100m"
isbsvc:
redis:
# Default Redis settings, could be overridden by InterStepBufferService specs
Expand Down
11 changes: 0 additions & 11 deletions pkg/apis/numaflow/v1alpha1/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ package v1alpha1
import (
"fmt"
"time"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
)

const (
Expand Down Expand Up @@ -171,12 +168,4 @@ const (
var (
MessageTagDrop = fmt.Sprintf("%U__DROP__", '\\') // U+005C__DROP__
MessageTagAll = fmt.Sprintf("%U__ALL__", '\\') // U+005C__ALL__

// the standard resources used by the `init` and `main`containers.
standardResources = corev1.ResourceRequirements{
Requests: corev1.ResourceList{
"cpu": resource.MustParse("100m"),
"memory": resource.MustParse("128Mi"),
},
}
)

0 comments on commit c71b2ab

Please sign in to comment.