Skip to content

Commit

Permalink
Merge pull request #35 from Comcast/v2.6.0
Browse files Browse the repository at this point in the history
V2.6.0
  • Loading branch information
Eric Greer authored May 18, 2022
2 parents 6616c39 + c2fe826 commit 6cfddbd
Show file tree
Hide file tree
Showing 36 changed files with 1,070,484 additions and 2,256 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13-alpine
FROM golang:1.17-alpine
RUN echo '@edgemain http://dl-3.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories
RUN apk add libpcap iptables haproxy iproute2 ipvsadm@edgemain gcc libc-dev git libpcap-dev && rm -rf /var/cache/apk/*
WORKDIR /app/src
Expand All @@ -10,7 +10,7 @@ RUN tar zxf gobgp_2.22.0_linux_amd64.tar.gz
RUN ls -al


FROM golang:1.13-alpine
FROM golang:1.17-alpine
LABEL MAINTAINER='RDEI Team <[email protected]>'
RUN echo '@edgemain http://dl-3.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories
RUN apk add libpcap iptables haproxy iproute2 ipvsadm@edgemain gcc libc-dev git libpcap-dev && rm -rf /var/cache/apk/*; rm -rf /var/cache/apk/*
Expand Down
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
TAG=v2.5.6
TAG=v2.6.0-proto205

# hub.comcast.net/k8s-eng/ravel:v2.6.0-proto205 -> v2.6.0-rc7
# v2.6.0-proto189 -> v2.6.0-rc4
# rc6: hub.comcast.net/k8s-eng/ravel:v2.5.0-proto45
# rc7: hub.comcast.net/k8s-eng/ravel:v2.5.0-proto66
# rc8: hub.comcast.net/k8s-eng/ravel:v2.5.0-proto67
Expand All @@ -15,7 +17,8 @@ build:
docker build -t hub.comcast.net/k8s-eng/ravel:${TAG} -f Dockerfile .

push:
docker push hub.comcast.net/k8s-eng/ravel:${TAG}
DOCKER_HOST=ssh://69.252.103.115 docker push hub.comcast.net/k8s-eng/ravel:${TAG}
#docker push hub.comcast.net/k8s-eng/ravel:${TAG}

default-gobgp: build-gobgp push-gobgp

Expand All @@ -25,5 +28,9 @@ build-gobgp:
push-gobgp:
docker push hub.comcast.net/k8s-eng/gobgpd:v2.2.0

remote:
DOCKER_HOST=ssh://69.252.103.115 docker buildx build --platform linux/amd64 --load -t hub.comcast.net/k8s-eng/ravel:${TAG} -f Dockerfile .

m1:
DOCKER_BUILDKIT=0 docker buildx build --platform linux/amd64 --load -t hub.comcast.net/k8s-eng/ravel:${TAG} -f Dockerfile .
DOCKER_HOST=ssh://69.252.103.115 docker buildx build --platform linux/amd64 --load -t hub.comcast.net/k8s-eng/ravel:${TAG} -f Dockerfile .
#docker buildx build --platform linux/amd64 --load -t hub.comcast.net/k8s-eng/ravel:${TAG} -f Dockerfile .
2 changes: 1 addition & 1 deletion cmd/command-piping/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func run() ([]string, error) {
}
}

log.Debugln("ipManager: parsed ", len(iFaces), "interfaces")
log.Debugln("ipManager: parsed", len(iFaces), "interfaces")

return iFaces, nil
}
1 change: 1 addition & 0 deletions cmd/iface-lister/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
iface-lister
Binary file removed cmd/iface-lister/iface-lister
Binary file not shown.
17 changes: 2 additions & 15 deletions cmd/ravel/bgp.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/Comcast/Ravel/pkg/bgp"
"github.com/Comcast/Ravel/pkg/stats"
"github.com/Comcast/Ravel/pkg/system"
"github.com/Comcast/Ravel/pkg/types"
"github.com/Comcast/Ravel/pkg/watcher"
)

// BGP configures IPVS, attracts packets in multi-master BGP mode
Expand Down Expand Up @@ -42,7 +42,7 @@ func BGP(ctx context.Context, logger logrus.FieldLogger) *cobra.Command {

// instantiate a watcher
log.Infoln("BGP: Starting configuration watcher")
watcher, err := system.NewWatcher(ctx, config.KubeConfigFile, config.ConfigMapNamespace, config.ConfigMapName, config.ConfigKey, stats.KindBGP, config.DefaultListener.Service, config.DefaultListener.Port, logger)
watcher, err := watcher.NewWatcher(ctx, config.KubeConfigFile, config.ConfigMapNamespace, config.ConfigMapName, config.ConfigKey, stats.KindBGP, config.DefaultListener.Service, config.DefaultListener.Port, logger)
if err != nil {
return err
}
Expand All @@ -53,19 +53,6 @@ func BGP(ctx context.Context, logger logrus.FieldLogger) *cobra.Command {
if err != nil {
return fmt.Errorf("failed to initialize metrics. %v", err)
}
go func() {
logger.Debug("BGP: executing BGP stats closure")
configs := make(chan *types.ClusterConfig, 100)
watcher.ConfigMap(ctx, "stats", configs)
for {
select {
case <-ctx.Done():
return
case c := <-configs:
s.UpdateConfig(c)
}
}
}()
log.Debugln("BGP: checking if BGP stats enabled")
if config.Stats.Enabled {
if err := s.EnableBPFStats(); err != nil {
Expand Down
18 changes: 3 additions & 15 deletions cmd/ravel/director.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/Comcast/Ravel/pkg/iptables"
"github.com/Comcast/Ravel/pkg/stats"
"github.com/Comcast/Ravel/pkg/system"
"github.com/Comcast/Ravel/pkg/types"
"github.com/Comcast/Ravel/pkg/util"
"github.com/Comcast/Ravel/pkg/watcher"
)

// Director runs the ipvs Director
Expand Down Expand Up @@ -56,7 +56,7 @@ are missing from the configuration.`,

// instantiate a watcher
logger.Info("starting watcher")
watcher, err := system.NewWatcher(ctx, config.KubeConfigFile, config.ConfigMapNamespace, config.ConfigMapName, config.ConfigKey, stats.KindDirector, config.DefaultListener.Service, config.DefaultListener.Port, logger)
watcher, err := watcher.NewWatcher(ctx, config.KubeConfigFile, config.ConfigMapNamespace, config.ConfigMapName, config.ConfigKey, stats.KindDirector, config.DefaultListener.Service, config.DefaultListener.Port, logger)
if err != nil {
return err
}
Expand All @@ -66,18 +66,6 @@ are missing from the configuration.`,
if err != nil {
return fmt.Errorf("failed to initialize metrics. %v", err)
}
go func() {
configs := make(chan *types.ClusterConfig, 100)
watcher.ConfigMap(ctx, "stats", configs)
for {
select {
case <-ctx.Done():
return
case c := <-configs:
s.UpdateConfig(c)
}
}
}()
if config.Stats.Enabled {
if err := s.EnableBPFStats(); err != nil {
return fmt.Errorf("failed to initialize BPF capture. if=%v sa=%s %v", config.Stats.Interface, config.Stats.ListenAddr, err)
Expand Down Expand Up @@ -131,7 +119,7 @@ are missing from the configuration.`,

// instantiate the director worker.
logger.Info("initializing director")
worker, err := director.NewDirector(ctx, config.NodeName, config.ConfigKey, config.CleanupMaster, watcher, ipvs, ip, ipt, config.IPVS.ColocationMode, config.ForcedReconfigure, logger)
worker, err := director.NewDirector(ctx, config.NodeName, config.ConfigKey, config.CleanupMaster, watcher, ipvs, ip, ipt, config.IPVS.ColocationMode, config.ForcedReconfigure)
if err != nil {
return err
}
Expand Down
8 changes: 1 addition & 7 deletions cmd/ravel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func init() {
logger.SetLevel(logLevel)
logger.Out = os.Stdout

// TEMP immediate debugging
// Uncomment to pin debug logging on
logger.SetLevel(logrus.DebugLevel)
logger.Debugln("Debug logging enabled!")

Expand Down Expand Up @@ -169,7 +169,6 @@ func main() {
rootCmd.AddCommand(BGP(ctx, log))
rootCmd.AddCommand(Version())

// DEBUG
log.Infoln("Command arguments:", rootCmd.Flags().Args())

// Performing a nonblocking run of the application, reading error state through a chan.
Expand All @@ -184,11 +183,6 @@ func main() {
sig := make(chan os.Signal, 1)
signal.Notify(sig, allOfTheSignals...)

// start pprof for performance debugging
// go func() {
// log.Println(http.ListenAndServe("0.0.0.0:6060", nil))
// }()

exitCode := 0
log.Debugln("Watching for interrupts")
select {
Expand Down
16 changes: 2 additions & 14 deletions cmd/ravel/realserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"time"

"github.com/Comcast/Ravel/pkg/haproxy"
"github.com/Comcast/Ravel/pkg/watcher"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/Comcast/Ravel/pkg/iptables"
"github.com/Comcast/Ravel/pkg/realserver"
"github.com/Comcast/Ravel/pkg/stats"
"github.com/Comcast/Ravel/pkg/system"
"github.com/Comcast/Ravel/pkg/types"
"github.com/Comcast/Ravel/pkg/util"
)

Expand Down Expand Up @@ -44,7 +44,7 @@ are missing from the configuration.`,
}

// instantiate a watcher
watcher, err := system.NewWatcher(ctx, config.KubeConfigFile, config.ConfigMapNamespace, config.ConfigMapName, config.ConfigKey, stats.KindRealServer, config.DefaultListener.Service, config.DefaultListener.Port, logger)
watcher, err := watcher.NewWatcher(ctx, config.KubeConfigFile, config.ConfigMapNamespace, config.ConfigMapName, config.ConfigKey, stats.KindRealServer, config.DefaultListener.Service, config.DefaultListener.Port, logger)
if err != nil {
return err
}
Expand All @@ -54,18 +54,6 @@ are missing from the configuration.`,
if err != nil {
return fmt.Errorf("failed to initialize metrics. %v", err)
}
go func() {
configs := make(chan *types.ClusterConfig, 100)
watcher.ConfigMap(ctx, "stats", configs)
for {
select {
case <-ctx.Done():
return
case c := <-configs:
s.UpdateConfig(c)
}
}
}()
if config.Stats.Enabled {
if err := s.EnableBPFStats(); err != nil {
return fmt.Errorf("failed to initialize BPF capture. if=%v sa=%s %v", config.Stats.Interface, config.Stats.ListenAddr, err)
Expand Down
29 changes: 14 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,33 @@ require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15 // indirect
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect
github.com/coreos/go-semver v0.2.0
github.com/coreos/go-semver v0.3.0
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501 // indirect
github.com/godbus/dbus v4.1.0+incompatible
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/google/btree v1.0.0 // indirect
github.com/google/gopacket v1.1.19
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/gophercloud/gophercloud v0.1.0 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/prometheus/client_golang v0.9.0
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 // indirect
github.com/prometheus/common v0.0.0-20181019103554-16b4535ad14a
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d // indirect
github.com/prometheus/client_golang v1.4.0
github.com/prometheus/common v0.9.1 // indirect
github.com/sirupsen/logrus v1.7.0
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.2.1
golang.org/x/sys v0.0.0-20210923061019-b8560ed6a9b7 // indirect
github.com/spf13/viper v1.10.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.18.9
k8s.io/apimachinery v0.18.9
k8s.io/client-go v0.18.9
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.23.4
k8s.io/apimachinery v0.23.4
k8s.io/client-go v0.23.4
k8s.io/klog v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v3 v3.0.0 // indirect
)
Loading

0 comments on commit 6cfddbd

Please sign in to comment.