mirror of https://github.com/knative/docs.git
Add the instruction on how to configure nodeSelector, tolerations and affinity (#4277)
* Add the instruction on how to configure nodeSelector, tolerations and affinity * Keep the docs consistent in terms of the syntax
This commit is contained in:
parent
cbdb2d7ce8
commit
1e3e7b1a15
|
@ -10,8 +10,6 @@ aliases:
|
|||
|
||||
You can configure the Knative Eventing operator by modifying settings in the KnativeEventing custom resource (CR).
|
||||
|
||||
**NOTE:** Kubernetes spec level policies cannot be configured using the Knative Operators.
|
||||
|
||||
<!--TODO: break this into sub sections like for the channels sections, i.e. a page per topic-->
|
||||
|
||||
## Installing a specific version of Eventing
|
||||
|
@ -316,3 +314,100 @@ spec:
|
|||
cpu: 1000m
|
||||
memory: 250Mi
|
||||
```
|
||||
|
||||
### Override the nodeSelector
|
||||
|
||||
The KnativeEventing resource is able to override the nodeSelector for the Knative Eventing deployment resources.
|
||||
For example, if you would like to add the following tolerations
|
||||
|
||||
```yaml
|
||||
nodeSelector:
|
||||
disktype: hdd
|
||||
```
|
||||
|
||||
to the deployment `eventing-controller`, you need to change your KnativeEventing CR as below:
|
||||
|
||||
```yaml
|
||||
apiVersion: operator.knative.dev/v1alpha1
|
||||
kind: KnativeEventing
|
||||
metadata:
|
||||
name: knative-eventing
|
||||
namespace: knative-eventing
|
||||
spec:
|
||||
deployments:
|
||||
- name: eventing-controller
|
||||
nodeSelector:
|
||||
disktype: hdd
|
||||
```
|
||||
|
||||
### Override the tolerations
|
||||
|
||||
The KnativeEventing resource is able to override tolerations for the Knative Eventing deployment resources.
|
||||
For example, if you would like to add the following tolerations
|
||||
|
||||
```yaml
|
||||
tolerations:
|
||||
- key: "key1"
|
||||
operator: "Equal"
|
||||
value: "value1"
|
||||
effect: "NoSchedule"
|
||||
```
|
||||
|
||||
to the deployment `eventing-controller`, you need to change your KnativeEventing CR as below:
|
||||
|
||||
```yaml
|
||||
apiVersion: operator.knative.dev/v1alpha1
|
||||
kind: KnativeEventing
|
||||
metadata:
|
||||
name: knative-eventing
|
||||
namespace: knative-eventing
|
||||
spec:
|
||||
deployments:
|
||||
- name: eventing-controller
|
||||
tolerations:
|
||||
- key: "key1"
|
||||
operator: "Equal"
|
||||
value: "value1"
|
||||
effect: "NoSchedule"
|
||||
```
|
||||
|
||||
### Override the affinity
|
||||
|
||||
The KnativeEventing resource is able to override the affinity, including nodeAffinity, podAffinity, and podAntiAffinity,
|
||||
for the Knative Eventing deployment resources. For example, if you would like to add the following nodeAffinity
|
||||
|
||||
```yaml
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 1
|
||||
preference:
|
||||
matchExpressions:
|
||||
- key: disktype
|
||||
operator: In
|
||||
values:
|
||||
- ssd
|
||||
```
|
||||
|
||||
to the deployment `activator`, you need to change your KnativeEventing CR as below:
|
||||
|
||||
```yaml
|
||||
apiVersion: operator.knative.dev/v1alpha1
|
||||
kind: KnativeEventing
|
||||
metadata:
|
||||
name: knative-eventing
|
||||
namespace: knative-eventing
|
||||
spec:
|
||||
deployments:
|
||||
- name: activator
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 1
|
||||
preference:
|
||||
matchExpressions:
|
||||
- key: disktype
|
||||
operator: In
|
||||
values:
|
||||
- ssd
|
||||
```
|
||||
|
|
|
@ -468,7 +468,7 @@ while other system deployments have `2` Replicas by using `spec.high-availabilit
|
|||
apiVersion: operator.knative.dev/v1alpha1
|
||||
kind: KnativeServing
|
||||
metadata:
|
||||
name: ks
|
||||
name: knative-serving
|
||||
namespace: knative-serving
|
||||
spec:
|
||||
high-availability:
|
||||
|
@ -485,7 +485,7 @@ spec:
|
|||
!!! note
|
||||
The KnativeServing resource `label` and `annotation` settings override the webhook's labels and annotations for both Deployments and Pods.
|
||||
|
||||
### Override nodeSelector
|
||||
### Override the nodeSelector
|
||||
|
||||
The following KnativeServing resource overrides the `webhook` deployment to use the `disktype: hdd` nodeSelector:
|
||||
|
||||
|
@ -493,7 +493,7 @@ The following KnativeServing resource overrides the `webhook` deployment to use
|
|||
apiVersion: operator.knative.dev/v1alpha1
|
||||
kind: KnativeServing
|
||||
metadata:
|
||||
name: ks
|
||||
name: knative-serving
|
||||
namespace: knative-serving
|
||||
spec:
|
||||
deployments:
|
||||
|
@ -501,3 +501,75 @@ spec:
|
|||
nodeSelector:
|
||||
disktype: hdd
|
||||
```
|
||||
|
||||
### Override the tolerations
|
||||
|
||||
The KnativeServing resource is able to override tolerations for the Knative Serving deployment resources.
|
||||
For example, if you would like to add the following tolerations
|
||||
|
||||
```yaml
|
||||
tolerations:
|
||||
- key: "key1"
|
||||
operator: "Equal"
|
||||
value: "value1"
|
||||
effect: "NoSchedule"
|
||||
```
|
||||
|
||||
to the deployment `activator`, you need to change your KnativeServing CR as below:
|
||||
|
||||
```yaml
|
||||
apiVersion: operator.knative.dev/v1alpha1
|
||||
kind: KnativeServing
|
||||
metadata:
|
||||
name: knative-serving
|
||||
namespace: knative-serving
|
||||
spec:
|
||||
deployments:
|
||||
- name: activator
|
||||
tolerations:
|
||||
- key: "key1"
|
||||
operator: "Equal"
|
||||
value: "value1"
|
||||
effect: "NoSchedule"
|
||||
```
|
||||
|
||||
### Override the affinity
|
||||
|
||||
The KnativeServing resource is able to override the affinity, including nodeAffinity, podAffinity, and podAntiAffinity,
|
||||
for the Knative Serving deployment resources. For example, if you would like to add the following nodeAffinity
|
||||
|
||||
```yaml
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 1
|
||||
preference:
|
||||
matchExpressions:
|
||||
- key: disktype
|
||||
operator: In
|
||||
values:
|
||||
- ssd
|
||||
```
|
||||
|
||||
to the deployment `activator`, you need to change your KnativeServing CR as below:
|
||||
|
||||
```yaml
|
||||
apiVersion: operator.knative.dev/v1alpha1
|
||||
kind: KnativeServing
|
||||
metadata:
|
||||
name: knative-serving
|
||||
namespace: knative-serving
|
||||
spec:
|
||||
deployments:
|
||||
- name: activator
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 1
|
||||
preference:
|
||||
matchExpressions:
|
||||
- key: disktype
|
||||
operator: In
|
||||
values:
|
||||
- ssd
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue