流畅的容器没有通过yaml(1.2)安装k8工作目录

时间:2016-03-22 19:45:32

标签: kubernetes fluentd

当我手动运行容器时,我看到坐骑但是通过yaml,坐骑是空的。

apiVersion: v1
kind: Pod
metadata:
  name: fluentd2elasticsearch
  namespace: kube-system
spec:
  containers:
  - name: fluentd-es
    image: gcr.io/google_containers/fluentd-elasticsearch:1.15
    env:
      - name: FLUENTD_ARGS
        value: "-qq"
    volumeMounts:
      - name: containers
        mountPath: /var/lib/docker/containers
      - name: varlog
        mountPath: /var/log
  volumes:
  - name: containers
    source:
      hostDir:
        path: /var/lib/docker/containers
  - name: varlog
    source:
      hostDir:
        path: /var/log

当我连接到容器时,目录为空或仅包含流畅的pod文件。 手动运行:

docker run -d -v /var/lib/docker/containers:/var/lib/docker/containers -v /var/log:/var/log gcr.io/google_containers/fluentd-elasticsearch:1.15

一切看起来都不错但是我需要kuber来启动容器以使它与elasticsearch交谈(在kubernetes或k8里面,我看到有时会写)。

docker inspect显示:

"Mounts": [
    {
        "Source": "/var/lib/kubelet/pods/1c11495ddc980659911fd7a596a346f8/volumes/kubernetes.io~empty-dir/containers",
        "Destination": "/var/lib/docker/containers",
        "Mode": "",
        "RW": true
    },
    {
        "Source": "/var/lib/kubelet/pods/1c11495ddc980659911fd7a596a346f8/volumes/kubernetes.io~empty-dir/varlog",
        "Destination": "/var/log",
        "Mode": "",
        "RW": true
    },

我猜kubernetes.io~bled-dir不是我想要的。

1 个答案:

答案 0 :(得分:2)

看起来卷部分存在一些结构性问题。尝试:

UPDATE _adagio_items SET _new_record = 1 
            WHERE ItemId IN (
                SELECT ItemId
                FROM _adagio_items , catlg_products
                WHERE catlg_products.name <> _adagio_items.ItemId
            )