Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostPath type volume gets mounted as emptyDir #116

Closed
Amey-D opened this issue Mar 14, 2018 · 1 comment
Closed

hostPath type volume gets mounted as emptyDir #116

Amey-D opened this issue Mar 14, 2018 · 1 comment

Comments

@Amey-D
Copy link

Amey-D commented Mar 14, 2018

While trying to deploy a custom model on Seldon Core on minikube, I noticed that if I add volume mount of type hostPath, the resulting pod gets configured with type emptyDir. Is this a known issue?

I am able to repro to issue using the sklearn_iris_deployment.json example, as follows:

$ minikube version
minikube version: v0.25.0
$ minikube ssh

### Inside minikube ssh session:
$ sudo mkdir /data
$ sudo touch /data/foo
$ ls -l /data
total 0
-rw-r--r-- 1 root root 0 Mar 14 21:21 foo

Inside seldon-core/examples/models/sklearn_iris directory:

$ git diff 
diff --git a/examples/models/sklearn_iris/sklearn_iris_deployment.json b/examples/models/sklearn_iris/sklearn_iris_deployment.json
index 08d930e..a7e94ab 100644
--- a/examples/models/sklearn_iris/sklearn_iris_deployment.json
+++ b/examples/models/sklearn_iris/sklearn_iris_deployment.json
@@ -28,9 +28,24 @@
                                     "requests": {
                                         "memory": "1Mi"
                                     }
-                                }
+                                },
+                               "volumeMounts": [
+                                   {
+                                       "mountPath": "/data",
+                                       "name": "data"
+                                   }
+                               ]
                             }
                         ],
+                       "volumes": [
+                           {
+                               "name": "data",
+                               "hostPath": {
+                                   "path": "/data",
+                                   "type": "Directory"
+                               }
+                           }
+                       ],
                         "terminationGracePeriodSeconds": 20
                     }
                 },

$ kubectl apply -f sklearn_iris_deployment.json
seldondeployment "seldon-deployment-example" configured

$ kubectl describe pods sklearn-iris-deployment-sklearn-iris-predictor-7d8ff978b6-85g8p
Name:           sklearn-iris-deployment-sklearn-iris-predictor-7d8ff978b6-85g8p
Namespace:      default
Node:           minikube/192.168.99.100
Start Time:     Wed, 14 Mar 2018 14:43:32 -0700
Labels:         pod-template-hash=3849953462
                seldon-app=sklearn-iris-deployment
Annotations:    prometheus.io/path=/prometheus
                prometheus.io/port=8000
                prometheus.io/scrape=true
Status:         Running
IP:             172.17.0.9
Controlled By:  ReplicaSet/sklearn-iris-deployment-sklearn-iris-predictor-7d8ff978b6
Containers:
  sklearn-iris-classifier:
    Container ID:   docker://9994c1b1283c0012481c171ec650f86edfea7ad227f862352e2ce9cc4f2f0283
    Image:          seldonio/irisclassifier:0.1
    Image ID:       docker://sha256:d327c4e7c32134f2d7668ad97b4e65f61f3e143a01d48c6fb1d374505a871168
    Port:           9000/TCP
    State:          Running
      Started:      Wed, 14 Mar 2018 14:43:33 -0700
    Ready:          True
    Restart Count:  0
    Requests:
      memory:   1Mi
    Liveness:   tcp-socket :http delay=10s timeout=1s period=5s #success=1 #failure=3
    Readiness:  tcp-socket :http delay=10s timeout=1s period=5s #success=1 #failure=3
    Environment:
      PREDICTIVE_UNIT_SERVICE_PORT:  9000
      PREDICTIVE_UNIT_PARAMETERS:    []
      PREDICTIVE_UNIT_ID:            sklearn-iris-classifier
      PREDICTOR_ID:                  sklearn-iris-predictor
      SELDON_DEPLOYMENT_ID:          seldon-deployment-example
    Mounts:
      /data from data (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-8plwx (ro)
  seldon-container-engine:
    Container ID:   docker://62bbe0665e8faac51552989dba171e466132676410d9e7d1c5616ef0895678a2
    Image:          seldonio/engine:0.1.5
    Image ID:       docker-pullable://seldonio/engine@sha256:389de5dad7e63774cf90bd46799f425ec7da0dd4f61c997ef10549c40d7463ef
    Ports:          8000/TCP, 8082/TCP
    State:          Running
      Started:      Wed, 14 Mar 2018 14:43:33 -0700
    Ready:          True
    Restart Count:  0
    Requests:
      cpu:      100m
    Liveness:   http-get http://:admin/ready delay=10s timeout=2s period=10s #success=1 #failure=3
    Readiness:  http-get http://:admin/ready delay=10s timeout=2s period=10s #success=1 #failure=3
    Environment:
      ENGINE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MiOjEsImFubm90YXRpb25zIjp7InByZWRpY3Rvcl92ZXJzaW9uIjoiMC4xIn19XSwib2F1dGhfa2V5Ijoib2F1dGgta2V5Iiwib2F1dGhfc2VjcmV0Ijoib2F1dGgtc2VjcmV0IiwiYW5ub3RhdGlvbnMiOnsiZGVwbG95bWVudF92ZXJzaW9uIjoiMC4xIiwicHJvamVjdF9uYW1lIjoiSXJpcyBjbGFzc2lmaWNhdGlvbiJ9fX0=
      ENGINE_SERVER_PORT:        8000
      ENGINE_SERVER_GRPC_PORT:   5001
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-8plwx (ro)
Conditions:
  Type           Status
  Initialized    True 
  Ready          True 
  PodScheduled   True 
Volumes:
  data:
    Type:    EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
  default-token-8plwx:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-8plwx
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  <none>
Tolerations:     <none>
Events:
  Type     Reason                 Age   From               Message
  ----     ------                 ----  ----               -------
  Normal   Scheduled              54s   default-scheduler  Successfully assigned sklearn-iris-deployment-sklearn-iris-predictor-7d8ff978b6-85g8p to minikube
  Normal   SuccessfulMountVolume  54s   kubelet, minikube  MountVolume.SetUp succeeded for volume "data"
  Normal   SuccessfulMountVolume  54s   kubelet, minikube  MountVolume.SetUp succeeded for volume "default-token-8plwx"
  Normal   Pulled                 53s   kubelet, minikube  Container image "seldonio/irisclassifier:0.1" already present on machine
  Normal   Created                53s   kubelet, minikube  Created container
  Normal   Started                53s   kubelet, minikube  Started container
  Normal   Pulled                 53s   kubelet, minikube  Container image "seldonio/engine:0.1.5" already present on machine
  Normal   Created                53s   kubelet, minikube  Created container
  Normal   Started                53s   kubelet, minikube  Started container
  Warning  Unhealthy              42s   kubelet, minikube  Liveness probe failed: Get http://172.17.0.9:8082/ready: dial tcp 172.17.0.9:8082: getsockopt: connection refused 

The deployment is functional otherwise i.e. I can run curl commands on [1] and retrieve predictions.

References:
[1] https://github.com/SeldonIO/seldon-core/blob/master/docs/getting_started/minikube.md
[2] https://kubernetes.io/docs/concepts/storage/volumes/#hostpath

@ukclivecox
Copy link
Contributor

At present you need to use the form with "volumeSource"

"volumes": [
			    {
				"name": "data",
				"volumeSource": {
				    "hostPath": {
					"path": "/data",
					"type": "Directory"
				    }
				}
			    }
			],

This is due to the fact we use the k8s proto buffers to parse the PodTemplateSpec and it needs the explicit form of declaring volumes using volumeSource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants