<p>I'm trying to deploy a docker container to my Kubernetes cluster, but I'm running into an issue with passing the required command-line arguments to the container. I need to pass two arguments called <code>--provider local</code> and <code>--basedir /tmp</code>. Here is what the docker run command looks like (I can run this without any issues on my docker host):</p>
<pre><code>docker run -d -p 8080:8080 --name transfer-sh -v /tmp:/tmp dutchcoders/transfer.sh:latest --provider local --basedir /tmp
</code></pre>
<p>However, when I apply the deployment YAML to my cluster the container fails with this error (I'm running <code>kubectl apply -f deploy.yaml</code> to apply my changes to the cluster):</p>
<blockquote>
<p>Incorrect Usage. flag provided but not defined: -provider local</p>
</blockquote>
<p>So my YAML specifies that the flag should be <code>--provider</code>, but for some reason I haven't been able to find yet the container only sees <code>-provider</code> which is indeed not a valid option. This is the full help message:</p>
<pre><code>NAME:
transfer.sh - transfer.sh

DESCRIPTION:
Easy file sharing from the command line

USAGE:
transfer.sh [flags] command [arguments...]

COMMANDS:
version
help, h  Shows a list of commands or help for one command

FLAGS:
--listener value                     127.0.0.1:8080 (default: &quot;127.0.0.1:8080&quot;) [$LISTENER]
--profile-listener value             127.0.0.1:6060 [$PROFILE_LISTENER]
--force-https                         [$FORCE_HTTPS]
--tls-listener value                 127.0.0.1:8443 [$TLS_LISTENER]
--tls-listener-only                   [$TLS_LISTENER_ONLY]
--tls-cert-file value                 [$TLS_CERT_FILE]
--tls-private-key value               [$TLS_PRIVATE_KEY]
--temp-path value                    path to temp files (default: &quot;/tmp&quot;) [$TEMP_PATH]
--web-path value                     path to static web files [$WEB_PATH]
--proxy-path value                   path prefix when service is run behind a proxy [$PROXY_PATH]
--proxy-port value                   port of the proxy when the service is run behind a proxy [$PROXY_PORT]
--email-contact value                email address to link in Contact Us (front end) [$EMAIL_CONTACT]
--ga-key value                       key for google analytics (front end) [$GA_KEY]
--uservoice-key value                key for user voice (front end) [$USERVOICE_KEY]
--provider value                     s3|gdrive|local [$PROVIDER]
--s3-endpoint value                   [$S3_ENDPOINT]
--s3-region value                    (default: &quot;eu-west-1&quot;) [$S3_REGION]
--aws-access-key value                [$AWS_ACCESS_KEY]
--aws-secret-key value                [$AWS_SECRET_KEY]
--bucket value                        [$BUCKET]
--s3-no-multipart                    Disables S3 Multipart Puts [$S3_NO_MULTIPART]
--s3-path-style                      Forces path style URLs, required for Minio. [$S3_PATH_STYLE]
--gdrive-client-json-filepath value   [$GDRIVE_CLIENT_JSON_FILEPATH]
--gdrive-local-config-path value      [$GDRIVE_LOCAL_CONFIG_PATH]
--gdrive-chunk-size value            (default: 16) [$GDRIVE_CHUNK_SIZE]
--storj-access value                 Access for the project [$STORJ_ACCESS]
--storj-bucket value                 Bucket to use within the project [$STORJ_BUCKET]
--rate-limit value                   requests per minute (default: 0) [$RATE_LIMIT]
--purge-days value                   number of days after uploads are purged automatically (default: 0) [$PURGE_DAYS]
--purge-interval value               interval in hours to run the automatic purge for (default: 0) [$PURGE_INTERVAL]
--max-upload-size value              max limit for upload, in kilobytes (default: 0) [$MAX_UPLOAD_SIZE]
--lets-encrypt-hosts value           host1, host2 [$HOSTS]
--log value                          /var/log/transfersh.log [$LOG]
--basedir value                      path to storage [$BASEDIR]
--clamav-host value                  clamav-host [$CLAMAV_HOST]
--perform-clamav-prescan             perform-clamav-prescan [$PERFORM_CLAMAV_PRESCAN]
--virustotal-key value               virustotal-key [$VIRUSTOTAL_KEY]
--profiler                           enable profiling [$PROFILER]
--http-auth-user value               user for http basic auth [$HTTP_AUTH_USER]
--http-auth-pass value               pass for http basic auth [$HTTP_AUTH_PASS]
--ip-whitelist value                 comma separated list of ips allowed to connect to the service [$IP_WHITELIST]
--ip-blacklist value                 comma separated list of ips not allowed to connect to the service [$IP_BLACKLIST]
--cors-domains value                 comma separated list of domains allowed for CORS requests [$CORS_DOMAINS]
--random-token-length value          (default: 6) [$RANDOM_TOKEN_LENGTH]
--help, -h                           show help
</code></pre>
<p>Here is the Docker Hub for the image I'm trying to deploy: <a href="https://hub.docker.com/r/dutchcoders/transfer.sh" rel="nofollow noreferrer">dutchcoders/transfer.sh</a></p>
<p>Here is the GitHub: <a href="https://github.com/dutchcoders/transfer.sh" rel="nofollow noreferrer">https://github.com/dutchcoders/transfer.sh</a></p>
<p>My cluster's version is <code>1.23.4</code> and the full deployment YAML is here:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: transfer-sh
  namespace: transfer-sh
  labels:
    app: &quot;transfer-sh&quot;
spec:
  replicas: 1
  selector:
    matchLabels:
      app: transfer-sh
  template:
    metadata:
      labels:
        app: transfer-sh
    spec:
      containers:
      - name: transfer-sh
        image: dutchcoders/transfer.sh:latest
        args:
        - &quot;--provider local&quot;
        - &quot;--basedir /tmp&quot;
        ports:
        - containerPort: 8080
</code></pre>
<p>I intentionally have not included any persistent volume claims yet. At this point I'm just testing to make sure the container will run.</p>
<p>Initially, I though maybe it was some sort of escape sequence issue. After trying all manner of ways to potentially escape the two dashes nothing really changed. I also tried setting environment variables that contained those arguments, but that just resulted in the same behavior where <code>--profile</code> turned into <code>-profile</code>.</p>
<p>If anyone has any thoughts I could use the help. I'm a bit stuck at the moment (although still troubleshooting). I am curious if maybe there is a different way to pass in command flags as opposed to arguments (or maybe there isn't any difference as far as k8s is concerned).</p>

WhirlingDerBing
<p>Try:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: transfer-sh
  namespace: transfer-sh
  labels:
    app: transfer-sh
spec:
  replicas: 1
  selector:
    matchLabels:
      app: transfer-sh
  template:
    metadata:
      labels:
        app: transfer-sh
    spec:
      containers:
      - name: transfer-sh
        image: dutchcoders/transfer.sh:latest
        args:  # &lt;-- in this case each arg is individual
        - --provider
        - local
        - --basedir
        - /tmp
        ports:
        - containerPort: 8080


NAME          READY   UP-TO-DATE   AVAILABLE   AGE
transfer-sh   1/1     1            1           91s
</code></pre>
