Skip to content

Commit 5011c2b

Browse files
committed
Add cilium LB
1 parent 0b20112 commit 5011c2b

File tree

8 files changed

+93
-19
lines changed

8 files changed

+93
-19
lines changed

apps/argo/cd/mgmt/main.k

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ app = argo_cd_base.app | {
100100
redis = _dragonfly
101101
}
102102
ingresses.main = ingress.Ingress {
103+
className = "cilium"
103104
rules.main = {
104105
httpPaths.main.backend.service = {
105106
name = "argo-cd-server"

apps/cilium/system/base/main.k

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import file
22

33
import charts.cilium
4+
import charts.cilium.api.v2alpha1 as ciliumv2alpha1
45
import cilium_shared
56
import konfig.models.frontend
7+
import konfig.models.utils as modelutils
68
import konfig.utils
79

810
_valueFile = utils.abs_path(file.current(), "values.yaml")
@@ -14,4 +16,53 @@ app: frontend.App {
1416
charts.cilium = cilium.Chart {
1517
valueFiles: [_valueFile]
1618
}
19+
20+
extraResources.bgpPeering = ciliumv2alpha1.CiliumBGPPeeringPolicy {
21+
metadata: modelutils.AppMetadataBuilder({
22+
name = "cilium-ingress"
23+
}, modelutils.ArgoCDOptions {
24+
sync.SkipDryRunOnMissingResource = True
25+
})
26+
spec: {
27+
# nodeSelector.matchLabels = {
28+
# "bgp.kube.macro.network/peer-group" = "main"
29+
# }
30+
virtualRouters = [
31+
{
32+
localASN = 64512
33+
exportPodCIDR = False
34+
neighbors = [
35+
{
36+
peerAddress = "10.1.0.1/32"
37+
peerASN = 64512
38+
eBGPMultihopTTL = 1
39+
}
40+
]
41+
serviceSelector.matchLabels = {
42+
"cilium.io/ingress": "true"
43+
}
44+
}
45+
]
46+
}
47+
}
48+
49+
extraResources.ipPool = ciliumv2alpha1.CiliumLoadBalancerIPPool {
50+
metadata: {
51+
name = "cilium-ingress"
52+
}
53+
spec: {
54+
blocks = [
55+
{
56+
cidr = "10.10.30.0/24"
57+
}
58+
{
59+
cidr = "fc42:0:0:a::10:0/108"
60+
}
61+
]
62+
allowFirstLastIPs = "No"
63+
serviceSelector.matchLabels = {
64+
"cilium.io/ingress": "true"
65+
}
66+
}
67+
}
1768
}

apps/cilium/system/base/values.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,33 @@ endpointRoutes:
3232
##
3333
enabled: false
3434

35+
bgpControlPlane:
36+
enabled: true
37+
secretsNamespace:
38+
create: true
39+
name: cilium-bgp
40+
41+
wellKnownIdentities:
42+
enabled: true
43+
44+
loadBalancer:
45+
algorithm: maglev
46+
mode: dsr
47+
serviceTopology: true
48+
l7:
49+
backend: envoy
50+
51+
envoyConfig:
52+
enabled: true
53+
54+
encryption:
55+
enabled: true
56+
type: wireguard
57+
58+
## Enable BPF clock source probing for more efficient tick retrieval.
59+
##
60+
bpfClockProbe: false
61+
3562
dnsPolicy: ClusterFirst
3663

3764
operator:

apps/external/dns/base/values.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,5 @@ sources:
1111

1212
policy: upsert-only
1313

14-
extraArgs:
15-
- --crd-source-apiversion=externaldns.k8s.io/v1alpha1
16-
- --crd-source-kind=DNSEndpoint
17-
- --ingress-class=traefik
18-
1914
serviceMonitor:
2015
enabled: false

apps/external/dns/mgmt/main.k

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ app = external_dns_base.app | {
88
unifiCreds = external_dns_base.unifiCreds
99
}
1010
charts: {
11-
external_dns_cloudflare = external_dns.Chart {
12-
values: external_dns_base.cloudflareValues
13-
}
1411
external_dns_unifi = external_dns.Chart {
15-
values: external_dns_base.unifiValues
12+
values: external_dns_base.unifiValues | {
13+
extraArgs = [
14+
"--crd-source-apiversion=externaldns.k8s.io/v1alpha1"
15+
"--crd-source-kind=DNSEndpoint"
16+
"--ingress-class=cilium"
17+
]
18+
}
1619
}
1720
}
1821
}

bootstrap/core/mgmt/main.k

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ app = bootstrap.app | {
6767
name = "bootstrap"
6868
namespace = _argo_cd_namespace
6969
}, utils.ArgoCDOptions {
70+
compare.ServerSideDiff = True
71+
compare.IncludeMutationWebhook = True
7072
finalize = False
7173
})
7274
spec = {

konfig/models/backend/tenant_backend.k

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ schema TenantBackend[inputConfig: frontend.Tenant]:
5151
metadata = utils.AppMetadataBuilder(_metadata | {
5252
name = "${config.name}-shared"
5353
}, utils.ArgoCDOptions {
54+
compare.ServerSideDiff = True
55+
compare.IncludeMutationWebhook = True
5456
sync.Prune = "false"
5557
finalize = False
5658
})
@@ -159,6 +161,8 @@ schema TenantBackend[inputConfig: frontend.Tenant]:
159161
metadata = utils.AppMetadataBuilder(_metadata | {
160162
name = "${config.name}-apps"
161163
}, utils.ArgoCDOptions {
164+
compare.ServerSideDiff = True
165+
compare.IncludeMutationWebhook = True
162166
sync.Prune = "false"
163167
finalize = False
164168
})

konfig/models/utils/app_metadata_builder.k

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
AppMetadataBuilder = lambda config: any, options: ArgoCDOptions -> {str:} {
2-
_options = options
3-
4-
if not options.compare?.ServerSideDiff:
5-
_options.compare.ServerSideDiff = True
6-
if not options.compare?.IncludeMutationWebhook:
7-
_options.compare.IncludeMutationWebhook = True
8-
if not options?.finalize:
9-
_options.finalize = True
10-
11-
_argoCDOptionMetadataBuilder(_options) | {
2+
_argoCDOptionMetadataBuilder(options) | {
123
name: config?.name
134
namespace: config?.namespace
145
labels: config?.labels

0 commit comments

Comments
 (0)