diff --git a/Makefile b/Makefile index b320ce31c..84198336d 100644 --- a/Makefile +++ b/Makefile @@ -29,29 +29,46 @@ image-kind: image vpp: $(MAKE) -C vpp-manager $@ VPP_DIR=$(VPP_DIR) BASE=$(BASE) -# kube-test-template: emit a KinD manifest template for kube-test. -# Bakes in repo layout-specific values (CALICOVPP_AGENT_IMAGE, VPP_BUILD_REL_PATH) -# so that VPP kube-test does not need to know the repo layout. -# Old layout: separate images, VPP build at vpp-manager/vpp_build/. +# kube-test-template: emit a self-contained kube-test manifest for the +# the requested cluster flavor. All CalicoVPP-internal layout details +# (image names, in-repo paths to the VPP build output, etc.) are +# resolved here from the kustomize sources under +# yaml/overlays/kube-test-* and baked into the emitted manifest. +# +# Only consumer-owned runtime placeholders survive in the output: +# ${CALICOVPP_VERSION}, ${HOME}, ${ADDITIONAL_VPP_CONFIG}, +# ${CALICOVPP_ENABLE_MEMIF}, ${CALICO_NETWORK_CONFIG} and +# ${CALICOVPP_INTERFACE} (baremetal only) +# +# The consumer (e.g. VPP `extras/kube-test`) does NOT need to know +# which image to use or where the VPP build lives in this repo. +# +# Usage: +# make kube-test-template FLAVOR=kind # default +# make kube-test-template FLAVOR=baremetal +FLAVOR ?= kind .PHONY: kube-test-template kube-test-template: - @CALICOVPP_AGENT_IMAGE=calicovpp/agent VPP_BUILD_REL_PATH=vpp-manager/vpp_build \ - envsubst '$$CALICOVPP_AGENT_IMAGE $$VPP_BUILD_REL_PATH' \ - < yaml/generated/calico-vpp-kubetest.yaml - -# kube-test-push-images: pull this release's CalicoVPP images from docker.io and push -# to localhost:5000 for kube-test consumption. Called by kube-test release-cluster flow. + @if [ "$(FLAVOR)" != "kind" ] && [ "$(FLAVOR)" != "baremetal" ]; then \ + echo "kube-test-template: unsupported FLAVOR=$(FLAVOR) (expected kind or baremetal)" >&2; \ + exit 2; \ + fi + @kubectl kustomize yaml/overlays/kube-test-$(FLAVOR) 2>/dev/null + @echo "---" + @cat yaml/components/kube-test/tigera-installation.snippet.yaml + +# kube-test-push-images: pull this release's CalicoVPP images from docker.io +# and push to localhost:5000 for kube-test consumption. Called by the +# VPP kube-test `release-cluster` flow. On this split-image release, +# we ship three images; master / >= v3.33 ships only `calicovpp/vpp`. +KUBE_TEST_IMAGES ?= calicovpp/vpp calicovpp/agent calicovpp/multinet-monitor .PHONY: kube-test-push-images kube-test-push-images: - docker pull docker.io/calicovpp/agent:$(CALICOVPP_VERSION) - docker image tag docker.io/calicovpp/agent:$(CALICOVPP_VERSION) localhost:5000/calicovpp/agent:$(CALICOVPP_VERSION) - docker push localhost:5000/calicovpp/agent:$(CALICOVPP_VERSION) - docker pull docker.io/calicovpp/vpp:$(CALICOVPP_VERSION) - docker image tag docker.io/calicovpp/vpp:$(CALICOVPP_VERSION) localhost:5000/calicovpp/vpp:$(CALICOVPP_VERSION) - docker push localhost:5000/calicovpp/vpp:$(CALICOVPP_VERSION) - docker pull docker.io/calicovpp/multinet-monitor:$(CALICOVPP_VERSION) - docker image tag docker.io/calicovpp/multinet-monitor:$(CALICOVPP_VERSION) localhost:5000/calicovpp/multinet-monitor:$(CALICOVPP_VERSION) - docker push localhost:5000/calicovpp/multinet-monitor:$(CALICOVPP_VERSION) + @for img in $(KUBE_TEST_IMAGES); do \ + docker pull docker.io/$$img:$(CALICOVPP_VERSION); \ + docker image tag docker.io/$$img:$(CALICOVPP_VERSION) localhost:5000/$$img:$(CALICOVPP_VERSION); \ + docker push localhost:5000/$$img:$(CALICOVPP_VERSION); \ + done .PHONY: kind-cluster-name kind-cluster-name: diff --git a/go.mod b/go.mod index 44e67e13d..82dddad0f 100644 --- a/go.mod +++ b/go.mod @@ -27,8 +27,8 @@ require ( go.fd.io/govpp/extras v0.1.0 golang.org/x/net v0.38.0 golang.org/x/sys v0.31.0 - google.golang.org/grpc v1.65.0 - google.golang.org/protobuf v1.34.2 + google.golang.org/grpc v1.70.0 + google.golang.org/protobuf v1.36.5 gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 k8s.io/api v0.29.9 k8s.io/apimachinery v0.29.9 @@ -62,14 +62,11 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect - github.com/google/go-cmp v0.6.0 // indirect + github.com/google/go-cmp v0.7.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/imdario/mergo v0.3.16 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect - github.com/jinzhu/copier v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/k-sone/critbitgo v1.4.0 // indirect @@ -112,8 +109,8 @@ require ( golang.org/x/text v0.23.0 // indirect golang.org/x/time v0.5.0 // indirect golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect gopkg.in/go-playground/validator.v9 v9.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index bc670bca3..17274e3aa 100644 --- a/go.sum +++ b/go.sum @@ -67,6 +67,8 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= @@ -122,8 +124,8 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -134,12 +136,8 @@ github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwg github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= @@ -310,6 +308,16 @@ go.fd.io/govpp/extras v0.1.0/go.mod h1:s2FPOGIWR+p3ItFhlC2Zgbw1U5HwZxNYLffeK8Ld/ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= +go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= +go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= +go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= +go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU= +go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= +go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= +go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -413,18 +421,18 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 h1:0+ozOGcrp+Y8Aq8TLNN2Aliibms5LEzsq99ZZmAGYm0= -google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094/go.mod h1:fJ/e3If/Q67Mj99hin0hMhiNyCRmt6BQ2aWIJshUSJw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950= +google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb h1:TLPQVbx1GJ8VKZxz52VAxl1EBgKXXbTiU9Fc5fZeLn4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ= +google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -434,8 +442,8 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vpplink/generated/generate.log b/vpplink/generated/generate.log index 0dafee2db..2671ab601 100755 --- a/vpplink/generated/generate.log +++ b/vpplink/generated/generate.log @@ -1,4 +1,4 @@ -VPP Version : 25.06.0-31~gaed31090c +VPP Version : 25.06.0-33~g2a2cb98cc Binapi-generator version : v0.11.0 VPP Base commit : 47505bc21 misc: Initial changes for stable/2506 branch ------------------ Cherry picked commits -------------------- @@ -6,12 +6,14 @@ ip-neighbor: preserve interface LL receive DPO for self link-local acl: acl-plugin custom policies cnat: [WIP] no k8s maglev from pods pbl: Port based balancer +gerrit:45046/4 ip6-nd: add punt reason for neigh advs +gerrit:45099/2 ip6-nd: add nd-proxy all dst gerrit:43710/12 npol: Network Policies plugin gerrit:44966/5 ip-neighbor: fix missing solicited-node multicast MAC gerrit:44903/1 vxlan: reset next_dpo on delete gerrit:44900/1 tap: backport fix promiscuous mode gerrit:44855/6 tap: backport VHOST_SET_FORK_FROM_OWNER support -gerrit:44350/2 vnet: fix unicast NA handling in ND proxy +gerrit:44350/3 vnet: fix unicast NA handling in ND proxy gerrit:43723/3 session svm: fix session migrate attach data corruption gerrit:43139/5 udp: regrab connected session after transport clone gerrit:43714/5 session: fix handling of closed during migration diff --git a/yaml/Makefile b/yaml/Makefile index 393cfcd30..ae0e1d341 100644 --- a/yaml/Makefile +++ b/yaml/Makefile @@ -22,6 +22,16 @@ build: clean kubectl kustomize overlays/eks-dpdk-multinet > generated/calico-vpp-eks-dpdk-multinet.yaml kubectl kustomize overlays/kind > generated/calico-vpp-kind.yaml kubectl kustomize overlays/kind-multinet > generated/calico-vpp-kind-multinet.yaml + # Kube-test manifest (consumed by `make -C .. kube-test-template`). + # The kind flavor is checked-in as the canonical generated file; the + # baremetal flavor is generated on demand via `make kube-test-template + # FLAVOR=baremetal` from the repo root. + { kubectl kustomize overlays/kube-test-kind ; \ + echo "---" ; \ + cat components/kube-test/tigera-installation.snippet.yaml ; \ + } > generated/calico-vpp-kubetest.yaml + # Sanity-check the baremetal flavor compiles (not exported) + kubectl kustomize overlays/kube-test-baremetal > /dev/null # Do not export the test-* overlays, but still check they compile kubectl kustomize overlays/test-vagrant > /dev/null kubectl kustomize overlays/test-vagrant-mounts > /dev/null diff --git a/yaml/components/kube-test/README.md b/yaml/components/kube-test/README.md new file mode 100644 index 000000000..0ad517681 --- /dev/null +++ b/yaml/components/kube-test/README.md @@ -0,0 +1,42 @@ +# Kube-test kustomize component + +This component transforms the standard CalicoVPP daemonset for use +by the VPP `extras/kube-test` test harness (and other consumers that +share its constraints). + +This file documents the **split-image** variant of the component used +on release branches `<= v3.32`. `master`/`>= v3.33` ships a unified-image +variant where the agent container reuses `calicovpp/vpp` with an explicit +`command: ["/bin/calico-vpp-agent"]` override. Either way, the consumer +just sees a working manifest. + +## What this component owns (consumer-agnostic, layout-aware) + +* Image references (registry `localhost:5000`, `imagePullPolicy: Always`). +* The split-image layout: the `vpp` container uses `calicovpp/vpp` and the + `agent` container uses `calicovpp/agent` with no command override. +* The path to the in-tree VPP build output that is bind-mounted into the + containers as `/repo/vpp-manager/vpp_build/...`. +* The tigera-operator `Installation` and `APIServer` CRs that kube-test + needs to bootstrap Calico. + +When the layout changes, **only this component** (and its base manifest) +needs to change. Consumers stay untouched. + +## What the consumer (e.g. VPP kube-test) owns + +Only the following placeholders survive in the emitted manifest and must +be substituted by the consumer at apply-time (e.g. via `envsubst`): + +| Placeholder | Owner / typical source | +| ----------------------------- | ------------------------------------ | +| `${CALICOVPP_VERSION}` | image tag (`kt-master`, `v3.29.0`) | +| `${HOME}` | host path for calicovpp checkout | +| `${ADDITIONAL_VPP_CONFIG}` | per-test extra VPP startup CLI | +| `${CALICOVPP_ENABLE_MEMIF}` | per-test memif feature toggle | +| `${CALICO_NETWORK_CONFIG}` | per-test calico-network override | +| `${CALICOVPP_INTERFACE}` | baremetal-only: uplink NIC name | + +The consumer MUST NOT need to know which image name to use, what the +in-repo path of the VPP build directory is or any other CalicoVPP +internal detail. diff --git a/yaml/components/kube-test/baremetal/configmap-baremetal.yaml b/yaml/components/kube-test/baremetal/configmap-baremetal.yaml new file mode 100644 index 000000000..1aa2dfcf5 --- /dev/null +++ b/yaml/components/kube-test/baremetal/configmap-baremetal.yaml @@ -0,0 +1,58 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: calico-vpp-config + namespace: calico-vpp-dataplane +data: + CALICOVPP_CONFIG_TEMPLATE: |- + unix { + nodaemon + full-coredump + cli-listen /var/run/vpp/cli.sock + pidfile /run/vpp/vpp.pid + exec /etc/vpp/startup.exec + } + api-trace { on } + socksvr { + socket-name /var/run/vpp/vpp-api.sock + } + plugins { + plugin default { enable } + plugin dpdk_plugin.so { enable } + plugin calico_plugin.so { enable } + plugin ping_plugin.so { enable } + plugin dispatch_trace_plugin.so { enable } + } + buffers { + buffers-per-numa 131072 + } + ${ADDITIONAL_VPP_CONFIG} + CALICOVPP_INITIAL_CONFIG: |- + { + "vppStartupSleepSeconds": 1, + "corePattern": "/var/lib/vpp/vppcore.%e.%p" + } + CALICOVPP_FEATURE_GATES: |- + { + "memifEnabled": true, + "vclEnabled": true + } + CALICOVPP_INTERFACES: |- + { + "maxPodIfSpec": { + "rx": 10, "tx": 10, "rxqsz": 1024, "txqsz": 1024 + }, + "defaultPodIfSpec": { + "rx": 1, "tx":1, "isl3": true + }, + "vppHostTapSpec": { + "rx": 1, "tx":1, "rxqsz": 1024, "txqsz": 1024, "isl3": false + }, + "uplinkInterfaces": [ + { + "interfaceName": "${CALICOVPP_INTERFACE}", + "vppDriver": "dpdk" + } + ] + } + SERVICE_PREFIX: 10.96.0.0/12 diff --git a/yaml/components/kube-test/baremetal/daemonset-baremetal.yaml b/yaml/components/kube-test/baremetal/daemonset-baremetal.yaml new file mode 100644 index 000000000..022f16182 --- /dev/null +++ b/yaml/components/kube-test/baremetal/daemonset-baremetal.yaml @@ -0,0 +1,29 @@ +# Baremetal kube-test overrides: DPDK driver requires hugepages and a +# larger CPU allocation than the KinD flavor. +# +# Also, baremetal uses docker.io as the image registry (no kind-registry), +# so we override the registry prefix back to docker.io and switch to +# `imagePullPolicy: IfNotPresent` since images come from a public registry. +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: calico-vpp-node + namespace: calico-vpp-dataplane +spec: + template: + spec: + containers: + - name: vpp + image: docker.io/calicovpp/vpp:${CALICOVPP_VERSION} + imagePullPolicy: IfNotPresent + resources: + limits: + cpu: "10" + hugepages-2Mi: 4Gi + memory: 4Gi + requests: + cpu: "10" + memory: 4Gi + - name: agent + image: docker.io/calicovpp/agent:${CALICOVPP_VERSION} + imagePullPolicy: IfNotPresent diff --git a/yaml/components/kube-test/baremetal/kustomization.yaml b/yaml/components/kube-test/baremetal/kustomization.yaml new file mode 100644 index 000000000..428dd76a1 --- /dev/null +++ b/yaml/components/kube-test/baremetal/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +# Baremetal-flavor adjustments on top of components/kube-test: +# - uplink interface name is provided by the consumer at apply-time +# - DPDK driver +# - hugepages and a larger buffer pool +patchesStrategicMerge: +- daemonset-baremetal.yaml +- configmap-baremetal.yaml diff --git a/yaml/components/kube-test/configmap-kube-test.yaml b/yaml/components/kube-test/configmap-kube-test.yaml new file mode 100644 index 000000000..ba819c3bb --- /dev/null +++ b/yaml/components/kube-test/configmap-kube-test.yaml @@ -0,0 +1,70 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: calico-vpp-config + namespace: calico-vpp-dataplane +data: + CALICOVPP_BGP_LOG_LEVEL: "" + CALICOVPP_CONFIG_EXEC_TEMPLATE: "" + CALICOVPP_CONFIG_TEMPLATE: |- + unix { + nodaemon + full-coredump + log /var/run/vpp/vpp.log + cli-listen /var/run/vpp/cli.sock + pidfile /run/vpp/vpp.pid + } + cpu { + workers 0 + } + socksvr { + socket-name /var/run/vpp/vpp-api.sock + } + buffers { + buffers-per-numa 16384 + page-size 4K + } + plugins { + plugin default { enable } + plugin calico_plugin.so { enable } + plugin dpdk_plugin.so { disable } + } + ${ADDITIONAL_VPP_CONFIG} + CALICOVPP_DEBUG: |- + { + "servicesEnabled": true, + "gsoEnabled": true + } + CALICOVPP_FEATURE_GATES: |- + { + "memifEnabled": true, + "vclEnabled": true, + "multinetEnabled": false, + "ipsecEnabled": false, + "prometheusEnabled": true + } + CALICOVPP_INIT_SCRIPT_TEMPLATE: "" + CALICOVPP_INITIAL_CONFIG: |- + { + "vppStartupSleepSeconds": 0, + "corePattern": "/var/lib/vpp/vppcore.%e.%p", + "defaultGWs": "", + "redirectToHostRules": [ + { + "proto": "udp", + "port": 53, + "ip": "172.18.0.1" + } + ] + } + CALICOVPP_IPSEC: |- + {} + CALICOVPP_IPSEC_IKEV2_PSK: "keykeykey" + CALICOVPP_LOG_FORMAT: pretty + CALICOVPP_LOG_LEVEL: "debug" + CALICOVPP_SRV6: |- + {} + CALICOVPP_SWAP_DRIVER: "" + DEBUG: "false" + GOCOVERDIR: /repo/.coverage/kind + SERVICE_PREFIX: 11.96.0.0/12,fd10::0/120 diff --git a/yaml/components/kube-test/daemonset-kube-test.yaml b/yaml/components/kube-test/daemonset-kube-test.yaml new file mode 100644 index 000000000..8299a6fbe --- /dev/null +++ b/yaml/components/kube-test/daemonset-kube-test.yaml @@ -0,0 +1,59 @@ +# Strategic-merge patch on top of yaml/base/calico-vpp-daemonset.yaml +# that adapts the daemonset for kube-test consumption. +# +# Layout-specific knowledge baked in here (split-image layout for <= v3.32): +# - vpp container image: calicovpp/vpp +# - agent container image: calicovpp/agent (no command override) +# - VPP build path inside repo: vpp-manager/vpp_build +# +# From v3.33 onwards, we have an unified image (calicovpp/vpp with an explicit +# command override) and a flatter repo layout (vpp_build/). When backporting +# the kube-test integration to a different layout, update only this file and +# baremetal/daemonset-baremetal.yaml; consumers stay untouched. +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: calico-vpp-node + namespace: calico-vpp-dataplane +spec: + template: + spec: + containers: + - name: vpp + image: localhost:5000/calicovpp/vpp:${CALICOVPP_VERSION} + imagePullPolicy: Always + env: + - name: LD_LIBRARY_PATH + value: /repo/vpp-manager/vpp_build/build-root/install-vpp-native/vpp/ + resources: + limits: + memory: 80Gi + requests: + cpu: 1 + memory: 4Gi + volumeMounts: + - mountPath: /repo + name: repo-directory + - mountPath: /etc/ssl/certs/ + name: ssl-certs + - mountPath: /usr/share/ca-certificates + name: share-certs + - name: agent + image: localhost:5000/calicovpp/agent:${CALICOVPP_VERSION} + imagePullPolicy: Always + env: + - name: CALICOVPP_ENABLE_MEMIF + value: ${CALICOVPP_ENABLE_MEMIF} + volumeMounts: + - mountPath: /repo + name: repo-directory + volumes: + - name: repo-directory + hostPath: + path: ${HOME}/vpp-dataplane + - name: ssl-certs + hostPath: + path: /etc/ssl/certs/ + - name: share-certs + hostPath: + path: /usr/share/ca-certificates diff --git a/yaml/components/kube-test/kind/configmap-kind.yaml b/yaml/components/kube-test/kind/configmap-kind.yaml new file mode 100644 index 000000000..6392ed444 --- /dev/null +++ b/yaml/components/kube-test/kind/configmap-kind.yaml @@ -0,0 +1,32 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + name: calico-vpp-config + namespace: calico-vpp-dataplane +data: + CALICOVPP_INTERFACES: |- + { + "defaultPodIfSpec": { + "rx": 1, + "tx": 1, + "rxqsz": 128, + "txqsz": 128, + "isl3": true, + "rxMode": "interrupt" + }, + "vppHostTapSpec": { + "rx": 1, + "tx": 1, + "rxqsz": 512, + "txqsz": 512, + "isl3": false, + "rxMode": "interrupt" + }, + "uplinkInterfaces": [ + { + "interfaceName": "eth0", + "vppDriver": "af_packet", + "rxMode": "interrupt" + } + ] + } diff --git a/yaml/components/kube-test/kind/kustomization.yaml b/yaml/components/kube-test/kind/kustomization.yaml new file mode 100644 index 000000000..d4ef57475 --- /dev/null +++ b/yaml/components/kube-test/kind/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +# KinD-flavor adjustments on top of components/kube-test: +# - uplink interface is the KinD bridge (eth0, af_packet) +# - no hugepages +patchesStrategicMerge: +- configmap-kind.yaml diff --git a/yaml/components/kube-test/kustomization.yaml b/yaml/components/kube-test/kustomization.yaml new file mode 100644 index 000000000..2aca2ba28 --- /dev/null +++ b/yaml/components/kube-test/kustomization.yaml @@ -0,0 +1,22 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +# Kube-test specific transformations applied on top of the standard +# CalicoVPP daemonset. This component is intentionally consumer-agnostic: +# it produces a manifest that VPP kube-test (or any other consumer) can +# apply after substituting only its own runtime variables. +# +# Layout-specific values (image names, in-repo paths to VPP build, etc.) +# are owned by THIS file and the base daemonset - they MUST NOT leak into +# the consumer (VPP kube-test). Runtime placeholders that remain in the +# emitted manifest are documented in yaml/components/kube-test/README.md. + +patchesStrategicMerge: +- daemonset-kube-test.yaml +- configmap-kube-test.yaml + +# Note: the tigera-operator `Installation`/`APIServer` resources are not part +# of this component because they need to embed the `${CALICO_NETWORK_CONFIG}` +# runtime placeholder, which is not a valid YAML scalar at kustomize parse +# time. They are appended by `make kube-test-template` from +# `components/kube-test/tigera-installation.snippet.yaml`. diff --git a/yaml/components/kube-test/tigera-installation.snippet.yaml b/yaml/components/kube-test/tigera-installation.snippet.yaml new file mode 100644 index 000000000..20a1fbddc --- /dev/null +++ b/yaml/components/kube-test/tigera-installation.snippet.yaml @@ -0,0 +1,29 @@ +# NOT a kustomize resource - this file embeds the `${CALICO_NETWORK_CONFIG}` +# runtime placeholder which makes it invalid YAML until `envsubst` has run. +# Appended verbatim by `make kube-test-template` after the kustomize build. +apiVersion: operator.tigera.io/v1 +kind: APIServer +metadata: + name: default +spec: {} +--- +apiVersion: operator.tigera.io/v1 +kind: Installation +metadata: + name: default +spec: + registry: localhost:5000 + calicoNetwork: + ipPools: + - cidr: 11.0.0.0/24 + encapsulation: IPIP + natOutgoing: Enabled + - cidr: fd20::/64 + encapsulation: VXLAN + natOutgoing: Enabled + linuxDataplane: VPP + nodeAddressAutodetectionV4: + interface: eth0 + nodeAddressAutodetectionV6: + interface: eth0 + ${CALICO_NETWORK_CONFIG} diff --git a/yaml/generated/calico-vpp-kubetest.yaml b/yaml/generated/calico-vpp-kubetest.yaml index 487ab2889..a0a80792d 100644 --- a/yaml/generated/calico-vpp-kubetest.yaml +++ b/yaml/generated/calico-vpp-kubetest.yaml @@ -223,13 +223,11 @@ data: } ] } - CALICOVPP_IPSEC: |- - {} - CALICOVPP_IPSEC_IKEV2_PSK: "keykeykey" + CALICOVPP_IPSEC: '{}' + CALICOVPP_IPSEC_IKEV2_PSK: keykeykey CALICOVPP_LOG_FORMAT: pretty - CALICOVPP_LOG_LEVEL: "debug" - CALICOVPP_SRV6: |- - {} + CALICOVPP_LOG_LEVEL: debug + CALICOVPP_SRV6: '{}' CALICOVPP_SWAP_DRIVER: "" DEBUG: "false" GOCOVERDIR: /repo/.coverage/kind @@ -257,6 +255,8 @@ spec: spec: containers: - env: + - name: LD_LIBRARY_PATH + value: /repo/vpp-manager/vpp_build/build-root/install-vpp-native/vpp/ - name: DATASTORE_TYPE value: kubernetes - name: WAIT_FOR_DATASTORE @@ -265,8 +265,6 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName - - name: LD_LIBRARY_PATH - value: /repo/${VPP_BUILD_REL_PATH}/build-root/install-vpp-native/vpp/ envFrom: - configMapRef: name: calico-vpp-config @@ -323,7 +321,7 @@ spec: envFrom: - configMapRef: name: calico-vpp-config - image: localhost:5000/${CALICOVPP_AGENT_IMAGE}:${CALICOVPP_VERSION} + image: localhost:5000/calicovpp/agent:${CALICOVPP_VERSION} imagePullPolicy: Always name: agent resources: @@ -377,7 +375,7 @@ spec: name: vpp-rundir - hostPath: path: /var/lib/vpp - type: DirectoryOrCreate + type: DirectoryOrCreate name: vpp-data - hostPath: path: /etc/vpp @@ -405,6 +403,9 @@ spec: maxUnavailable: 1 type: RollingUpdate --- +# NOT a kustomize resource - this file embeds the `${CALICO_NETWORK_CONFIG}` +# runtime placeholder which makes it invalid YAML until `envsubst` has run. +# Appended verbatim by `make kube-test-template` after the kustomize build. apiVersion: operator.tigera.io/v1 kind: APIServer metadata: diff --git a/yaml/overlays/kube-test-baremetal/kustomization.yaml b/yaml/overlays/kube-test-baremetal/kustomization.yaml new file mode 100644 index 000000000..193b95a76 --- /dev/null +++ b/yaml/overlays/kube-test-baremetal/kustomization.yaml @@ -0,0 +1,11 @@ +# Kube-test overlay for baremetal clusters (DPDK uplink). +# +# Consumed by `make kube-test-template FLAVOR=baremetal` and shipped +# to the VPP kube-test harness as a single fully-resolved manifest. + +resources: +- ../../base + +components: +- ../../components/kube-test +- ../../components/kube-test/baremetal diff --git a/yaml/overlays/kube-test-kind/kustomization.yaml b/yaml/overlays/kube-test-kind/kustomization.yaml new file mode 100644 index 000000000..5d8529459 --- /dev/null +++ b/yaml/overlays/kube-test-kind/kustomization.yaml @@ -0,0 +1,11 @@ +# Kube-test overlay for KinD clusters. +# +# Consumed by `make kube-test-template FLAVOR=kind` and shipped to +# the VPP kube-test harness as a single fully-resolved manifest. + +resources: +- ../../base + +components: +- ../../components/kube-test +- ../../components/kube-test/kind