manifests,pkg/encapsulation: Flannel compatibility
This commit adds basic support to run in compatibility mode with Flannel. This allows clusters running Flannel as their principal networking solution to leverage some advances Kilo features. In certain Flannel setups, the clusters can even leverage muti-cloud. For this, the cluster needs to either run in a full mesh, or Flannel needs to use the API server's external IP address.
This commit is contained in:
@@ -54,6 +54,9 @@ var (
|
||||
availableBackends = strings.Join([]string{
|
||||
k8s.Backend,
|
||||
}, ", ")
|
||||
availableCompatibilities = strings.Join([]string{
|
||||
"flannel",
|
||||
}, ", ")
|
||||
availableEncapsulations = strings.Join([]string{
|
||||
string(encapsulation.Never),
|
||||
string(encapsulation.CrossSubnet),
|
||||
@@ -78,6 +81,7 @@ func Main() error {
|
||||
backend := flag.String("backend", k8s.Backend, fmt.Sprintf("The backend for the mesh. Possible values: %s", availableBackends))
|
||||
cni := flag.Bool("cni", true, "Should Kilo manage the node's CNI configuration.")
|
||||
cniPath := flag.String("cni-path", mesh.DefaultCNIPath, "Path to CNI config.")
|
||||
compatibility := flag.String("compatibility", "", fmt.Sprintf("Should Kilo run in compatibility mode? Possible values: %s", availableCompatibilities))
|
||||
encapsulate := flag.String("encapsulate", string(encapsulation.Always), fmt.Sprintf("When should Kilo encapsulate packets within a location. Possible values: %s", availableEncapsulations))
|
||||
granularity := flag.String("mesh-granularity", string(mesh.LogicalGranularity), fmt.Sprintf("The granularity of the network mesh to create. Possible values: %s", availableGranularities))
|
||||
kubeconfig := flag.String("kubeconfig", "", "Path to kubeconfig.")
|
||||
@@ -130,7 +134,6 @@ func Main() error {
|
||||
logger = log.With(logger, "ts", log.DefaultTimestampUTC)
|
||||
logger = log.With(logger, "caller", log.DefaultCaller)
|
||||
|
||||
var enc encapsulation.Interface
|
||||
e := encapsulation.Strategy(*encapsulate)
|
||||
switch e {
|
||||
case encapsulation.Never:
|
||||
@@ -139,7 +142,14 @@ func Main() error {
|
||||
default:
|
||||
return fmt.Errorf("encapsulation %v unknown; possible values are: %s", *encapsulate, availableEncapsulations)
|
||||
}
|
||||
enc = encapsulation.NewIPIP(e)
|
||||
|
||||
var enc encapsulation.Encapsulator
|
||||
switch *compatibility {
|
||||
case "flannel":
|
||||
enc = encapsulation.NewFlannel(e)
|
||||
default:
|
||||
enc = encapsulation.NewIPIP(e)
|
||||
}
|
||||
|
||||
gr := mesh.Granularity(*granularity)
|
||||
switch gr {
|
||||
|
Reference in New Issue
Block a user