31.3. 设置全局构建覆盖
您可以通过两种方式设置全局构建覆盖:
31.3.1. 使用 Ansible 配置全局构建覆盖
在集群安装过程中,BuildOverrides
插件可以使用以下参数来配置,该插件可在清单文件中配置:
-
openshift_buildoverrides_force_pull
-
openshift_buildoverrides_image_labels
-
openshift_buildoverrides_nodeselectors
-
openshift_buildoverrides_annotations
-
openshift_buildoverrides_tolerations
例 31.2. 使用 Ansible 构建覆盖配置示例
# These options configure the BuildOverrides admission controller which injects # configuration into Builds. openshift_buildoverrides_force_pull=true openshift_buildoverrides_image_labels=[{'name':'imagelabelname1','value':'imagelabelvalue1'}] openshift_buildoverrides_nodeselectors={'nodelabel1':'nodelabelvalue1'} openshift_buildoverrides_annotations={'annotationkey1':'annotationvalue1'} openshift_buildoverrides_tolerations=[{'key':'mykey1','value':'myvalue1','effect':'NoSchedule','operator':'Equal'}] # Or you may optionally define your own build overrides configuration serialized as json #openshift_buildoverrides_json='{"BuildOverrides":{"configuration":{"apiVersion":"v1","kind":"BuildOverridesConfig","forcePull":"true","tolerations":[{'key':'mykey1','value':'myvalue1','effect':'NoSchedule','operator':'Equal'}]}}}'
注意
您必须使用 BuildOverrides
节点选择器来使用 BuildOverrides
插件覆盖容限。