3.2. 通用配置选项
3.2.1. 资源请求和限值
您可针对 Pod 和卷调整 CPU、内存或存储资源请求和/或限值。以下 default-resource-limits.yaml
提供了一个针对各个组件设置资源请求和限值的示例。
apiVersion: metering.openshift.io/v1 kind: MeteringConfig metadata: name: "operator-metering" spec: reporting-operator: spec: resources: limits: cpu: 1 memory: 500Mi requests: cpu: 500m memory: 100Mi presto: spec: coordinator: resources: limits: cpu: 4 memory: 4Gi requests: cpu: 2 memory: 2Gi worker: replicas: 0 resources: limits: cpu: 8 memory: 8Gi requests: cpu: 4 memory: 2Gi hive: spec: metastore: resources: limits: cpu: 4 memory: 2Gi requests: cpu: 500m memory: 650Mi storage: class: null create: true size: 5Gi server: resources: limits: cpu: 1 memory: 1Gi requests: cpu: 500m memory: 500Mi
3.2.2. 节点选择器
如果要在特定节点集上运行 metering 组件,则可在每个组件上设置 nodeSelectors
,以控制各个 metering 组件的调度位置。以下 node-selectors.yaml
文件提供了一个针对各个组件设置节点选择器的示例。
apiVersion: metering.openshift.io/v1 kind: MeteringConfig metadata: name: "operator-metering" spec: reporting-operator: spec: nodeSelector: "node-role.kubernetes.io/infra": "true" presto: spec: coordinator: nodeSelector: "node-role.kubernetes.io/infra": "true" worker: nodeSelector: "node-role.kubernetes.io/infra": "true" hive: spec: metastore: nodeSelector: "node-role.kubernetes.io/infra": "true" server: nodeSelector: "node-role.kubernetes.io/infra": "true"