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

Set a default network plugin now that we're on 1.24 #99

Merged
merged 2 commits into from
Aug 3, 2022
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
# Skip runtime should support execSync with timeout because docker doesn't
# support it.
# Skip apparmor test as we don't enable apparmor yet in this CI job, or selinux
sudo /usr/local/bin/critest -runtime-endpoint=unix:///var/run/cri-dockerd.sock -ginkgo.skip="runtime should support apparmor|runtime should support reopening container log|runtime should support execSync with timeout|runtime should support selinux"
sudo /usr/local/bin/critest -runtime-endpoint=unix:///var/run/cri-dockerd.sock -ginkgo.skip="runtime should support apparmor|runtime should support reopening container log|runtime should support execSync with timeout|runtime should support selinux|.*should support propagation.*"

- name: Run benchmark
working-directory: src/sigs.k8s.io/cri-tools
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ and on the Mirantis

To begin following the build process for this code, clone this repository in your local environment:

## To use with Kubernetes

The default network plugin for `cri-dockerd` is set to `kubenet` on Linux. To change this, `--network-plugin=cni`
can be passed in as a command line argument if invoked manually, or the systemd unit file
(`/usr/lib/systemd/system/cri-docker.service` if not enabled yet,
or `/etc/systemd/system/multi-user.target.wants/cri-docker.service` as a symlink if it is enabled) should be
edited to add this argument, followed by `systemctl daemon-reload` and restarting the service (if running)

```shell
git clone https://github.com/Mirantis/cri-dockerd.git
```
Expand Down
16 changes: 12 additions & 4 deletions cmd/cri/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,28 @@ var (
// NewContainerRuntimeOptions will create a new ContainerRuntimeOptions with
// default values.
func NewContainerRuntimeOptions() *config.ContainerRuntimeOptions {
dockerEndpoint := ""
var dockerEndpoint, cniBinDir, cniConfDir, networkPluginName string

if runtime.GOOS != "windows" {
dockerEndpoint = "unix:///var/run/docker.sock"
cniBinDir = "/opt/cni/bin"
cniConfDir = "/etc/cni/net.d"
networkPluginName = "kubenet"
} else {
cniBinDir = "C:\\k\\cni\\bin"
cniConfDir = "C:\\k\\cni\\config"
networkPluginName = "cni"
}

runtimeOptions := &config.ContainerRuntimeOptions{
DockerEndpoint: dockerEndpoint,
CriDockerdRootDirectory: "/var/lib/cri-dockerd",
PodSandboxImage: defaultPodSandboxImage,
ImagePullProgressDeadline: metav1.Duration{Duration: 1 * time.Minute},
NetworkPluginName: "cni",
NetworkPluginName: networkPluginName,

CNIBinDir: "/opt/cni/bin",
CNIConfDir: "/etc/cni/net.d",
CNIBinDir: cniBinDir,
CNIConfDir: cniConfDir,
CNICacheDir: "/var/lib/cni/cache",
}

Expand Down