How to pass docker run parameter via kubernetes pod

1/5/2016

Hi I am running kubernetes cluster where I run Logstash container.

But I need to run it with own docker run parameter. If I would run it in docker directly. I would use command:

docker run --log-driver=gelf logstash -f /config-dir/logstash.conf

But I need to run it via Kubernetes pod. My pod looks like:

spec:
      containers:
      - name: logstash-logging
        image: "logstash:latest"
        command: ["logstash", "-f" , "/config-dir/logstash.conf"]
        volumeMounts:
          - name: configs
            mountPath: /config-dir/logstash.conf

How to achieve to run Docker container with parameter --log-driver=gelf via kubernetes. Thanks.

-- jiri463
docker
kubernetes

1 Answer

1/5/2016

Kubernetes does not expose docker-specific options such as --log-driver. A higher abstraction of logging behavior might be added in the future, but it is not in the current API yet. This issue was discussed in https://github.com/kubernetes/kubernetes/issues/15478, and the suggestion was to change the default logging driver for docker daemon in the per-node configuration/salt template.

-- Yu-Ju Hong
Source: StackOverflow