How to target specific value inside of the deployment.yaml file?

Viewed 200

I have my values.yaml as below


account:
  - name: firstName
    value: roberto
  - name: lastName
    value: fabric
  - name: PORT
    value: 5000

It seems that by doing this, I'm not able to pull the information that I need. Example:

accounts:
  - name: acountTest01
    value: "{{ .Values.account.firstName}}"
  - name: account2
    value: "{{ .Values.account.lastName }}"

accounts:
      {{ .Values.account }}

The main problem in here is that I would like to refer to the 'PORT' only instead of getting all the values. Does anyone knows what can be done from my side to correct this situation?

1 Answers

Change your values.yaml to

account:
  firstName: roberto
  lastName: fabric
  port: 5000

There is no point in using lists for this type of data.

Then you can get port value with {{ .Values.account.port }}

Related