Skip to content

Commit e15936e

Browse files
authored
Merge pull request #455 from l1b0k/update_12
policy: update cilium to 1.12.4
2 parents 769fb07 + 7a1e1cc commit e15936e

11 files changed

+80
-45
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG TERWAY_POLICY_IMAGE=registry.cn-hongkong.aliyuncs.com/acs/terway:policy-20221118-d172822@sha256:903a69c6cd344017b009b34d59ef4ef7499614298034cbed939a6cf7303dc1f2
1+
ARG TERWAY_POLICY_IMAGE=registry.cn-hongkong.aliyuncs.com/acs/terway:policy-20221222-2ecf844@sha256:271c05807fdfe444eb803f3f82b173aec99ac459fc53aff0de160708e6d8a4a9
22
ARG CILIUM_LLVM_IMAGE=quay.io/cilium/cilium-llvm:547db7ec9a750b8f888a506709adb41f135b952e@sha256:4d6fa0aede3556c5fb5a9c71bc6b9585475ac9b1064f516d4c45c8fb691c9d9e
33
ARG CILIUM_BPFTOOL_IMAGE=quay.io/cilium/cilium-bpftool:78448c1a37ff2b790d5e25c3d8b8ec3e96e6405f@sha256:99a9453a921a8de99899ef82e0822f0c03f65d97005c064e231c06247ad8597d
44
ARG CILIUM_IPROUTE2_IMAGE=quay.io/cilium/cilium-iproute2:3570d58349efb2d6b0342369a836998c93afd291@sha256:1abcd7a5d2117190ab2690a163ee9cd135bc9e4cf8a4df662a8f993044c79342

Dockerfile.policy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ RUN cd /go/src/github.com/projectcalico/felix && \
1818
( ! $(readelf -d bin/calico-felix | grep -q NEEDED) || ( echo "Error: bin/calico-felix was not statically linked"; false )) \
1919
&& chmod +x /go/src/github.com/projectcalico/felix/bin/calico-felix
2020

21-
FROM --platform=$TARGETPLATFORM quay.io/cilium/cilium-builder:203448b6efdbcff0fa9c00a082ae1b802047c6f9@sha256:32dda3d71a1f9259a69f72e46d689eb6b3d27a5cf4858f7a10be632ceb51fbdd as cilium-builder
21+
FROM --platform=$TARGETPLATFORM quay.io/cilium/cilium-builder:f3ff491f1fb923136b8b5276fafd9d2ee460a265@sha256:764cc4a2ee14cdf57be3d4dbce132baa0fd7e62379ef6f6c05f3db4a7ccd64ba as cilium-builder
2222
ARG GOPROXY
2323
ENV GOPROXY $GOPROXY
2424
ARG CILIUM_SHA=""
2525
LABEL cilium-sha=${CILIUM_SHA}
2626
LABEL maintainer="maintainer@cilium.io"
2727
WORKDIR /go/src/github.com/cilium
2828
RUN rm -rf cilium
29-
ENV GIT_TAG=v1.12.1
30-
ENV GIT_COMMIT=4c9a6302c9423e821c00930ca00f8eb6a34e9313
29+
ENV GIT_TAG=v1.12.4
30+
ENV GIT_COMMIT=6eaecaf87e165f7551fcf560f2ff8968e5056fe2
3131
RUN git clone -b $GIT_TAG --depth 1 https://github.com/cilium/cilium.git && \
3232
cd cilium && \
3333
[ "`git rev-parse HEAD`" = "${GIT_COMMIT}" ]

policy/cilium/0001-cilium-terway-datapath.patch

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ Signed-off-by: l1b0k <libokang.dev@gmail.com>
2020
create mode 100644 plugins/cilium-cni/chaining/terway/terway.go
2121

2222
diff --git a/daemon/cmd/endpoint.go b/daemon/cmd/endpoint.go
23-
index af6fb5f52f..7fce43739a 100644
23+
index 9605f8ad3f..02137811e4 100644
2424
--- a/daemon/cmd/endpoint.go
2525
+++ b/daemon/cmd/endpoint.go
26-
@@ -440,6 +440,12 @@ func (d *Daemon) createEndpoint(ctx context.Context, owner regeneration.Owner, e
26+
@@ -442,6 +442,12 @@ func (d *Daemon) createEndpoint(ctx context.Context, owner regeneration.Owner, e
2727
return d.errorDuringCreation(ep, fmt.Errorf("unable to insert endpoint into manager: %s", err))
2828
}
2929

@@ -261,7 +261,7 @@ index f39d064078..0865a8451d 100644
261261
func (ep *epInfoCache) IPv4Address() addressing.CiliumIPv4 {
262262
return ep.ipv4
263263
diff --git a/pkg/endpoint/endpoint.go b/pkg/endpoint/endpoint.go
264-
index f8314e71a5..e878937435 100644
264+
index 605d178beb..916c3f72b7 100644
265265
--- a/pkg/endpoint/endpoint.go
266266
+++ b/pkg/endpoint/endpoint.go
267267
@@ -19,6 +19,7 @@ import (
@@ -325,7 +325,7 @@ index f8314e71a5..e878937435 100644
325325
return e.ifName
326326
}
327327

328-
@@ -2099,6 +2118,32 @@ func (e *Endpoint) IsDisconnecting() bool {
328+
@@ -2100,6 +2119,32 @@ func (e *Endpoint) IsDisconnecting() bool {
329329
return e.state == StateDisconnected || e.state == StateDisconnecting
330330
}
331331

@@ -359,18 +359,18 @@ index f8314e71a5..e878937435 100644
359359
e.buildMutex.Lock()
360360
defer e.buildMutex.Unlock()
361361
diff --git a/pkg/endpoint/restore.go b/pkg/endpoint/restore.go
362-
index d70bf02375..c26f366e9e 100644
362+
index 97f2b1a910..ba905543f0 100644
363363
--- a/pkg/endpoint/restore.go
364364
+++ b/pkg/endpoint/restore.go
365-
@@ -381,6 +381,7 @@ func (e *Endpoint) toSerializedEndpoint() *serializableEndpoint {
365+
@@ -383,6 +383,7 @@ func (e *Endpoint) toSerializedEndpoint() *serializableEndpoint {
366366
ContainerID: e.containerID,
367367
DockerNetworkID: e.dockerNetworkID,
368368
DockerEndpointID: e.dockerEndpointID,
369369
+ DatapathMapID: e.datapathMapID,
370370
IfName: e.ifName,
371371
IfIndex: e.ifIndex,
372372
OpLabels: e.OpLabels,
373-
@@ -429,6 +430,9 @@ type serializableEndpoint struct {
373+
@@ -431,6 +432,9 @@ type serializableEndpoint struct {
374374
// libnetwork
375375
DockerEndpointID string
376376

@@ -380,7 +380,7 @@ index d70bf02375..c26f366e9e 100644
380380
// ifName is the name of the host facing interface (veth pair) which
381381
// connects into the endpoint
382382
IfName string
383-
@@ -516,6 +520,7 @@ func (ep *Endpoint) fromSerializedEndpoint(r *serializableEndpoint) {
383+
@@ -518,6 +522,7 @@ func (ep *Endpoint) fromSerializedEndpoint(r *serializableEndpoint) {
384384
ep.containerID = r.ContainerID
385385
ep.dockerNetworkID = r.DockerNetworkID
386386
ep.dockerEndpointID = r.DockerEndpointID
@@ -730,5 +730,5 @@ index 5eca17daeb..1ee2227373 100644
730730
)
731731

732732
--
733-
2.37.3
733+
2.39.0
734734

policy/cilium/0002-overwrite-endpoint-when-conflicting.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Signed-off-by: l1b0k <libokang.dev@gmail.com>
99
1 file changed, 3 insertions(+), 1 deletion(-)
1010

1111
diff --git a/daemon/cmd/endpoint.go b/daemon/cmd/endpoint.go
12-
index 7fce43739a..57776f0f1d 100644
12+
index 02137811e4..6399bb770f 100644
1313
--- a/daemon/cmd/endpoint.go
1414
+++ b/daemon/cmd/endpoint.go
15-
@@ -355,7 +355,9 @@ func (d *Daemon) createEndpoint(ctx context.Context, owner regeneration.Owner, e
15+
@@ -357,7 +357,9 @@ func (d *Daemon) createEndpoint(ctx context.Context, owner regeneration.Owner, e
1616
if err != nil {
1717
return invalidDataError(ep, err)
1818
} else if oldEp != nil {
@@ -24,5 +24,5 @@ index 7fce43739a..57776f0f1d 100644
2424
}
2525

2626
--
27-
2.37.3
27+
2.39.0
2828

policy/cilium/0003-run-operator.patch

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ Subject: [PATCH] run operator
55

66
Signed-off-by: l1b0k <libokang.dev@gmail.com>
77
---
8-
daemon/cmd/daemon_main.go | 22 ++--
8+
daemon/cmd/daemon_main.go | 25 +++--
99
operator/Makefile | 2 +-
10-
operator/main.go | 218 --------------------------------------
11-
3 files changed, 16 insertions(+), 226 deletions(-)
10+
operator/main.go | 219 --------------------------------------
11+
3 files changed, 19 insertions(+), 227 deletions(-)
1212

1313
diff --git a/daemon/cmd/daemon_main.go b/daemon/cmd/daemon_main.go
14-
index 14daa753ef..3880abdd9c 100644
14+
index 8948ece323..7ca1c4af6e 100644
1515
--- a/daemon/cmd/daemon_main.go
1616
+++ b/daemon/cmd/daemon_main.go
1717
@@ -14,13 +14,6 @@ import (
@@ -49,11 +49,14 @@ index 14daa753ef..3880abdd9c 100644
4949
)
5050

5151
const (
52-
@@ -1613,6 +1613,14 @@ func (d *Daemon) initKVStore() {
52+
@@ -1617,6 +1617,17 @@ func (d *Daemon) initKVStore() {
5353
}
5454

5555
func runDaemon() {
5656
+ go func() {
57+
+ if os.Getenv("DISABLE_CILIUM_OPERATOR") == "true" {
58+
+ return
59+
+ }
5760
+ cmd := exec.CommandContext(server.ServerCtx, "cilium-operator-generic", "--skip-crd-creation", "--k8s-namespace", os.Getenv("CILIUM_K8S_NAMESPACE"), "--identity-gc-interval", "10m", "--identity-heartbeat-timeout", "20m")
5861
+ cmd.Stdout = os.Stdout
5962
+ cmd.Stderr = os.Stderr
@@ -78,7 +81,7 @@ index ebd1285e3d..1710880c84 100644
7881
cilium-operator-aws: GO_TAGS_FLAGS+=ipam_provider_aws
7982
cilium-operator-azure: GO_TAGS_FLAGS+=ipam_provider_azure
8083
diff --git a/operator/main.go b/operator/main.go
81-
index 803a95322a..9d6c2522a2 100644
84+
index ac0ad59924..9d6c2522a2 100644
8285
--- a/operator/main.go
8386
+++ b/operator/main.go
8487
@@ -15,29 +15,22 @@ import (
@@ -311,7 +314,7 @@ index 803a95322a..9d6c2522a2 100644
311314
- // Once the CiliumNodes are synchronized with the operator we will
312315
- // be able to watch for K8s Node events which they will be used
313316
- // to create the remaining CiliumNodes.
314-
- <-k8sCiliumNodesCacheSynced
317+
- <-ciliumNodeManagerQueueSynced
315318
-
316319
- // We don't want CiliumNodes that don't have podCIDRs to be
317320
- // allocated with a podCIDR already being used by another node.
@@ -326,7 +329,7 @@ index 803a95322a..9d6c2522a2 100644
326329
if operatorOption.Config.IdentityGCInterval != 0 {
327330
identityRateLimiter = rate.NewLimiter(
328331
operatorOption.Config.IdentityGCRateInterval,
329-
@@ -566,30 +372,6 @@ func onOperatorStartLeading(ctx context.Context) {
332+
@@ -566,31 +372,6 @@ func onOperatorStartLeading(ctx context.Context) {
330333
enableCiliumEndpointSyncGC(true)
331334
}
332335

@@ -346,7 +349,8 @@ index 803a95322a..9d6c2522a2 100644
346349
- ingressController, err := ingress.NewIngressController(
347350
- ingress.WithHTTPSEnforced(operatorOption.Config.EnforceIngressHTTPS),
348351
- ingress.WithSecretsSyncEnabled(operatorOption.Config.EnableIngressSecretsSync),
349-
- ingress.WithSecretsNamespace(operatorOption.Config.IngressSecretsNamespace))
352+
- ingress.WithSecretsNamespace(operatorOption.Config.IngressSecretsNamespace),
353+
- ingress.WithLBAnnotationPrefixes(operatorOption.Config.IngressLBAnnotationPrefixes))
350354
- if err != nil {
351355
- log.WithError(err).WithField(logfields.LogSubsys, ingress.Subsys).Fatal(
352356
- "Failed to start ingress controller")
@@ -358,5 +362,5 @@ index 803a95322a..9d6c2522a2 100644
358362

359363
<-shutdownSignal
360364
--
361-
2.37.3
365+
2.39.0
362366

policy/cilium/0004-adapt-1.10-for-terway.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Signed-off-by: l1b0k <libokang.dev@gmail.com>
99
1 file changed, 10 insertions(+), 10 deletions(-)
1010

1111
diff --git a/pkg/option/config.go b/pkg/option/config.go
12-
index e18af26c48..ca69edd2a5 100644
12+
index 23c8c8b84c..4fd430f1d1 100644
1313
--- a/pkg/option/config.go
1414
+++ b/pkg/option/config.go
15-
@@ -3155,16 +3155,16 @@ func (c *DaemonConfig) Populate() {
15+
@@ -3170,16 +3170,16 @@ func (c *DaemonConfig) Populate() {
1616
}
1717
}
1818

@@ -40,5 +40,5 @@ index e18af26c48..ca69edd2a5 100644
4040
c.KubeProxyReplacementHealthzBindAddr = viper.GetString(KubeProxyReplacementHealthzBindAddr)
4141

4242
--
43-
2.37.3
43+
2.39.0
4444

policy/cilium/0005-add-flag-to-control-in-cluster-loadBalance.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Signed-off-by: l1b0k <libokang.dev@gmail.com>
1111
3 files changed, 11 insertions(+), 1 deletion(-)
1212

1313
diff --git a/daemon/cmd/daemon_main.go b/daemon/cmd/daemon_main.go
14-
index 3880abdd9c..1c979ecb62 100644
14+
index 7ca1c4af6e..b68980bdae 100644
1515
--- a/daemon/cmd/daemon_main.go
1616
+++ b/daemon/cmd/daemon_main.go
17-
@@ -389,6 +389,9 @@ func initializeFlags() {
17+
@@ -390,6 +390,9 @@ func initializeFlags() {
1818
flags.Bool(option.EnableExternalIPs, defaults.EnableExternalIPs, fmt.Sprintf("Enable k8s service externalIPs feature (requires enabling %s)", option.EnableNodePort))
1919
option.BindEnv(option.EnableExternalIPs)
2020

@@ -38,7 +38,7 @@ index bbd35f3365..a055344850 100644
3838
k8sLoadBalancerIPs = parseIPs(loadBalancerIPs)
3939
} else if option.Config.BGPAnnounceLBIP {
4040
diff --git a/pkg/option/config.go b/pkg/option/config.go
41-
index ca69edd2a5..0df3422dac 100644
41+
index 4fd430f1d1..93340bb1c8 100644
4242
--- a/pkg/option/config.go
4343
+++ b/pkg/option/config.go
4444
@@ -244,6 +244,9 @@ const (
@@ -51,7 +51,7 @@ index ca69edd2a5..0df3422dac 100644
5151
// EnableSVCSourceRangeCheck enables check of service source range checks
5252
EnableSVCSourceRangeCheck = "enable-svc-source-range-check"
5353

54-
@@ -1823,6 +1826,9 @@ type DaemonConfig struct {
54+
@@ -1826,6 +1829,9 @@ type DaemonConfig struct {
5555
// EnableNodePort enables k8s NodePort service implementation in BPF
5656
EnableNodePort bool
5757

@@ -61,7 +61,7 @@ index ca69edd2a5..0df3422dac 100644
6161
// EnableSVCSourceRangeCheck enables check of loadBalancerSourceRanges
6262
EnableSVCSourceRangeCheck bool
6363

64-
@@ -2796,6 +2802,7 @@ func (c *DaemonConfig) Populate() {
64+
@@ -2808,6 +2814,7 @@ func (c *DaemonConfig) Populate() {
6565
c.EnableTracing = viper.GetBool(EnableTracing)
6666
c.EnableUnreachableRoutes = viper.GetBool(EnableUnreachableRoutes)
6767
c.EnableNodePort = viper.GetBool(EnableNodePort)
@@ -70,5 +70,5 @@ index ca69edd2a5..0df3422dac 100644
7070
c.EnableHostPort = viper.GetBool(EnableHostPort)
7171
c.EnableHostLegacyRouting = viper.GetBool(EnableHostLegacyRouting)
7272
--
73-
2.37.3
73+
2.39.0
7474

policy/cilium/0006-terway-support-kubelet-health-check.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Signed-off-by: l1b0k <libokang.dev@gmail.com>
1111
1 file changed, 2 insertions(+), 4 deletions(-)
1212

1313
diff --git a/bpf/bpf_lxc.c b/bpf/bpf_lxc.c
14-
index ce5a9f65f5..1bca01a43f 100644
14+
index 63202a77c3..9a535a4c27 100644
1515
--- a/bpf/bpf_lxc.c
1616
+++ b/bpf/bpf_lxc.c
17-
@@ -1626,8 +1626,7 @@ int tail_ipv6_to_endpoint(struct __ctx_buff *ctx)
17+
@@ -1628,8 +1628,7 @@ int tail_ipv6_to_endpoint(struct __ctx_buff *ctx)
1818
* as the host. So we can ignore the ipcache
1919
* if it reports the source as HOST_ID.
2020
*/
@@ -24,7 +24,7 @@ index ce5a9f65f5..1bca01a43f 100644
2424
}
2525
}
2626
cilium_dbg(ctx, info ? DBG_IP_ID_MAP_SUCCEED6 : DBG_IP_ID_MAP_FAILED6,
27-
@@ -1968,8 +1967,7 @@ int tail_ipv4_to_endpoint(struct __ctx_buff *ctx)
27+
@@ -1970,8 +1969,7 @@ int tail_ipv4_to_endpoint(struct __ctx_buff *ctx)
2828
* as the host. So we can ignore the ipcache
2929
* if it reports the source as HOST_ID.
3030
*/
@@ -35,5 +35,5 @@ index ce5a9f65f5..1bca01a43f 100644
3535
}
3636
cilium_dbg(ctx, info ? DBG_IP_ID_MAP_SUCCEED4 : DBG_IP_ID_MAP_FAILED4,
3737
--
38-
2.37.3
38+
2.39.0
3939

policy/cilium/0007-add-bandwidth-for-terway-ipvlan.patch

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ Subject: [PATCH] add bandwidth for terway ipvlan
66
Signed-off-by: l1b0k <libokang.dev@gmail.com>
77
---
88
bpf/bpf_lxc.c | 15 +++++++++++++--
9+
pkg/bandwidth/bandwidth.go | 12 ++++++------
910
pkg/datapath/linux/config/config.go | 6 ++++++
10-
2 files changed, 19 insertions(+), 2 deletions(-)
11+
3 files changed, 25 insertions(+), 8 deletions(-)
1112

1213
diff --git a/bpf/bpf_lxc.c b/bpf/bpf_lxc.c
13-
index 1bca01a43f..9e554506d6 100644
14+
index 9a535a4c27..b0b2193452 100644
1415
--- a/bpf/bpf_lxc.c
1516
+++ b/bpf/bpf_lxc.c
16-
@@ -1333,17 +1333,28 @@ int handle_xgress(struct __ctx_buff *ctx)
17+
@@ -1335,17 +1335,28 @@ int handle_xgress(struct __ctx_buff *ctx)
1718
goto out;
1819
}
1920

@@ -44,6 +45,36 @@ index 1bca01a43f..9e554506d6 100644
4445
ep_tail_call(ctx, CILIUM_CALL_IPV4_FROM_LXC);
4546
ret = DROP_MISSED_TAIL_CALL;
4647
break;
48+
diff --git a/pkg/bandwidth/bandwidth.go b/pkg/bandwidth/bandwidth.go
49+
index ef652dfce7..b01c94930e 100644
50+
--- a/pkg/bandwidth/bandwidth.go
51+
+++ b/pkg/bandwidth/bandwidth.go
52+
@@ -87,11 +87,11 @@ func InitBandwidthManager() {
53+
return
54+
}
55+
56+
- if len(option.Config.GetDevices()) == 0 {
57+
- log.Warn("BPF bandwidth manager could not detect host devices. Disabling the feature.")
58+
- option.Config.EnableBandwidthManager = false
59+
- return
60+
- }
61+
+ //if len(option.Config.GetDevices()) == 0 {
62+
+ // log.Warn("BPF bandwidth manager could not detect host devices. Disabling the feature.")
63+
+ // option.Config.EnableBandwidthManager = false
64+
+ // return
65+
+ //}
66+
// Going via host stack will orphan skb->sk, so we do need BPF host
67+
// routing for it to work properly.
68+
if option.Config.EnableBBR && option.Config.EnableHostLegacyRouting {
69+
@@ -130,7 +130,7 @@ func InitBandwidthManager() {
70+
}).Fatal("Failed to set sysctl needed by BPF bandwidth manager.")
71+
}
72+
}
73+
-
74+
+ return
75+
for _, device := range option.Config.GetDevices() {
76+
link, err := netlink.LinkByName(device)
77+
if err != nil {
4778
diff --git a/pkg/datapath/linux/config/config.go b/pkg/datapath/linux/config/config.go
4879
index ea542dd527..0f078ad502 100644
4980
--- a/pkg/datapath/linux/config/config.go
@@ -62,5 +93,5 @@ index ea542dd527..0f078ad502 100644
6293
ctmap.WriteBPFMacros(fw, e)
6394
} else {
6495
--
65-
2.37.3
96+
2.39.0
6697

policy/cilium/0008-adapt-1.12.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ index 3783cbcb5a..562b76a79b 100644
6161
}
6262

6363
--
64-
2.37.3
64+
2.39.0
6565

0 commit comments

Comments
 (0)