apiVersion: v1
kind: Pod
metadata:
  name: with-newlabels
  annotations:
    scheduler.alpha.kubernetes.io/affinity: >
      {
        "podAffinity": {
          "requiredDuringSchedulingIgnoredDuringExecution": [{
            "labelSelector": {
              "matchExpressions": [{
                "key": "security",
                "operator": "In",
                "values":["S1"]
              }]
            },
            "topologyKey": "kubernetes.io/hostname"
          }]
        },
        "podAntiAffinity": {
          "requiredDuringSchedulingIgnoredDuringExecution": [{
            "labelSelector": {
              "matchExpressions": [{
                "key": "security",
                "operator": "In",
                "values":["S2"]
              }]
            },
            "topologyKey": "kubernetes.io/hostname"
          }]
        }
      }
    another-annotation-key: another-annotation-value
spec:
  containers:
  - name: with-newlabels
    image: gcr.io/google_containers/pause:2.0
