<p>I'm trying to update a kubernetes template that we have so that I can pass in arguments such as <code>--db-config &lt;value&gt;</code> when my container starts up.</p>

<p>This is obviously not right b/c there's not getting picked up</p>

<pre><code>...
containers:
  - name: {{ .Chart.Name }}
  ...   
    args: ["--db-config", "/etc/app/cfg/db.yaml", "--tkn-config", "/etc/app/cfg/tkn.yaml"] &lt;-- WHY IS THIS NOT WORKING
</code></pre>

Catfish
<p>Here's an example showing your approach working:</p>

<p>main.go:</p>

<pre><code>package main

import "flag"
import "fmt"

func main() {

    db := flag.String("db-config", "default", "some flag")
    tk := flag.String("tk-config", "default", "some flag")


    flag.Parse()

    fmt.Println("db-config:", *db)
    fmt.Println("tk-config:", *tk)
}
</code></pre>

<p>Dockerfile [simplified]:</p>

<pre><code>FROM scratch
ADD kube-flags /
ENTRYPOINT ["/kube-flags"]
</code></pre>

<p>Test:</p>

<pre><code>docker run kube-flags:180906
db-config: default
tk-config: default

docker run kube-flags:180906 --db-config=henry
db-config: henry
tk-config: default
</code></pre>

<p>pod.yaml:</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: test
spec:
  containers:
  - image: gcr.io/.../kube-flags:180906
    imagePullPolicy: Always
    name: test
    args:
    - --db-config
    - henry
    - --tk-config
    - turnip
</code></pre>

<p>test:</p>

<pre><code>kubectl logs test
db-config: henry
tk-config: turnip
</code></pre>
