title: How to delete podAntiAfinity in Openshift
body: <p>I need to delete the podeAntiAfinity property from multiple deployment configs.</p>
  
  <p>So far I've manage to find a way to update this property using the <strong>oc patch dc</strong>.</p>
  
  <p>My deployment config looks like something like this:</p>
  
  <pre><code>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
          podAntiAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                - key: app
                  operator: In
                  values:
                  - another-app
              topologyKey: kubernetes.io/hostname
  </code></pre>
  
  <p>I would like to remove the <strong>spec.template.spec.affinity.podAntiAffinity</strong> while keeping the <strong>spec.template.spec.affinity.nodeAffinity</strong>.</p>
  
  <p>Could anybody help please?</p>