<p>I install kube1.10.3 in two virtualbox(centos 7.4) in my win10 machine. I use git clone to get prometheus yaml files. </p>

<pre><code>git clone https://github.com/kubernetes/kubernetes
</code></pre>

<p>Then I enter kubernetes/cluster/addons/prometheus annd follow this order to create pods:</p>

<pre><code>alertmanager-configmap.yaml
alertmanager-pvc.yaml
alertmanager-deployment.yaml
alertmanager-service.yaml

kube-state-metrics-rbac.yaml
kube-state-metrics-deployment.yaml
kube-state-metrics-service.yaml

node-exporter-ds.yml
node-exporter-service.yaml

prometheus-configmap.yaml
prometheus-rbac.yaml
prometheus-statefulset.yaml
prometheus-service.yaml
</code></pre>

<p>But Prometheus and alertmanage are in pending state:</p>

<pre><code>kube-system   alertmanager-6bd9584b85-j4h5m              0/2       Pending   0          9m
kube-system   calico-etcd-pnwtr                          1/1       Running   0          16m
kube-system   calico-kube-controllers-5d74847676-mjq4j   1/1       Running   0          16m
kube-system   calico-node-59xfk                          2/2       Running   1          16m
kube-system   calico-node-rqsh5                          2/2       Running   1          16m
kube-system   coredns-7997f8864c-ckhsq                   1/1       Running   0          16m
kube-system   coredns-7997f8864c-jjtvq                   1/1       Running   0          16m
kube-system   etcd-master16g                             1/1       Running   0          15m
kube-system   heapster-589b7db6c9-mpmks                  1/1       Running   0          16m
kube-system   kube-apiserver-master16g                   1/1       Running   0          15m
kube-system   kube-controller-manager-master16g          1/1       Running   0          15m
kube-system   kube-proxy-hqq49                           1/1       Running   0          16m
kube-system   kube-proxy-l8hmh                           1/1       Running   0          16m
kube-system   kube-scheduler-master16g                   1/1       Running   0          16m
kube-system   kube-state-metrics-8595f97c4-g6x5x         2/2       Running   0          8m
kube-system   kubernetes-dashboard-7d5dcdb6d9-944xl      1/1       Running   0          16m
kube-system   monitoring-grafana-7b767fb8dd-mg6dd        1/1       Running   0          16m
kube-system   monitoring-influxdb-54bd58b4c9-z9tgd       1/1       Running   0          16m
kube-system   node-exporter-f6pmw                        1/1       Running   0          8m
kube-system   node-exporter-zsd9b                        1/1       Running   0          8m
kube-system   prometheus-0                               0/2       Pending   0          7m
</code></pre>

<p>I checked prometheus pod by command shown below:</p>

<pre><code>[root@master16g prometheus]# kubectl describe pod prometheus-0 -n kube-system
Name:           prometheus-0
Namespace:      kube-system
Node:           &lt;none&gt;
Labels:         controller-revision-hash=prometheus-8fc558cb5
                k8s-app=prometheus
                statefulset.kubernetes.io/pod-name=prometheus-0
Annotations:    scheduler.alpha.kubernetes.io/critical-pod=
Status:         Pending
IP:
Controlled By:  StatefulSet/prometheus
Init Containers:
  init-chown-data:
    Image:      busybox:latest
    Port:       &lt;none&gt;
    Host Port:  &lt;none&gt;
    Command:
      chown
      -R
      65534:65534
      /data
    Environment:  &lt;none&gt;
    Mounts:
      /data from prometheus-data (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from prometheus-token-f6v42 (ro)
Containers:
  prometheus-server-configmap-reload:
    Image:      jimmidyson/configmap-reload:v0.1
    Port:       &lt;none&gt;
    Host Port:  &lt;none&gt;
    Args:
      --volume-dir=/etc/config
      --webhook-url=http://localhost:9090/-/reload
    Limits:
      cpu:     10m
      memory:  10Mi
    Requests:
      cpu:        10m
      memory:     10Mi
    Environment:  &lt;none&gt;
    Mounts:
      /etc/config from config-volume (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from prometheus-token-f6v42 (ro)
  prometheus-server:
    Image:      prom/prometheus:v2.2.1
    Port:       9090/TCP
    Host Port:  0/TCP
    Args:
      --config.file=/etc/config/prometheus.yml
      --storage.tsdb.path=/data
      --web.console.libraries=/etc/prometheus/console_libraries
      --web.console.templates=/etc/prometheus/consoles
      --web.enable-lifecycle
    Limits:
      cpu:     200m
      memory:  1000Mi
    Requests:
      cpu:        200m
      memory:     1000Mi
    Liveness:     http-get http://:9090/-/healthy delay=30s timeout=30s period=10s #success=1 #failure=3
    Readiness:    http-get http://:9090/-/ready delay=30s timeout=30s period=10s #success=1 #failure=3
    Environment:  &lt;none&gt;
    Mounts:
      /data from prometheus-data (rw)
      /etc/config from config-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from prometheus-token-f6v42 (ro)
Conditions:
  Type           Status
  PodScheduled   False
Volumes:
  prometheus-data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  prometheus-data-prometheus-0
    ReadOnly:   false
  config-volume:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      prometheus-config
    Optional:  false
  prometheus-token-f6v42:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  prometheus-token-f6v42
    Optional:    false
QoS Class:       Guaranteed
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason            Age                From               Message
  ----     ------            ----               ----               -------
  Warning  FailedScheduling  42s (x22 over 5m)  default-scheduler  pod has unbound PersistentVolumeClaims (repeated 2 times)
</code></pre>

<p>In the last line, it shows warning message: pod has unbound PersistentVolumeClaims (repeated 2 times)</p>

<p>The Prometheus logs says:</p>

<pre><code>[root@master16g prometheus]# kubectl logs prometheus-0 -n kube-system
Error from server (BadRequest): a container name must be specified for pod prometheus-0, choose one of: [prometheus-server-configmap-reload prometheus-server] or one of the init containers: [init-chown-data]
</code></pre>

<p>The I describe alertmanager pod and its logs:</p>

<pre><code>[root@master16g prometheus]# kubectl describe pod alertmanager-6bd9584b85-j4h5m -n kube-system
Name:           alertmanager-6bd9584b85-j4h5m
Namespace:      kube-system
Node:           &lt;none&gt;
Labels:         k8s-app=alertmanager
                pod-template-hash=2685140641
                version=v0.14.0
Annotations:    scheduler.alpha.kubernetes.io/critical-pod=
Status:         Pending
IP:
Controlled By:  ReplicaSet/alertmanager-6bd9584b85
Containers:
  prometheus-alertmanager:
    Image:      prom/alertmanager:v0.14.0
    Port:       9093/TCP
    Host Port:  0/TCP
    Args:
      --config.file=/etc/config/alertmanager.yml
      --storage.path=/data
      --web.external-url=/
    Limits:
      cpu:     10m
      memory:  50Mi
    Requests:
      cpu:        10m
      memory:     50Mi
    Readiness:    http-get http://:9093/%23/status delay=30s timeout=30s period=10s #success=1 #failure=3
    Environment:  &lt;none&gt;
    Mounts:
      /data from storage-volume (rw)
      /etc/config from config-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-snfrt (ro)
  prometheus-alertmanager-configmap-reload:
    Image:      jimmidyson/configmap-reload:v0.1
    Port:       &lt;none&gt;
    Host Port:  &lt;none&gt;
    Args:
      --volume-dir=/etc/config
      --webhook-url=http://localhost:9093/-/reload
    Limits:
      cpu:     10m
      memory:  10Mi
    Requests:
      cpu:        10m
      memory:     10Mi
    Environment:  &lt;none&gt;
    Mounts:
      /etc/config from config-volume (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-snfrt (ro)
Conditions:
  Type           Status
  PodScheduled   False
Volumes:
  config-volume:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      alertmanager-config
    Optional:  false
  storage-volume:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  alertmanager
    ReadOnly:   false
  default-token-snfrt:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-snfrt
    Optional:    false
QoS Class:       Guaranteed
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason            Age               From               Message
  ----     ------            ----              ----               -------
  Warning  FailedScheduling  3m (x26 over 9m)  default-scheduler  pod has unbound PersistentVolumeClaims (repeated 2 times)
</code></pre>

<p>And its log:</p>

<pre><code>[root@master16g prometheus]# kubectl logs alertmanager-6bd9584b85-j4h5m -n kube-system
Error from server (BadRequest): a container name must be specified for pod alertmanager-6bd9584b85-j4h5m, choose one of: [prometheus-alertmanager prometheus-alertmanager-configmap-reload] 
</code></pre>

<p>It has same warning message as Prometheus:</p>

<pre><code>pod has unbound PersistentVolumeClaims (repeated 2 times)
</code></pre>

<p>Then I get pvc by issuing command as follows:</p>

<pre><code>[root@master16g prometheus]# kubectl get pvc --all-namespaces
NAMESPACE     NAME                           STATUS    VOLUME    CAPACITY   ACCESS MODES   STORAGECLASS   AGE
kube-system   alertmanager                   Pending                                       standard       20m
kube-system   prometheus-data-prometheus-0   Pending                                       standard       19m
</code></pre>

<p>My question is how to make bound persistentVolumnClaim? Why log says container name must be specified?</p>

<p>===============================================================</p>

<h1>Second edition</h1>

<p>Since pvc file defined storage class, so I need to define a storage class yaml. How to do it if I want Nfs or GlusterFs? In this way, I could avoid cloud vendor, like Google or AWS. </p>

<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: alertmanager
  namespace: kube-system
  labels:
    kubernetes.io/cluster-service: "true"
    addonmanager.kubernetes.io/mode: EnsureExists
spec:
  storageClassName: standard
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: "2Gi"
</code></pre>

user84592
<p>This log entry:</p>

<pre><code>Error from server (BadRequest): a container name must be specified for pod alertmanager-6bd9584b85-j4h5m, choose one of: [prometheus-alertmanager prometheus-alertmanager-configmap-reload] 
</code></pre>

<p>means <code>Pod</code> <code>alertmanager-6bd9584b85-j4h5m</code> consists of two containers:</p>

<ul>
<li>prometheus-alertmanager</li>
<li>prometheus-alertmanager-configmap-reload</li>
</ul>

<p>When you use <code>kubectl logs</code> for <code>Pod</code> which consists of more then one containers you must specify a name of the container to view its logs. Command template:</p>

<pre><code>kubectl -n &lt;namespace&gt; logs &lt;pod_name&gt; &lt;container_name&gt;
</code></pre>

<p>For example, if you want to view logs of the container <code>prometheus-alertmanager</code> which is a part of <code>Pod</code> <code>alertmanager-6bd9584b85-j4h5m</code> in the namespace <code>kube-system</code> you should use this command:</p>

<pre><code>kubectl -n kube-system logs alertmanager-6bd9584b85-j4h5m prometheus-alertmanager
</code></pre>

<p><code>Pending</code> status of the PVCs could mean you have no corresponding PVs</p>
