<p>I have Istio (including citadel) running in minikube using the instructions at <a href="https://istio.io/docs/setup/kubernetes/helm-install" rel="nofollow noreferrer">https://istio.io/docs/setup/kubernetes/helm-install</a> .</p>

<pre><code>$ helm template install/kubernetes/helm/istio --name istio --namespace istio-system &gt; $HOME/istio.yaml
$ kubectl create namespace istio-system
$ kubectl apply -f $HOME/istio.yaml
</code></pre>

<p>When I try to get a shell into the citadel container, I am getting an error:</p>

<pre><code>$ kubectl exec -it istio-citadel-6d7f9c545b-bkvnx  -- /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown
command terminated with exit code 126
</code></pre>

<p>However, I can exec into other containers like pilot fine.</p>

<p>These are my pods and containers, if it helps.</p>

<pre><code>shell-demo:                             nginx,
istio-citadel-6d7f9c545b-bkvnx:         docker.io/istio/citadel:1.0.3,
istio-cleanup-secrets-rp4wv:            quay.io/coreos/hyperkube:v1.7.6_coreos.0,
istio-egressgateway-866885bb49-6jz9q:   docker.io/istio/proxyv2:1.0.3,
istio-galley-6d74549bb9-7nhcl:          docker.io/istio/galley:1.0.3,
istio-ingressgateway-6c6ffb7dc8-bvp6b:  docker.io/istio/proxyv2:1.0.3,
istio-pilot-685fc95d96-fphc9:           docker.io/istio/pilot:1.0.3, docker.io/istio/proxyv2:1.0.3,
istio-policy-688f99c9c4-bpl9w:          docker.io/istio/mixer:1.0.3, docker.io/istio/proxyv2:1.0.3,
istio-security-post-install-s6dft:      quay.io/coreos/hyperkube:v1.7.6_coreos.0,
istio-sidecar-injector-74855c54b9-6v5xg:docker.io/istio/sidecar_injector:1.0.3,
istio-telemetry-69b794ff59-f7dv4:       docker.io/istio/mixer:1.0.3, docker.io/istio/proxyv2:1.0.3,
prometheus-f556886b8-lhdt8:             docker.io/prom/prometheus:v2.3.1,
coredns-c4cffd6dc-6xblf:                k8s.gcr.io/coredns:1.2.2,
etcd-minikube:                          k8s.gcr.io/etcd-amd64:3.1.12,
kube-addon-manager-minikube:            k8s.gcr.io/kube-addon-manager:v8.6,
kube-apiserver-minikube:                k8s.gcr.io/kube-apiserver-amd64:v1.10.0,
kube-controller-manager-minikube:       k8s.gcr.io/kube-controller-manager-amd64:v1.10.0,
kube-dns-86f4d74b45-bjk54:              k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.8, k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.8, k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.8,
kube-proxy-mqfb9:                       k8s.gcr.io/kube-proxy-amd64:v1.10.0,
kube-scheduler-minikube:                k8s.gcr.io/kube-scheduler-amd64:v1.10.0,
kubernetes-dashboard-6f4cfc5d87-zwk2c:  k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0,
storage-provisioner:                    gcr.io/k8s-minikube/storage-provisioner:v1.8.1,
</code></pre>

<p>When I do minikube ssh and then try to exec into the citadel container, I am getting similar error:</p>

<pre><code>$ docker ps | grep citadel
f173453f843c        istio/citadel                              "/usr/local/bin/isti…"   3 hours ago         Up 3 hours                              k8s_citadel_istio-citadel-6d7f9c545b-bkvnx_istio-system_3d7b4f08-e120-11e8-bc40-ee7dbbb8f91b_0
7e96617d81ff        k8s.gcr.io/pause-amd64:3.1                 "/pause"                 3 hours ago         Up 3 hours                              k8s_POD_istio-citadel-6d7f9c545b-bkvnx_istio-system_3d7b4f08-e120-11e8-bc40-ee7dbbb8f91b_0

$ docker exec -it f173453f843c sh
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"sh\": executable file not found in $PATH": unknown

$ docker exec -it f173453f843c /bin/sh
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown

$ docker exec -it f173453f843c ls
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"ls\": executable file not found in $PATH": unknown
</code></pre>

<p>I can see the citadel containers logs fine. The logs are available at <a href="https://pastebin.com/xTy9vSz2" rel="nofollow noreferrer">https://pastebin.com/xTy9vSz2</a></p>

<p>Do you know why we can't exec into citadel container?</p>

<p>Thanks for reading.</p>

<p>You can't shell in because neither <code>sh</code> nor <code>bash</code> are available in the container. A lot of times these are removed for the sake of efficiency and having a minimal container image. </p>

<p>If you'd like to shell into the container I recommend you build your own image in include <code>bash</code> or <code>sh</code> in it.</p>

<p>You can see here that the <a href="https://github.com/istio/istio/blob/master/security/docker/Dockerfile.citadel" rel="noreferrer">Dockerfile</a> builds an image that has nothing but the static binary. For that, you want to change the base image. For example:</p>

<pre><code>FROM alpine
</code></pre>

<p>instead of: </p>

<pre><code>FROM scratch
</code></pre>

<p>Hope it helps.</p>
