From 02f400e442ee8ef6813565f6e0ce18b09f4986cd Mon Sep 17 00:00:00 2001 From: Chris Wedgwood Date: Wed, 17 Oct 2018 00:56:53 +0000 Subject: [PATCH] [Calico] Allow resource configuration using chart (overrides) Allow Calico resources such as NetworkPolicy, GlobalNetworkPolicy, WorkloadEndpoint, etc to be specified using values. To avoid the complexities of list management with helm we use a dictionary that contains a relative priority and set of objects (called rules). For example: network: policy: someName: priority: 0 rules: - apiVersion: projectcalico.org/v3 ... some useful resource object ... - apiVersion: projectcalico.org/v3 ... some other useful resource object ... someOtherName: priority: 1 rules: - apiVersion: projectcalico.org/v3 ... rules that come later ... lastSetOfRules: priority: 9 rules: - apiVersion: projectcalico.org/v3 ... rules that come last ... maybe hostendpoints ... By having named groups of rules each with it's own priority you can update, delete and amend individual sets of rules without provided you set the appropriate "priority" value. Change-Id: Id441350bcc8b95a91ef4d1b89d1bc3c417f50b13 --- calico/templates/bin/_calico-settings.sh.tpl | 19 ++- calico/values.yaml | 154 ++++++++++++++++++- 2 files changed, 169 insertions(+), 4 deletions(-) diff --git a/calico/templates/bin/_calico-settings.sh.tpl b/calico/templates/bin/_calico-settings.sh.tpl index 041036f49..f2c0f9221 100644 --- a/calico/templates/bin/_calico-settings.sh.tpl +++ b/calico/templates/bin/_calico-settings.sh.tpl @@ -2,6 +2,8 @@ set -eux +{{- $envAll := . }} + {{ if empty .Values.conf.node.CALICO_IPV4POOL_CIDR }} {{ $_ := set .Values.conf.node "CALICO_IPV4POOL_CIDR" .Values.networking.podSubnet }} {{ end }} @@ -66,5 +68,20 @@ $CTL apply -f - <