我需要从多个部署配置中删除 podeAntiAfinity 属性。
到目前为止,我已经设法找到一种使用oc 补丁 dc更新此属性的方法。
我的部署配置看起来像这样:
apiVersion: v1
kind: DeploymentConfig
metadata:
annotations:
openshift.io/generated-by: OpenShiftNewApp
creationTimestamp: 2018-05-25T17:31:47Z
generation: 8
labels:
app: my-app
name: my-dc
namespace: my-ns
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
app: my-app
deploymentconfig: my-dc
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 1
maxUnavailable: 100%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
annotations:
alpha.image.policy.openshift.io/resolve-names: '*'
openshift.io/generated-by: OpenShiftNewApp
creationTimestamp: null
labels:
app: my-app
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: someKey
operator: DoesNotExist …Run Code Online (Sandbox Code Playgroud)