Skip to content

Commit 098ffd6

Browse files
doc: update documentation for v2 release
1 parent 7f83b4f commit 098ffd6

File tree

10 files changed

+174
-963
lines changed

10 files changed

+174
-963
lines changed

README.md

Lines changed: 15 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -1,164 +1,27 @@
11
# CSI Proxy
22

3-
CSI Proxy (which might be more aptly named "csi-node-proxy") is a binary that exposes a set of gRPC APIs (over named pipes) around local storage operations for nodes in Windows. A container, such as CSI node plugins, can mount the named pipes depending on operations it wants to exercise on the host and
4-
invoke the APIs. This allows a storage plugin to run as if were a CSI plugin on linux which have the ability to perform "privileged" actions on the windows host OS.
3+
CSI Proxy is a Go library providing convenience methods to execute privileged storage operations in Windows, such as formatting and mounting volumes.
4+
A container, such as CSI node plugins, can import the CSI Proxy library to get a Go interface for storage-related Windows system calls.
5+
Since the commands executed are privileged instructions, containers must run as [HostProcess containers](https://kubernetes.io/docs/tasks/configure-pod-container/create-hostprocess-pod/).
56

6-
![CSI Proxy High Level Architecture Diagram](./docs/csi-proxy-high-level-arch.png)
7+
Closely related functionalities are bundled as API groups that target specific areas of storage. The available API groups are
78

8-
In the above diagram, there are 3 communication channels being utilized for CSI proxy:
9-
10-
- `csi.sock` : This usually lives at c:/var/lib/kubelet/plugins/csi-plugin/csi.sock, and is used for the host OS to communicate with the CSI node plugin
11-
- `csi-plugin-reg.sock` : This lives here, c:/var/lib/kubelet/plugins_registry/csi-plugin-reg.sock, and is used for the kubelet itself to get metadata as needed from the csi plugin .
12-
- `\\.\pipe\csi-proxy` : This will live in a pipe, i.e. at \\.\pipe/csi-proxy-api-group-v-... : upon receipt of specific requests from the Node plugin, it carries out actions on the node plugins behalf. Since it doesn't execute arbitrary commands on the host, its more secure then simply being a black-box proxy to run host commands.
13-
14-
Each named pipe will support a specific version of an API (e.g. v1alpha1, v1beta1, v1beta2, v1)
15-
that targets a specific area of storage (e.g. disk, volume, file, SMB, iSCSI).
16-
17-
## Overview
18-
19-
CSI drivers are recommended to be deployed as containers. Node plugin containers need to run with privileges to perform storage related operations. However, Windows does not support privileged containers currently. With CSIProxy, the node plugins can now be deployed as unprivileged pods that use the proxy to perform privileged storage operations on the node. Kubernetes administrators will need to install and maintain csi-proxy.exe on all Windows nodes in a manner similar to kubelet.exe.
9+
- Disk
10+
- Filesystem
11+
- SMB
12+
- Volume
13+
- iSCSI (experimental)
14+
- System (experimental)
2015

2116
## Compatibility
2217

23-
Recommended K8s Version: 1.18
24-
25-
## Feature status
26-
27-
CSI Proxy is in a stable status ([GA Blogpost](https://kubernetes.io/blog/2021/08/09/csi-windows-support-with-csi-proxy-reaches-ga/)), the latest versions of the API Groups are:
28-
29-
| API Group | Latest Version | API Docs |
30-
| --- | --- | --- |
31-
| Disk | v1 | [link](./docs/apis/disk_v1.md) |
32-
| Filesystem | v1 | [link](./docs/apis/filesystem_v1.md) |
33-
| SMB | v1 | [link](./docs/apis/smb_v1.md) |
34-
| Volume | v1 | [link](./docs/apis/volume_v1.md) |
35-
| iSCSI | v1alpha2 | [link to proto](./client/api/iscsi/v1alpha2/api.proto) |
36-
| System | v1alpha1 | [link to proto](./client/api/system/v1alpha1/api.proto) |
37-
38-
## Build
39-
40-
`csi-proxy.exe` binary has not published yet. You need to clone the repo and build it. The easiest way to build this binary is using the makefile in this repo.
41-
42-
```
43-
git clone https://github.com/kubernetes-csi/csi-proxy
44-
sudo make build
45-
```
46-
47-
On successful execution of `make build`, the output binary `csi-proxy.exe` will be available under `/bin` directory.
48-
49-
## Installation
50-
51-
csi-proxy.exe can be installed and run as binary or run as a Windows service on each Windows node. See the following as an example to run CSI Proxy as a web service.
52-
```
53-
$flags = "-windows-service -log_file=C:\etc\kubernetes\logs\csi-proxy.log -logtostderr=false"
54-
sc.exe create csiproxy start= "auto" binPath= "C:\etc\kubernetes\node\bin\csi-proxy.exe $flags"
55-
sc.exe failure csiproxy reset= 0 actions= restart/10000
56-
sc.exe start csiproxy
57-
```
58-
If you are using kube-up to start a Windows cluster, node startup script will automatically run csi-proxy as a service. For GKE 1.18+, csi-proxy will be installed automatically.
18+
Recommended K8s Version: 1.23
5919

6020
## Usage
6121

62-
### Command line options
63-
64-
* `--kubelet-path`: This is the prefix path of the kubelet path directory in the host file system (`C:\var\lib\kubelet` is used by default).
65-
* `--working-dir` (repeated flag): Prefix path where CSI Proxy is allowed to make privileged operations in the host file system (no value by default).
66-
67-
### Setup for CSI Driver Deployment
68-
69-
Deploy and start csiproxy.exe on all Windows hosts in the cluster. Next, the named
70-
pipes can be mounted in a CSI node plugin DaemonSet YAML in the following manner:
71-
72-
```
73-
kind: DaemonSet
74-
apiVersion: apps/v1
75-
metadata:
76-
name: csi-storage-node-win
77-
spec:
78-
selector:
79-
matchLabels:
80-
app: csi-driver-win
81-
template:
82-
metadata:
83-
labels:
84-
app: csi-driver-win
85-
spec:
86-
serviceAccountName: csi-node-sa
87-
tolerations:
88-
- key: "node.kubernetes.io/os"
89-
operator: "Equal"
90-
value: "win1809"
91-
effect: "NoSchedule"
92-
nodeSelector:
93-
kubernetes.io/os: windows
94-
containers:
95-
- name: csi-driver-registrar
96-
image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.1.0
97-
args:
98-
- "--v=5"
99-
- "--csi-address=unix://C:\\csi\\csi.sock"
100-
- "--kubelet-registration-path=C:\\var\\lib\\kubelet\\plugins\\pd.csi.storage.gke.io\\csi.sock"
101-
env:
102-
- name: KUBE_NODE_NAME
103-
valueFrom:
104-
fieldRef:
105-
fieldPath: spec.nodeName
106-
volumeMounts:
107-
- name: plugin-dir
108-
mountPath: C:\csi
109-
- name: registration-dir
110-
mountPath: C:\registration
111-
- name: csi-driver
112-
# placeholder, use your CSI driver
113-
image: org/csi-driver:win-v1
114-
args:
115-
- "--v=5"
116-
- "--endpoint=unix:/csi/csi.sock"
117-
volumeMounts:
118-
- name: kubelet-dir
119-
mountPath: C:\var\lib\kubelet
120-
- name: plugin-dir
121-
mountPath: C:\csi
122-
- name: csi-proxy-disk-pipe
123-
mountPath: \\.\pipe\csi-proxy-disk-v1
124-
- name: csi-proxy-volume-pipe
125-
mountPath: \\.\pipe\csi-proxy-volume-v1
126-
- name: csi-proxy-filesystem-pipe
127-
mountPath: \\.\pipe\csi-proxy-filesystem-v1
128-
- name: csi-proxy-smb-pipe
129-
mountPath: \\.\pipe\csi-proxy-smb-v1
130-
volumes:
131-
- name: csi-proxy-disk-pipe
132-
hostPath:
133-
path: \\.\pipe\csi-proxy-disk-v1
134-
type: ""
135-
- name: csi-proxy-volume-pipe
136-
hostPath:
137-
path: \\.\pipe\csi-proxy-volume-v1
138-
type: ""
139-
- name: csi-proxy-filesystem-pipe
140-
hostPath:
141-
path: \\.\pipe\csi-proxy-filesystem-v1
142-
type: ""
143-
- name: csi-proxy-smb-pipe
144-
hostPath:
145-
path: \\.\pipe\csi-proxy-smb-v1
146-
type: ""
147-
- name: registration-dir
148-
hostPath:
149-
path: C:\var\lib\kubelet\plugins_registry\
150-
type: Directory
151-
- name: kubelet-dir
152-
hostPath:
153-
path: C:\var\lib\kubelet\
154-
type: Directory
155-
- name: plugin-dir
156-
hostPath:
157-
path: C:\var\lib\kubelet\plugins\csi.org.io\
158-
type: DirectoryOrCreate
159-
```
160-
161-
## Community, discussion, contribution, and support
22+
See [usage.md](/docs/API.md) for detailed usage instructions, as well as some notes on migrating from v1.
23+
24+
## Community, Discussion, Contribution, and Support
16225

16326
Check out [development.md](./docs/DEVELOPMENT.md) for instructions to set up a development environment to run CSI Proxy.
16427

@@ -179,7 +42,7 @@ You can reach the maintainers of this project at:
17942

18043
- [Google Compute Engine Persistent Disk CSI Driver](https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver)
18144

182-
### Code of conduct
45+
### Code of Conduct
18346

18447
Participation in the Kubernetes community is governed by the [Kubernetes Code of Conduct](code-of-conduct.md).
18548

0 commit comments

Comments
 (0)