pega-helm-charts icon indicating copy to clipboard operation
pega-helm-charts copied to clipboard

Make tiers "mergeable" when providing multiple value.yaml at helm install

Open micgoe opened this issue 1 year ago • 2 comments

Problems / Request

My client runs multiple pega plattform installations in multiple environments. In order to maintain a clean deployment configuration for each plattform installation and environments we install the pega-helm-chart/pega by providing the helm install with multiple values.yaml. At least one dev-common.yaml and an pega-plattform specific yaml dev-pega-1.yaml. The one provided latest overwrites properties of the previous. The frustration lies in the nature on how lists are overwritten/merged. In this specific matter it applies to the tier list. When providing a common configuration for the web tier (common.yaml) which is refined by additional pega-plattform specific web tier configuration (dev-pega-1.yaml) the entire web node tier item is overwritten and not merged.

Example:

Input:

dev-common.yaml

...
tier:
- name: "web"
  nodeType: "WebUser"
  service:
    annotation:
      something: "some-common-annotation-for-all-web-nodes-in-dev"
    httpEnabled: false
    port: 80
    targetPort: 8080
...

dev-pega-1.yaml

...
tier:
- name: "web"
    ingress:
      domain: "dev-pega-1.example.com" # specific for each plattform
...

Output:

tier:
  name: "web"
    nodeType: "WebUser"
  
    requestor:
      passivationTimeSec: 900
  
    service:
      # annotation is missing
      httpEnabled: true
      port: 80
      targetPort: 8080
      ... # other defaults defined in charts values.yaml
    ingress:
      domain: "dev-pega-1.example.com" # specific for each plattform

Example for configuration which might be the same across pega-plattforms in the same environment:

  • custom proxy configuration (tier[web].custom.env)
  • custom logging configuration (tier[web].custom.XY.xml)
  • web nodes port (tier[web].service.port, tier[web].service.targetPort)

Solution:

Switch from using a list for tier to using key-value. This would allow helm to clearly identify objects and would result in merging them together.

Ex:

tier:
  web:
    nodeType: "WebUser"
  
    requestor:
      passivationTimeSec: 900
  
    service:
      annotation:
        something: "some-common-annotation-for-all-web-nodes-in-dev"
      httpEnabled: true
      port: 80
      targetPort: 8080
      ... # other defaults defined in charts values.yaml
    ingress:
      domain: "dev-pega-1.example.com" # specific for each plattform

Alternatives Not following a clean common/specific value file separation model. Right now we define all the tiers in the pega plattform specific yaml (dev-pega-1.yaml) which is not a clean and error prone solution

Additional context Add any other context or screenshots about the feature request here.

Debugging of the resulting values applied can be done by

micgoe avatar Aug 08 '23 10:08 micgoe