Skip to content

Commit

Permalink
Merge pull request #9046 from tstromberg/cni-true
Browse files Browse the repository at this point in the history
Allow flannel CNI to work with kicbase by fixing IP conflict
  • Loading branch information
tstromberg committed Aug 21, 2020
2 parents ba96f29 + c052d1a commit f492215
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/minikube/cni/flannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ package cni

import (
"os/exec"
"path/filepath"

"github.com/golang/glog"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/driver"
)

// From https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
Expand Down Expand Up @@ -646,6 +649,14 @@ func (c Flannel) Apply(r Runner) error {
return errors.Wrap(err, "required 'portmap' CNI plug-in not found")
}

if driver.IsKIC(c.cc.Driver) {
conflict := "/etc/cni/net.d/100-crio-bridge.conf"
_, err := r.RunCmd(exec.Command("sudo", "mv", conflict, filepath.Join(filepath.Dir(conflict), "DISABLED-"+filepath.Base(conflict))))
if err != nil {
glog.Errorf("unable to disable %s: %v", conflict, err)
}
}

return applyManifest(c.cc, r, manifestAsset([]byte(flannelTmpl)))
}

Expand Down

0 comments on commit f492215

Please sign in to comment.