Coder Social home page Coder Social logo

Comments (6)

tsigle avatar tsigle commented on July 27, 2024 1

@ilhaan, Thank you for the excellent posting of the issue.

Indeed, I've confirmed that this is a bug. I'll get a fix and new release out in the next few hours.

Thanks!

tls

from helm-charts.

tsigle avatar tsigle commented on July 27, 2024 1

The issue will be resolved by having the workload only issue one volumes: in the yaml, as volumes contains an array, rather than a map. This caused only the last volumes: to be used which caused the issue observed.

Fix is being tested now, and a release should show up shortly.

from helm-charts.

tsigle avatar tsigle commented on July 27, 2024 1

@ilhaan , Thanks for the comment back.

Yes, I did miss the volumeMounts fix. Will get that fixed and push out a new release in next couple of hours.

Thanks again,

tls

from helm-charts.

tsigle avatar tsigle commented on July 27, 2024 1

Fix for both volumes: and volumeMounts: have been released in version 0.5.5

from helm-charts.

ilhaan avatar ilhaan commented on July 27, 2024

Adding helm template outputs to show the above described behavior. I used the ping-devops-0.5.3 tagged release of the repo for these.

  • Custom values.yaml with both secretVolumes and configMapVolumes defined for pingfederate-admin:
➜  ping-devops git:(29821d0) ✗ cat values-both.yaml                                                                                              
pingfederate-admin:
  enabled: true

  secretVolumes:
    pingfederate-license:
      items:
        license: /opt/in/instance/server/default/conf/pingfederate.lic

  configMapVolumes:
    pingfederate-props:
      items:
        pf-props: /opt/in/etc/pingfederate.properties 

➜  ping-devops git:(29821d0) ✗ helm template -s templates/pingfederate-admin/workload.yaml . -f values-both.yaml | yq '.spec.template.spec.volumes'
[
  {
    "configMap": {
      "items": [
        {
          "key": "pf-props",
          "path": "pingfederate.properties"
        }
      ],
      "name": "pingfederate-props"
    },
    "name": "pingfederate-props"
  }
]
  • Similar values file with only configMapVolumes defined:
➜  ping-devops git:(29821d0) ✗ cat values-cm.yaml                                                                                                  
pingfederate-admin:
  enabled: true

  configMapVolumes:
    pingfederate-props:
      items:
        pf-props: /opt/in/etc/pingfederate.properties 

➜  ping-devops git:(29821d0) ✗ helm template -s templates/pingfederate-admin/workload.yaml . -f values-cm.yaml | yq '.spec.template.spec.volumes'
[
  {
    "configMap": {
      "items": [
        {
          "key": "pf-props",
          "path": "pingfederate.properties"
        }
      ],
      "name": "pingfederate-props"
    },
    "name": "pingfederate-props"
  }
]
  • Values file with only secretVolumes defined:
➜  ping-devops git:(29821d0) ✗ cat values-sec.yaml                                                                                               
pingfederate-admin:
  enabled: true

  secretVolumes:
    pingfederate-license:
      items:
        license: /opt/in/instance/server/default/conf/pingfederate.lic

➜  ping-devops git:(29821d0) ✗ helm template -s templates/pingfederate-admin/workload.yaml . -f values-sec.yaml | yq '.spec.template.spec.volumes'
[
  {
    "name": "pingfederate-license",
    "secret": {
      "items": [
        {
          "key": "license",
          "path": "pingfederate.lic"
        }
      ],
      "secretName": "pingfederate-license"
    }
  }
]
  • As mentioned in my previous post, I tested the same reversing the order of configMapVolumes and secretVolumes in values.yaml. Output shown below:
➜  ping-devops git:(29821d0) ✗ cat values-reverse.yaml 
pingfederate-admin:
  enabled: true

  configMapVolumes:
    pingfederate-props:
      items:
        pf-props: /opt/in/etc/pingfederate.properties 

  secretVolumes:
    pingfederate-license:
      items:
        license: /opt/in/instance/server/default/conf/pingfederate.lic

➜  ping-devops git:(29821d0) ✗ helm template -s templates/pingfederate-admin/workload.yaml . -f values-reverse.yaml | yq '.spec.template.spec.volumes' 
[
  {
    "configMap": {
      "items": [
        {
          "key": "pf-props",
          "path": "pingfederate.properties"
        }
      ],
      "name": "pingfederate-props"
    },
    "name": "pingfederate-props"
  }
]

Seems to me that there is an issue here:

{{- define "pinglib.workload.volumes" -}}
{{ $v := . }}
{{ range tuple "secretVolumes" "configMapVolumes" }}
{{ $volType := . }}
{{- range $volName, $volVal := (index $v .) }}
volumes:
- name: {{ $volName }}
{{- if eq $volType "secretVolumes" }}
secret:
secretName: {{ $volName }}
{{- else if eq $volType "configMapVolumes" }}
configMap:
name: {{ $volName }}
{{- end }}
items:
{{- range $keyName, $keyVal := $volVal.items }}
- key: {{ $keyName }}
path: {{ base $keyVal }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}

from helm-charts.

ilhaan avatar ilhaan commented on July 27, 2024

@tsigle Thanks for the quick update! Your fix seems to have fixed volumes, but I'm seeing the same issue with volumeMount:

  • volumes:
➜  ping-devops git:(3cfbc7d) ✗ cat values-both.yaml 
pingfederate-admin:
  enabled: true

  secretVolumes:
    pingfederate-license:
      items:
        license: /opt/in/instance/server/default/conf/pingfederate.lic

  configMapVolumes:
    pingfederate-props:
      items:
        pf-props: /opt/in/etc/pingfederate.properties 

➜  ping-devops git:(3cfbc7d) ✗ helm template -s templates/pingfederate-admin/workload.yaml . -f values-both.yaml | yq '.spec.template.spec.volumes'             
[
  {
    "name": "pingfederate-license",
    "secret": {
      "items": [
        {
          "key": "license",
          "path": "pingfederate.lic"
        }
      ],
      "secretName": "pingfederate-license"
    }
  },
  {
    "configMap": {
      "items": [
        {
          "key": "pf-props",
          "path": "pingfederate.properties"
        }
      ],
      "name": "pingfederate-props"
    },
    "name": "pingfederate-props"
  }
]
  • But only one volumeMount:
➜  ping-devops git:(3cfbc7d) ✗ helm template -s templates/pingfederate-admin/workload.yaml . -f values-both.yaml | yq '.spec.template.spec.containers[].volumeMounts'
[
  {
    "mountPath": "/opt/in/etc/pingfederate.properties",
    "name": "pingfederate-props",
    "readOnly": true,
    "subPath": "pingfederate.properties"
  }
]

from helm-charts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.