UNCLASSIFIED - NO CUI

Skip to content

Draft: #1993 : Pass big bang values through to package charts

Andrew Kesterson requested to merge 1993_package_bbvars_passthrough into master

General MR

Summary

This MR presents one option for solving the issue described in #1993 (closed) , but this is not the only possible option. It is just the simplest to get the test cases there to pass.

Relevant logs/screenshots

Before this patch, this (intentionally simple and contrived) test case would technically succeed:

networkPolicies:
  enabled: true
  controlPlaneCidr: 192.168.254.0/24
packages:
  jira:
    enabled: true
    values:
      networkPolicies:
        controlPlaneCidr: "{{ .Values.networkPolicies.controlPlaneCidr }}"      

... The chart will successfully render, but anything trying to use that value will be surprised to find it empty. But by updating the package {{ $pkg }}-values secret generator, we can add select items from the root value space. In this MR I am only pulling two specific items, domain and networkPolicies to resolve the specific pain point in the test case on #1993 (closed). But it does work:

$ bbctl deploy bigbang --k3d -- -f ~/source/repo1.dso.mil/big-bang/overrides/team-storagecollab.yaml -f ~/source/repo1.dso.mil/big-bang/overrides/jira.yaml --debug --dry-run

# ... snip ...

# Source: bigbang/templates/package/values.yaml
apiVersion: v1
kind: Secret
metadata:
  name: jira-values
  namespace: jira
  labels:
    app.kubernetes.io/instance: bigbang
    app.kubernetes.io/version: 2.25.1
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/part-of: "bigbang"
    helm.sh/chart: bigbang-2.25.1
type: Opaque
stringData:
  values.yaml: |
    domain: dev.bigbang.mil
    jira:
      service:
        port: 8080
    networkPolicies:
      controlPlaneCidr: 192.168.254.0/24
      enabled: true
      nodeCidr: ""
      vpcCidr: 0.0.0.0/0

... and now the networkpolicies that rely upon the .Values.networkPolicies.controlPlaneCidr in the jira package space will succeed.

Linked Issue

Closes #1993 (closed)

Upgrade Notices

N/A

Merge request reports