@@ -10,8 +10,7 @@ For users running `0.2.5` or above, the default network plugin is `cni`. Kuberne
10
10
other network plumbing from upstream as part of the ` dockershim ` removal/deprecation. In order for a cluster to become
11
11
operational, Calico, Flannel, Weave, or another CNI should be used.
12
12
13
- For CI workflows, basic functionality can be provided via [ ` containernetworking/plugins ` ] (
14
- https://github.com/containernetworking/plugins ).
13
+ For CI workflows, basic functionality can be provided via [ ` containernetworking/plugins ` ] ( https://github.com/containernetworking/plugins ) .
15
14
16
15
## Motivation
17
16
@@ -29,54 +28,92 @@ tool in [Don't Panic: Kubernetes and Docker](https://blog.k8s.io/2020/12/02/dont
29
28
and on the Mirantis
30
29
[ blog] ( https://www.mirantis.com/blog/mirantis-to-take-over-support-of-kubernetes-dockershim-2/ ) .
31
30
32
- ## Build and install
31
+ ## Using cri-dockerd
33
32
34
- To begin following the build process for this code, clone this repository in your local environment:
33
+ ### Install
35
34
36
- ``` shell
37
- git clone https://github.com/Mirantis/cri-dockerd.git
38
- ```
39
-
40
- The above step creates a local directory called ``` cri-dockerd ``` which you will need for the following steps.
41
-
42
- To build this code (in a POSIX environment):
43
-
44
- < https://go.dev/doc/install >
45
-
46
- ``` shell
47
- cd cri-dockerd
48
- make cri-dockerd
49
- ```
35
+ The easiest way to install ` cri-dockerd ` is to use one of the pre-built binaries or
36
+ packages from the [ releases page] ( https://github.com/Mirantis/cri-dockerd/releases ) .
37
+ There are numerous supported platforms and using a pre-built package will install
38
+ the binary and setup your system to run it as a service.
50
39
51
- To build for a specific architecture, add ` ARCH= ` as an argument, where ` ARCH ` is a known build target for golang
40
+ Please refer to your platform's documentation for how to install a package for
41
+ additional help with these.
52
42
53
- You can find pre-compiled binaries and deb/rpm packages under:
43
+ ## Advanced Setup
54
44
55
- < https://github.com/Mirantis/cri-dockerd/releases >
45
+ ### Installing manually
56
46
57
- Where ` VERSION ` is the latest available cri-dockerd version:
47
+ > Note: the release packages will install to /usr/bin which is reserved for
48
+ > binaries managed by a package manager. Manual installation doesn't involve a
49
+ > package manager and thus uses /usr/local/bin and the service file must be edited
50
+ > to reflect this.
58
51
59
- ` https://github.com/Mirantis/cri-dockerd/releases/download/v${VERSION}/cri-dockerd-${VERSION}.${ARCH}.tgz `
60
-
61
- To install, on a Linux system that uses systemd, and already has Docker Engine installed
52
+ If you would like to install the project manually, you will need to place the binary
53
+ somewhere in your ` PATH ` and setup a service to run it. The following command is
54
+ a manual install for a Linux system using systemd:
62
55
63
56
``` shell
64
- # Run these commands as root
65
-
66
- cd cri-dockerd
67
- mkdir -p /usr/local/bin
68
57
install -o root -g root -m 0755 cri-dockerd /usr/local/bin/cri-dockerd
69
58
install packaging/systemd/* /etc/systemd/system
70
59
sed -i -e ' s,/usr/bin/cri-dockerd,/usr/local/bin/cri-dockerd,' /etc/systemd/system/cri-docker.service
71
60
systemctl daemon-reload
72
- systemctl enable cri-docker.service
73
61
systemctl enable --now cri-docker.socket
74
62
```
75
63
76
- ## To use with Kubernetes
64
+ ### To use with Kubernetes
77
65
78
66
The default network plugin for ` cri-dockerd ` is set to ` cni ` on Linux. To change this, ` --network-plugin=${plugin} `
79
67
can be passed in as a command line argument if invoked manually, or the systemd unit file
80
68
(` /usr/lib/systemd/system/cri-docker.service ` if not enabled yet,
81
69
or ` /etc/systemd/system/multi-user.target.wants/cri-docker.service ` as a symlink if it is enabled) should be
82
70
edited to add this argument, followed by ` systemctl daemon-reload ` and restarting the service (if running)
71
+
72
+ ## Development
73
+
74
+ ### Building
75
+
76
+ If you would like to build the project yourself, you will need to have Go installed.
77
+ You can find directions for installing the latest version on its website:
78
+
79
+ [ Install the latest version of Go] ( https://golang.org/doc/install )
80
+
81
+ Once you have Go installed, you can build the project by running the following command:
82
+
83
+ ``` shell
84
+ make cri-dockerd
85
+ ```
86
+
87
+ This will output the binary to the project's root directory as ` cri-dockerd ` .
88
+ You can then run it directly or install it using the manual process above.
89
+
90
+ To build for a specific architecture, add ` ARCH= ` as an argument, where ` ARCH `
91
+ is a known build target for Go.
92
+
93
+ ### Development Setup
94
+
95
+ When developing, it is nice to have a separate environment to test in so that
96
+ you don't have to worry about breaking your system. An easy way to do this is
97
+ by setting up a minikube cluster since it uses ` cri-dockerd ` by default. You can
98
+ grab the latest version from their repo's releases page:
99
+
100
+ > You must grab the latest release from their release's page. The version
101
+ > installed by their [ Getting Started] ( https://minikube.sigs.k8s.io/docs/start/ )
102
+ > page is not compatible with the latest version of ` cri-dockerd ` .
103
+
104
+ [ Install the latest version of minikube] ( https://github.com/kubernetes/minikube/releases )
105
+
106
+ You'll then be able to create a cluster in minikube's VM by running:
107
+
108
+ ``` shell
109
+ minikube start
110
+ ```
111
+
112
+ Once the cluster is up, we have a ` make ` command that will build ` cri-dockerd `
113
+ and swap it out for the version running in the cluster. You can run this command
114
+ by running:
115
+
116
+ ``` shell
117
+ make dev
118
+ ```
119
+
0 commit comments