1# cloud-provider/sample
2
3This directory provides sample code about how all cloud providers should leverage CCM begin at 1.20.
4
5## Purpose
6
7Begin with 1.20, all cloud providers should not copy over or vendor in `k8s.io/kubernetes/cmd/cloud-controller-manager`. Inside this directory, some sample code will be provided to demonstrate how cloud providers should leverage cloud-controller-manager.
8
9## Steps cloud providers should follow
10
111. Have your external repo under k8s.io. e.g. `k8s.io/cloud-provider-<provider>`
122. Create `main.go` file under your external repo CCM directory. Please refer to `basic_main.go` for a minimum working sample.
13Note: If you have a requirement of adding/deleting controllers within CCM, please refer to `k8s.io/kubernetes/cmd/cloud-controller-manager/main.go` for extra details.
143. Build/release CCM from your external repo. For existing cloud providers, the option to import legacy providers from `k8s.io/legacy-cloud-provider/<provider>` is still available.
15
16## Things you should NOT do
17
18 1. Vendor in `k8s.io/cmd/cloud-controller-manager`.
19 2. Directly modify anything under `vendor/k8s.io/cloud-provider/sample` in this repo. Those are driven from `k8s.io/kubernetes/staging/src/k8s.io/cloud-provider/sample`.
20 3. Make specific cloud provider changes in sample files.
21