From 4faf7824c911d4ae22b00cb3ffd139d2b9627f82 Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng@yasker.org>
Date: Wed, 3 Oct 2018 11:42:16 -0700
Subject: [PATCH] Add pod with node affinity example

---
 example/example-pod-with-node-affinity.yaml | 28 +++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 example/example-pod-with-node-affinity.yaml

diff --git a/example/example-pod-with-node-affinity.yaml b/example/example-pod-with-node-affinity.yaml
new file mode 100644
index 00000000..ebe89654
--- /dev/null
+++ b/example/example-pod-with-node-affinity.yaml
@@ -0,0 +1,28 @@
+apiVersion: v1
+kind: Pod
+metadata:
+  name: volume-test
+  namespace: default
+spec:
+  containers:
+  - name: volume-test
+    image: nginx:stable-alpine
+    imagePullPolicy: IfNotPresent
+    volumeMounts:
+    - name: volv
+      mountPath: /data
+    ports:
+    - containerPort: 80
+  volumes:
+  - name: volv
+    persistentVolumeClaim:
+      claimName: local-path-pvc
+  affinity:
+    nodeAffinity:
+      requiredDuringSchedulingIgnoredDuringExecution:
+        nodeSelectorTerms:
+        - matchExpressions:
+          - key: kubernetes.io/hostname
+            operator: In
+            values:
+            - yasker-lp-dev1
-- 
GitLab