Skip to content

Commit d055f06

Browse files
authored
Merge pull request #109 from projectsyn/deps/cilium-1.14
Update Cilium to latest available v1.14 for each install method
2 parents 35e6444 + 4553998 commit d055f06

File tree

30 files changed

+419
-161
lines changed

30 files changed

+419
-161
lines changed

class/defaults.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ parameters:
9191

9292
olm:
9393
source:
94-
opensource: https://github.com/isovalent/olm-for-cilium/archive/master.tar.gz
94+
opensource: https://github.com/isovalent/olm-for-cilium/archive/main.tar.gz
9595
enterprise: <CILIUM-ENTERPRISE-OLM-MANIFESTS-TARGZ-URL> # Configure the URL in your global defaults.
96-
version: "1.13"
97-
patchlevel: "8"
96+
version: "1.14"
97+
patchlevel: "7"
9898
full_version: ${cilium:olm:version}.${cilium:olm:patchlevel}
9999
resources:
100100
requests:
@@ -108,10 +108,10 @@ parameters:
108108
charts:
109109
cilium:
110110
source: https://helm.cilium.io
111-
version: "1.13.8"
111+
version: "1.14.10"
112112
cilium-enterprise:
113113
source: "<CILIUM-ENTERPRISE-CHART-REPO-URL>" # Configure the Chart repository URL in your global defaults
114-
version: "1.13.8"
114+
version: "1.14.9"
115115

116116
images:
117117
kubectl:

component/cleanup.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ local job = kube.Job(name) {
3131
metadata+: {
3232
namespace: namespace,
3333
annotations+: {
34-
'argocd.argoproj.io/hook': 'Sync',
34+
'argocd.argoproj.io/hook': 'PreSync',
3535
'argocd.argoproj.io/hook-delete-policy': 'HookSucceeded',
3636
},
3737
},

component/olm.jsonnet

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,42 @@ local olmDir =
4040
else
4141
error "Unknown release '%s'" % [ params.release ];
4242

43-
local olmFiles = std.filterMap(
44-
function(name)
45-
// drop hidden files
46-
!std.startsWith(name, '.'),
47-
function(name) {
48-
filename: name,
49-
contents: std.parseJson(kap.yaml_load(olmDir + name)),
50-
},
51-
kap.dir_files_list(olmDir)
43+
local olmFiles = std.foldl(
44+
function(status, file)
45+
status {
46+
files+: [ file ],
47+
has_csv: status.has_csv || (file.contents.kind == 'ClusterServiceVersion'),
48+
},
49+
50+
std.filterMap(
51+
function(name)
52+
// drop hidden files
53+
!std.startsWith(name, '.'),
54+
function(name) {
55+
filename: name,
56+
contents: std.parseJson(kap.yaml_load(olmDir + name)),
57+
},
58+
kap.dir_files_list(olmDir)
59+
),
60+
{
61+
files: [],
62+
has_csv: false,
63+
}
5264
);
5365

54-
local patchManifests = function(file)
66+
local patchManifests = function(file, has_csv)
5567
local hasK8sHost = std.objectHas(helm.cilium_values, 'k8sServiceHost');
5668
local hasK8sPort = std.objectHas(helm.cilium_values, 'k8sServicePort');
5769
local metadata_name_map = {
5870
opensource: {
5971
CiliumConfig: 'cilium',
6072
Deployment: 'cilium-olm',
73+
OlmRole: 'cilium-olm',
6174
},
6275
enterprise: {
6376
CiliumConfig: 'cilium-enterprise',
6477
Deployment: 'cilium-ee-olm',
78+
OlmRole: 'cilium-ee-olm',
6579
},
6680
};
6781
local deploymentPatch = {
@@ -170,14 +184,38 @@ local patchManifests = function(file)
170184
file.contents.metadata.namespace == 'cilium'
171185
) then
172186
null
187+
else if (
188+
!has_csv &&
189+
file.contents.kind == 'OperatorGroup' &&
190+
file.contents.metadata.namespace == 'cilium'
191+
) then
192+
null
193+
else if (
194+
file.contents.kind == 'Role' &&
195+
file.contents.metadata.namespace == 'cilium' &&
196+
file.contents.metadata.name == metadata_name_map[params.release].OlmRole
197+
) then
198+
file {
199+
contents+: {
200+
rules: [
201+
if r.apiGroups == [ '' ] && r.resources == [ 'events' ] then
202+
r {
203+
verbs+: [ 'patch' ],
204+
}
205+
else
206+
r
207+
for r in super.rules
208+
],
209+
},
210+
}
173211
else
174212
file;
175213

176214
std.foldl(
177215
function(files, file) files { [std.strReplace(file.filename, '.yaml', '')]: file.contents },
178216
std.filter(
179217
function(obj) obj != null,
180-
std.map(patchManifests, olmFiles),
218+
std.map(function(obj) patchManifests(obj, olmFiles.has_csv), olmFiles.files),
181219
),
182220
{
183221
'99_cleanup': (import 'cleanup.libsonnet'),

component/render-helm-values.jsonnet

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,18 @@ local cilium_values = std.prune(
4747
local helm_values = {
4848
opensource: cilium_values,
4949
enterprise: {
50-
cilium: cilium_values,
50+
cilium: {
51+
enterprise: {
52+
egressGatewayHA: {
53+
// Enable HA egress gateway on Cilium EE by default when the regular
54+
// egress gateway is enabled.
55+
// we do this before the user-provided values, so users can still
56+
// enable the HA egress gateway without enabling the regular egress
57+
// gateway.
58+
enabled: cilium_values.egressGateway.enabled,
59+
},
60+
},
61+
} + com.makeMergeable(cilium_values),
5162
'hubble-enterprise': std.prune(params.hubble_enterprise_helm_values),
5263
'hubble-ui': std.prune(params.hubble_ui_helm_values),
5364
},
@@ -58,7 +69,7 @@ local legacy_values =
5869
std.trace(
5970
'Parameter `helm_values` is deprecated. ' +
6071
'Please move your configs to `cilium_helm_values`, ' +
61-
'`hubble_enterprise_helm_values` or\n `hubble_ui_helm_values`.',
72+
'`hubble_enterprise_helm_values` or `hubble_ui_helm_values`.',
6273
com.makeMergeable(params.helm_values)
6374
)
6475
else

docs/modules/ROOT/pages/references/parameters.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ type:: boolean
218218
default:: `false`
219219

220220
This parameter allows users to set all the configurations necessary to enable the egress gateway policy feature through a single parameter.
221+
221222
The parameter sets the following Helm values:
222223

223224
[source,yaml]
@@ -232,6 +233,9 @@ l7Proxy: false
232233
Notably, the L7 proxy feature is disabled by default when egress gateway policies are enabled.
233234
This is recommended by the Cilium documentation, see also https://docs.cilium.io/en/v1.13/network/egress-gateway/#incompatibility-with-other-features[the upstream documentation].
234235

236+
For Cilium EE, the component uses Helm value `egressGateway.enabled` for Helm value `enterprise.egressGatewayHA.enabled` by default.
237+
It's possible to override this by explicitly setting `egressGateway.enabled=false` and `enterprise.egressGatewayHA.enabled=true` in the component's `cilium_helm_values`.
238+
235239
=== `egress_gateway.policies`
236240

237241
[horizontal]

tests/golden/defaults/cilium/cilium/01_cilium_helmchart/cilium/templates/cilium-agent/clusterrole.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ rules:
5757
- ciliumnetworkpolicies
5858
- ciliumnodes
5959
- ciliumnodeconfigs
60+
- ciliumcidrgroups
61+
- ciliuml2announcementpolicies
62+
- ciliumpodippools
6063
verbs:
6164
- list
6265
- watch
@@ -96,5 +99,6 @@ rules:
9699
- ciliumclusterwidenetworkpolicies/status
97100
- ciliumendpoints/status
98101
- ciliumendpoints
102+
- ciliuml2announcementpolicies/status
99103
verbs:
100104
- patch

tests/golden/defaults/cilium/cilium/01_cilium_helmchart/cilium/templates/cilium-agent/daemonset.yaml

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,7 @@ spec:
4949
fieldPath: metadata.namespace
5050
- name: CILIUM_CLUSTERMESH_CONFIG
5151
value: /var/lib/cilium/clustermesh/
52-
- name: CILIUM_CNI_CHAINING_MODE
53-
valueFrom:
54-
configMapKeyRef:
55-
key: cni-chaining-mode
56-
name: cilium-config
57-
optional: true
58-
- name: CILIUM_CUSTOM_CNI_CONF
59-
valueFrom:
60-
configMapKeyRef:
61-
key: custom-cni-conf
62-
name: cilium-config
63-
optional: true
64-
image: quay.io/cilium/cilium:v1.13.8@sha256:774f0f11e171a96b59158884e0151eb522a2cf3fe23a7af7a140ae31ac30271b
52+
image: quay.io/cilium/cilium:v1.14.10@sha256:0a1bcd2859c6d18d60dba6650cca8c707101716a3e47b126679040cbd621c031
6553
imagePullPolicy: IfNotPresent
6654
lifecycle:
6755
postStart:
@@ -70,7 +58,25 @@ spec:
7058
- bash
7159
- -c
7260
- |
73-
/cni-install.sh --enable-debug=false --cni-exclusive=true --log-file=/var/run/cilium/cilium-cni.log
61+
set -o errexit
62+
set -o pipefail
63+
set -o nounset
64+
65+
# When running in AWS ENI mode, it's likely that 'aws-node' has
66+
# had a chance to install SNAT iptables rules. These can result
67+
# in dropped traffic, so we should attempt to remove them.
68+
# We do it using a 'postStart' hook since this may need to run
69+
# for nodes which might have already been init'ed but may still
70+
# have dangling rules. This is safe because there are no
71+
# dependencies on anything that is part of the startup script
72+
# itself, and can be safely run multiple times per node (e.g. in
73+
# case of a restart).
74+
if [[ "$(iptables-save | grep -E -c 'AWS-SNAT-CHAIN|AWS-CONNMARK-CHAIN')" != "0" ]];
75+
then
76+
echo 'Deleting iptables rules created by the AWS CNI VPC plugin'
77+
iptables-save | grep -E -v 'AWS-SNAT-CHAIN|AWS-CONNMARK-CHAIN' | iptables-restore
78+
fi
79+
echo 'Done!'
7480
preStop:
7581
exec:
7682
command:
@@ -186,7 +192,7 @@ spec:
186192
fieldRef:
187193
apiVersion: v1
188194
fieldPath: metadata.namespace
189-
image: quay.io/cilium/cilium:v1.13.8@sha256:774f0f11e171a96b59158884e0151eb522a2cf3fe23a7af7a140ae31ac30271b
195+
image: quay.io/cilium/cilium:v1.14.10@sha256:0a1bcd2859c6d18d60dba6650cca8c707101716a3e47b126679040cbd621c031
190196
imagePullPolicy: IfNotPresent
191197
name: config
192198
terminationMessagePolicy: FallbackToLogsOnError
@@ -205,7 +211,7 @@ spec:
205211
value: /run/cilium/cgroupv2
206212
- name: BIN_PATH
207213
value: /var/lib/cni/bin
208-
image: quay.io/cilium/cilium:v1.13.8@sha256:774f0f11e171a96b59158884e0151eb522a2cf3fe23a7af7a140ae31ac30271b
214+
image: quay.io/cilium/cilium:v1.14.10@sha256:0a1bcd2859c6d18d60dba6650cca8c707101716a3e47b126679040cbd621c031
209215
imagePullPolicy: IfNotPresent
210216
name: mount-cgroup
211217
securityContext:
@@ -235,7 +241,7 @@ spec:
235241
env:
236242
- name: BIN_PATH
237243
value: /var/lib/cni/bin
238-
image: quay.io/cilium/cilium:v1.13.8@sha256:774f0f11e171a96b59158884e0151eb522a2cf3fe23a7af7a140ae31ac30271b
244+
image: quay.io/cilium/cilium:v1.14.10@sha256:0a1bcd2859c6d18d60dba6650cca8c707101716a3e47b126679040cbd621c031
239245
imagePullPolicy: IfNotPresent
240246
name: apply-sysctl-overwrites
241247
securityContext:
@@ -261,7 +267,7 @@ spec:
261267
- /bin/bash
262268
- -c
263269
- --
264-
image: quay.io/cilium/cilium:v1.13.8@sha256:774f0f11e171a96b59158884e0151eb522a2cf3fe23a7af7a140ae31ac30271b
270+
image: quay.io/cilium/cilium:v1.14.10@sha256:0a1bcd2859c6d18d60dba6650cca8c707101716a3e47b126679040cbd621c031
265271
imagePullPolicy: IfNotPresent
266272
name: mount-bpf-fs
267273
securityContext:
@@ -286,13 +292,9 @@ spec:
286292
key: clean-cilium-bpf-state
287293
name: cilium-config
288294
optional: true
289-
image: quay.io/cilium/cilium:v1.13.8@sha256:774f0f11e171a96b59158884e0151eb522a2cf3fe23a7af7a140ae31ac30271b
295+
image: quay.io/cilium/cilium:v1.14.10@sha256:0a1bcd2859c6d18d60dba6650cca8c707101716a3e47b126679040cbd621c031
290296
imagePullPolicy: IfNotPresent
291297
name: clean-cilium-state
292-
resources:
293-
requests:
294-
cpu: 100m
295-
memory: 100Mi
296298
securityContext:
297299
capabilities:
298300
add:
@@ -316,7 +318,7 @@ spec:
316318
name: cilium-run
317319
- command:
318320
- /install-plugin.sh
319-
image: quay.io/cilium/cilium:v1.13.8@sha256:774f0f11e171a96b59158884e0151eb522a2cf3fe23a7af7a140ae31ac30271b
321+
image: quay.io/cilium/cilium:v1.14.10@sha256:0a1bcd2859c6d18d60dba6650cca8c707101716a3e47b126679040cbd621c031
320322
imagePullPolicy: IfNotPresent
321323
name: install-cni-binaries
322324
resources:
@@ -378,10 +380,22 @@ spec:
378380
type: FileOrCreate
379381
name: xtables-lock
380382
- name: clustermesh-secrets
381-
secret:
383+
projected:
382384
defaultMode: 256
383-
optional: true
384-
secretName: cilium-clustermesh
385+
sources:
386+
- secret:
387+
name: cilium-clustermesh
388+
optional: true
389+
- secret:
390+
items:
391+
- key: tls.key
392+
path: common-etcd-client.key
393+
- key: tls.crt
394+
path: common-etcd-client.crt
395+
- key: ca.crt
396+
path: common-etcd-client-ca.crt
397+
name: clustermesh-apiserver-remote-cert
398+
optional: true
385399
- hostPath:
386400
path: /proc/sys/net
387401
type: Directory

0 commit comments

Comments
 (0)