Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making local_bfd changes #4

Open
wants to merge 8 commits into
base: release-v3.25
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PACKAGE_NAME = github.com/projectcalico/calico
PACKAGE_NAME = github.com/powerhome/calico

include metadata.mk
include lib.Makefile
Expand All @@ -15,7 +15,7 @@ DOCKER_RUN := mkdir -p ./.go-pkg-cache bin $(GOMOD_CACHE) && \
-e OS=$(BUILDOS) \
-e GOOS=$(BUILDOS) \
-e GOFLAGS=$(GOFLAGS) \
-v $(CURDIR):/go/src/github.com/projectcalico/calico:rw \
-v $(CURDIR):/go/src/github.com/powerhome/calico:rw \
-v $(CURDIR)/.go-pkg-cache:/go-cache:rw \
-w /go/src/$(PACKAGE_NAME)

Expand Down
25 changes: 20 additions & 5 deletions confd/etc/calico/confd/templates/bird.cfg.template
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ listen bgp{{$listen_address}}{{$listen_port}};
{{- end}}

{{- define "LOGGING"}}
{{- $node_logging_key := printf "/host/%s/loglevel" (getenv "NODENAME")}}
{{- $node_logging_key := "debug"}}
{{- if exists $node_logging_key}}
{{- $logging := getv $node_logging_key}}
{{- $logging := "debug"}}
{{- if eq $logging "debug"}}
debug all;
{{- else if ne $logging "none"}}
debug { states };
{{- end}}
{{- else if exists "/global/loglevel"}}
{{- $logging := getv "/global/loglevel"}}
{{- $logging := "debug"}}
{{- if eq $logging "debug"}}
debug all;
{{- else if ne $logging "none"}}
Expand Down Expand Up @@ -107,7 +107,6 @@ protocol kernel {

# Watch interface up/down events.
protocol device {
{{- template "LOGGING"}}
scan time 2; # Scan interfaces every 2 seconds
}

Expand All @@ -118,7 +117,6 @@ protocol device {
{{- end}}

protocol direct {
{{- template "LOGGING"}}
{{- if ne "" $ignored_interfaces}}{{$ifaces := split $ignored_interfaces ","}}
interface {{range $ifaces}}-"{{.}}", {{end}}-"cali*", -"kube-ipvs*", "*";
{{- else}}
Expand All @@ -134,6 +132,20 @@ protocol direct {
{{- end}}
}

protocol bfd {
debug { states };
interface -"cali*", -"kube-ipvs*", "*" {
interval 1000 ms;
idle tx interval 2000 ms;
multiplier 3;
};
multihop {
interval 1000 ms;
idle tx interval 2000 ms;
multiplier 3;
};
}

{{if eq "" ($node_ip)}}# IPv4 disabled on this node.
{{else}}{{$node_as_key := printf "/host/%s/as_num" (getenv "NODENAME")}}
# Template for all BGP clients
Expand Down Expand Up @@ -192,6 +204,7 @@ template bgp bgp_template {
{{if gt $onode_ip $node_ip}}
passive on; # Mesh is unidirectional, peer will connect to us.
{{- end}}
bfd on;
{{- if exists "/global/node_mesh_restart_time"}}{{$node_mesh_restart_time := getv "/global/node_mesh_restart_time"}}
{{- if ne ($node_mesh_restart_time) ""}}
graceful restart time {{$node_mesh_restart_time}};
Expand Down Expand Up @@ -235,6 +248,7 @@ protocol bgp Global_{{$id}} from bgp_template {
{{- end}}
{{- if ne $data.restart_time ""}}
graceful restart time {{$data.restart_time}};
bfd on;
{{- end}}
{{- if and (eq $data.as_num $node_as_num) (ne "" ($node_cluster_id)) (ne $data.rr_cluster_id ($node_cluster_id))}}
rr client;
Expand Down Expand Up @@ -281,6 +295,7 @@ protocol bgp Node_{{$id}} from bgp_template {
{{- end}}
{{- if ne $data.restart_time ""}}
graceful restart time {{$data.restart_time}};
bfd on;
{{- end}}
{{- if and (eq $data.as_num $node_as_num) (ne "" ($node_cluster_id)) (ne $data.rr_cluster_id ($node_cluster_id))}}
rr client;
Expand Down
10 changes: 10 additions & 0 deletions confd/etc/calico/confd/templates/bird_ipam.cfg.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ function reject_disabled_pools ()
{{- end}}
}

function reject_third_party_routes ()
{
if (defined(bgp_path)) then {
if (bgp_path.len > 1) then {
reject;
}
}
}

filter calico_export_to_bgp_peers {
# filter code terminates when it calls `accept;` or `reject;`, call reject_disabled_pools() first, then apply_communities() and then calico_aggr()
reject_disabled_pools();
Expand All @@ -23,6 +32,7 @@ filter calico_export_to_bgp_peers {
if ( net ~ {{$cidr}} ) then { accept; }
{{- end}}
{{- end}}
reject_third_party_routes();
{{range ls "/v1/ipam/v4/pool"}}{{$data := json (getv (printf "/v1/ipam/v4/pool/%s" .))}}
{{- if $data.disableBGPExport}}
# Skip {{$data.cidr}} as BGP export is disabled for it
Expand Down
9 changes: 2 additions & 7 deletions hack/release/pkg/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,11 @@ import (
var (
// Registries to which all release images are pushed.
registries = []string{
"docker.io/calico",
"quay.io/calico",
"gcr.io/projectcalico-org",
"eu.gcr.io/projectcalico-org",
"asia.gcr.io/projectcalico-org",
"us.gcr.io/projectcalico-org",
"ghcr.io/powerhome/calico",
}

// Git configuration for publishing to GitHub.
organization = "projectcalico"
organization = "powerhome"
repo = "calico"
origin = "origin"
)
Expand Down
7 changes: 5 additions & 2 deletions lib.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,11 @@ endif
DOCKER_BUILD=docker buildx build --pull \
--build-arg QEMU_IMAGE=$(CALICO_BUILD) \
--build-arg UBI_IMAGE=$(UBI_IMAGE) \
--build-arg GIT_VERSION=$(GIT_VERSION) $(TARGET_PLATFORM)
--build-arg GIT_VERSION=$(GIT_VERSION) $(TARGET_PLATFORM) \
--label org.opencontainers.image.source="https://github.com/powerhome/calico" \
--label org.opencontainers.image.version=$(GIT_VERSION) \
--label org.opencontainers.image.revision=$(GIT_COMMIT) \
--label org.opencontainers.image.licenses="Apache-2.0"

DOCKER_RUN := mkdir -p ../.go-pkg-cache bin $(GOMOD_CACHE) && \
docker run --rm \
Expand Down Expand Up @@ -1388,4 +1392,3 @@ help:
@echo "BUILDARCH (host): $(BUILDARCH)"
@echo "CALICO_BUILD: $(CALICO_BUILD)"
@echo "-----------------------------------------------------------"

10 changes: 5 additions & 5 deletions metadata.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
GO_BUILD_VER = v0.82

# Version of Kubernetes to use for tests.
K8S_VERSION = v1.24.7
K8S_VERSION = v1.22.17
# This is used for bitnami/kubectl and kubectl binary release.
KUBECTL_VERSION = v1.24.8
KUBECTL_VERSION = v1.22.17

# Version of various tools used in the build and tests.
COREDNS_VERSION=1.5.2
Expand All @@ -17,18 +17,18 @@ PROTOC_VER=v0.1
UBI_VERSION=8.8

# Configuration for Semaphore integration.
ORGANIZATION = projectcalico
ORGANIZATION = powerhome

# Configure git to access repositories using SSH.
GIT_USE_SSH = true
GIT_USE_SSH = false

# The version of BIRD to use for calico/node builds and confd tests.
BIRD_VERSION=v0.3.3-202-g7a77fb73

# DEV_REGISTRIES configures the container image registries which are built from this
# repository. By default, just build images with calico/. Allow this variable to be overridden,
# as both CI/CD and the release tooling will override this to build publishable images.
DEV_REGISTRIES ?= calico
DEV_REGISTRIES ?= ghcr.io/powerhome/calico

# RELEASE_REGISTIRES configures the container images registries which are published to
# as part of an official release.
Expand Down