You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi friends
When I create a cluster under a namespace with ResourceQuota set, I found that some resources cannot be set with request and limit, resulting in creation failure.
ResourceQuota yaml:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal SuccessfulCreate <invalid> statefulset-controller create Claim data-opensearch-sample-masters-0 Pod opensearch-sample-masters-0 in StatefulSet opensearch-sample-masters success
Warning FailedCreate <invalid> (x14 over <invalid>) statefulset-controller create Pod opensearch-sample-masters-0 in StatefulSet opensearch-sample-masters failed error: pods "opensearch-sample-masters-0" is forbidden: failed quota: project-middleware-3968: must specify limits.cpu,limits.memory
I reviewed the source code and found that the init container named "init" can inherit the resource settings from Spec.InitHelper.Resources. However, the init containers named "init-sysctl" and "keystore" cannot inherit the resource settings.
In addition to that, I also found that all generated jobs, such as SnapshotRepoconfigUpdateJob and SecurityconfigUpdateJob, cannot have resource settings applied to them.
Below are my modifications:
All init containers can inherit the settings from Spec.InitHelper.Resources.
Add a Job field to Spec and configure all jobs with settings such as Resource, NodeSelector, Label, etc. as shown below:
type ClusterSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
General GeneralConfig `json:"general,omitempty"`
ConfMgmt ConfMgmt `json:"confMgmt,omitempty"`
Bootstrap BootstrapConfig `json:"bootstrap,omitempty"`
Dashboards DashboardsConfig `json:"dashboards,omitempty"`
Security *Security `json:"security,omitempty"`
NodePools []NodePool `json:"nodePools"`
InitHelper InitHelperConfig `json:"initHelper,omitempty"`
Job JobConfig `json:"job,omitempty"`
}
type JobConfig struct {
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
Affinity *corev1.Affinity `json:"affinity,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
}
The text was updated successfully, but these errors were encountered:
…ntainer inherit the settings from Spec.InitHelper.Resource
opensearchcluster spec add Job resource config and all initcontainer inherit the settings from Spec.InitHelper.Resource
Signed-off-by: wangshulei098 <[email protected]>
opensearch-project#678
Hi friends
When I create a cluster under a namespace with ResourceQuota set, I found that some resources cannot be set with request and limit, resulting in creation failure.
ResourceQuota yaml:
opensearch statefulset describe like:
I reviewed the source code and found that the init container named "init" can inherit the resource settings from Spec.InitHelper.Resources. However, the init containers named "init-sysctl" and "keystore" cannot inherit the resource settings.
In addition to that, I also found that all generated jobs, such as SnapshotRepoconfigUpdateJob and SecurityconfigUpdateJob, cannot have resource settings applied to them.
Below are my modifications:
The text was updated successfully, but these errors were encountered: