Skip to content

Args are passing into container, but are duplicate #5746

@bstolz

Description

@bstolz

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

  1. I have installed the Dragonfly operator in my cluster (via Helm) chart v1.33.1.
replicaCount: 3

# Override the fullname to avoid 63-character service name limit
fullnameOverride: "dragonfly-operator"

# Override the name to make it even shorter
nameOverride: "dragonfly-operator"

# -- Additional labels to add to all resources
additionalLabels: 
  app.kubernetes.io/name: "dragonfly-operator"

podAnnotations:
  prometheus.io/scrape: "true"
  prometheus.io/path: /metrics
  prometheus.io/port: "8080"

rbacProxy:
  image:
    # This updates the rbac-proxy image to the latest version
    tag: v0.19.1

  resources:
    limits:
      cpu: 500m
      memory: 128Mi
    requests:
      cpu: 50m
      memory: 64Mi
manager:
  resources:
    limits:
      cpu: 500m
      memory: 128Mi
    requests:
      cpu: 50m
      memory: 64Mi

  topologySpreadConstraints: 
    - maxSkew: 1
      topologyKey: topology.kubernetes.io/zone
      whenUnsatisfiable: ScheduleAnyway
      labelSelector:
        matchLabels:
          app.kubernetes.io/name: "dragonfly-operator"
  affinity:
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
        - weight: 100
          podAffinityTerm:
            labelSelector:
              matchExpressions:
                - key: app.kubernetes.io/name
                  operator: In
                  values:
                    - "dragonfly-operator"
            topologyKey: kubernetes.io/hostname
  1. I am manually applying a manifest (via kubectl -f manifest.yaml) with arguments. For example:
apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
  labels:
    app.kubernetes.io/name: dragonfly
    app.kubernetes.io/instance: dragonfly-sample
    app.kubernetes.io/part-of: dragonfly-operator
    app.kubernetes.io/managed-by: kustomize
    app.kubernetes.io/created-by: dragonfly-operator
  name: dragonfly-sample
spec:
  replicas: 3
  resources:
    requests:
      cpu: 550m
      memory: 550Mi
    limits:
      cpu: 600m
      memory: 750Mi

  labels:
    app.kubernetes.io/name: dragonfly
  annotations:
    prometheus.io/scrape: "true"
    prometheus.io/path: /metrics
    prometheus.io/port: "9999"
  args:
    - --primary_port_http_enabled=true
    - --requirepass=$(DFLY_requirepass)
    - --admin_port=9999
  env:
    - name: DFLY_requirepass
      valueFrom:
        secretKeyRef:
          name: dragonfly-auth # The name of your secret
          key: password       # The key within the secret 
  snapshot:
    cron: "*/15 * * * *"
    persistentVolumeClaimSpec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 750Mi

  topologySpreadConstraints: 
    - maxSkew: 1
      topologyKey: topology.kubernetes.io/zone
      whenUnsatisfiable: ScheduleAnyway
      labelSelector:
        matchLabels:
          app.kubernetes.io/name: dragonfly
  affinity:
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
        - weight: 100
          podAffinityTerm:
            labelSelector:
              matchExpressions:
                - key: app.kubernetes.io/name
                  operator: In
                  values:
                    - "dragonfly"
            topologyKey: kubernetes.io/hostname   
  1. Read the pod's yaml:
 ~ kubectl get po dragonfly-sample-0 -oyaml | grep arg -A10                                                                                                                                                                   
  - args:
    - --alsologtostderr
    - --primary_port_http_enabled=false
    - --admin_port=9999
    - --admin_nopass
    - --primary_port_http_enabled=true
    - --requirepass=$(DFLY_requirepass)
    - --admin_port=9999
    - --dir=/dragonfly/snapshots
    - --snapshot_cron=*/15 * * * *

Some of these arguments are present even if I don’t add the spec.args section to my Dragonfly Kind manifest.

Further:

~ kubectl exec -it dragonfly-sample-0 -- /bin/sh

# ps ax
    PID TTY      STAT   TIME COMMAND
      1 ?        Ssl    0:06 dragonfly --logtostderr --alsologtostderr --primary_port_http_enabled=false --admin_port=9999 --admin_nopass --primary_port_http_enabled=true --requirepass=password --admin_port=9999 --dir=/dra
   1608 pts/0    Ss     0:00 /bin/sh
   1631 pts/0    R+     0:00 ps ax

This is all unexpected, especially the primary_port_http_enabled=false AND primary_port_http_enabled=true.

Is there something I am doing wrong? Or is it the "last" arg in the chain that's valid?

Expected behavior
I am expecting the arguments passed to the container not to be duplicative, and I am unsure of the container's behaviour because of this.

Environment (please complete the following information):

  • OS: [ubuntu 20.04]
  • Kernel: # Command: uname -a
  • Containerized?: Kubernetes, EKS 1.33
  • Dragonfly Version: The default version for the 1.33.1 operator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions