apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: daemonset
  labels:
    app: nginx
spec:
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/hostname
                operator: In
                values:
                - sorbonne-1
                - sorbonne-2
      containers:
      - name: nginx
        image: nginx:1.7.9
        ports:
        - containerPort: 80
