<p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/.):No" rel="nofollow">http://kubernetes.io/docs/troubleshooting/.):No</a></p>
<p dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):HostPath  not working</p>
<hr>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one):BUG REPORT</p>

<p dir="auto"><strong>Kubernetes version</strong> (use <code class="notranslate">kubectl version</code>): 1.4.5</p>
<p dir="auto"><strong>Environment</strong>:</p>
<ul dir="auto">
<li><strong>Cloud provider or hardware configuration</strong>: Amazon EC2</li>
<li><strong>OS</strong> (e.g. from /etc/os-release): Linux</li>
<li><strong>Kernel</strong> (e.g. <code class="notranslate">uname -a</code>):Linux</li>
<li><strong>Install tools</strong>:</li>
<li><strong>Others</strong>:</li>
</ul>
<p dir="auto"><strong>What happened</strong>: Kubernetes Hostpath on AWS EC2 Volumn is not working</p>
<p dir="auto"><strong>What you expected to happen</strong>:  i have some file in host vm which i would like to use in pods, but in pods is not sync those file.</p>
<p dir="auto"><strong>How to reproduce it</strong> (as minimally and precisely as possible):</p>
<p dir="auto">I am using Kubernetes in AWS EC2 i want to use EC2 instance directory (which has some properties file ) in pods, so i have below yml file.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ec2-user@ip-XXX-XX-XX-XX symtmp]$ pwd
/symtmp
[ec2-user@ip-XXX-XX-XX-XX symtmp]$ ls
head.properties
[ec2-user@ip-XXX-XX-XX-XX symtmp]$"><pre class="notranslate"><code class="notranslate">[ec2-user@ip-XXX-XX-XX-XX symtmp]$ pwd
/symtmp
[ec2-user@ip-XXX-XX-XX-XX symtmp]$ ls
head.properties
[ec2-user@ip-XXX-XX-XX-XX symtmp]$
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: symserver
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: symserver
    spec:
      volumes:
      - name: symtmp
        hostPath:
          path: /symtmp
      containers:
      - name: symserver
        image:symserver:latest
        env:
        - name: JAVA_OPTS
          value: Ddatabase.url=amazonaws.com
        ports:
        - containerPort: 8080
        volumeMounts:
        - name: symtmp
          mountPath: /symtmp
      securityContext:
        fsGroup: 1234
        supplementalGroups: [5678]
        seLinuxOptions:
          level: &quot;s0:c123,c456&quot;"><pre class="notranslate"><code class="notranslate">apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: symserver
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: symserver
    spec:
      volumes:
      - name: symtmp
        hostPath:
          path: /symtmp
      containers:
      - name: symserver
        image:symserver:latest
        env:
        - name: JAVA_OPTS
          value: Ddatabase.url=amazonaws.com
        ports:
        - containerPort: 8080
        volumeMounts:
        - name: symtmp
          mountPath: /symtmp
      securityContext:
        fsGroup: 1234
        supplementalGroups: [5678]
        seLinuxOptions:
          level: "s0:c123,c456"
</code></pre></div>
<p dir="auto">But look like its no working i have logged in to pods to see if file is copied or not.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ec2-user@ip-XXX-XX-XX-XX symtmp]$ kubectl exec -ti symserver -                                                                            - sh
# pwd
/symtmp
# ls
#"><pre class="notranslate"><code class="notranslate">[ec2-user@ip-XXX-XX-XX-XX symtmp]$ kubectl exec -ti symserver -                                                                            - sh
# pwd
/symtmp
# ls
#
</code></pre></div>
<p dir="auto">I am not sure why hostpath is no working directory is getting created in pod but i cant get the file in pods.</p>
<p dir="auto"><strong>Anything else do we need to know</strong>:</p>
<p dir="auto"><strong>Is this a request for help?</strong> (If yes, you should use our troubleshooting guide and community support channels, see <a href="http://kubernetes.io/docs/troubleshooting/" rel="nofollow">http://kubernetes.io/docs/troubleshooting/</a>.):<br>
No</p>
<h2 dir="auto"><strong>What keywords did you search in Kubernetes issues before filing this one?</strong> (If you have found any duplicates, you should instead reply there.):<br>
kube-proxy service iptables</h2>
<p dir="auto"><strong>Is this a BUG REPORT or FEATURE REQUEST?</strong> (choose one):<br>
Feature request</p>

<p dir="auto"><strong>Anything else do we need to know</strong>:</p>
<p dir="auto">Anyone taking Kubernetes to production generally ends up having to bypass kube-proxy to have sensible service load balancing between components. People are using sidecar http proxies, haproxy replacements of kube-proxy, and other types of workarounds to deal with the limitations of kube-proxy.</p>
<p dir="auto">Problems with kube-proxy:</p>
<ol dir="auto">
<li>Simplistic, naive load balancing using probabilities, that can easily result in imbalanced requests to downstream systems.</li>
<li>Poor support for keepalive connections, which most http/rpc clients use. (1) exacerbates this, since the poor balancing persists for a long time under load. Rolling deployments can skew it even further.</li>
<li>Impossible to do non-disruptive deployments when (2) keepalives are involved - there isn't a great way to gracefully drain the connections or move them to the new pods.</li>
</ol>
<p dir="auto">As a result, I find kube-proxy is only suitable for the most simple use cases. It needs a rethink. A solution would be a userspace proxy which is endpoint aware. kube-proxy really needs some attention!</p>