It looks like the volumes section is not indented correctly. It should be indented to the same level as containers as it is part of the PodSpec[1].
[1] https://v1-6.docs.kubernetes.io/docs/api-reference/v1.6/#podspec-v1-core Brandon On Mon, Nov 13, 2017 at 2:00 PM <sandeepnaidum1...@gmail.com> wrote: > Hi i am trying to mount the volume from container to host and throwing an > exception to me . > My > yaml is like this > > apiVersion: extensions/v1beta1 > kind: Deployment > metadata: > name: vthree-f3dev-app-pod-volumes > labels: > component: apiserver > provider: kubernetes > spec: > replicas: 1 > selector: > template: > metadata: > labels: > component: apiserver > provider: kubernetes > spec: > containers: > - name: f3dev > image: XXXXXXXXXXXXXXXXXX > ports: > - containerPort: 8443 > volumeMounts: > - mountPath: /etc/tomcat8/logs > name: test-volume > env: > - name : VTHREE_F3DEV_APP_POD_SERVICE_CONTEXT_ROOT > value : "f3dev" > - name : SOLR_SERVC_CONTEXT_ROOT > value : "solr" > volumes: > - name: test-volume > hostPath: > path: /logs/f3dev-pod-logs > > > > And i am getting error while i am trying to deploy this > > The Deployment "vthree-f3dev-app-pod-volumes" is invalid: > spec.template.spec.containers[0].volumeMounts[0].name: Not found: > "test-volume" > > > > my kubctl version > > kubectl --version > Kubernetes v1.5.2 > > > Please suggest me where i am doing wrong . > > > -- > You received this message because you are subscribed to the Google Groups > "Kubernetes user discussion and Q&A" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to kubernetes-users+unsubscr...@googlegroups.com. > To post to this group, send email to kubernetes-users@googlegroups.com. > Visit this group at https://groups.google.com/group/kubernetes-users. > For more options, visit https://groups.google.com/d/optout. > -- CTO, CoreOS, Inc Tectonic is enterprise Kubernetes https://coreos.com/tectonic -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscr...@googlegroups.com. To post to this group, send email to kubernetes-users@googlegroups.com. Visit this group at https://groups.google.com/group/kubernetes-users. For more options, visit https://groups.google.com/d/optout.