Update site to describe new addon creation workflow.

pull/11671/head
Andriy Dzikh 2021-06-16 09:14:09 -07:00
parent 02b996e011
commit 1bac30bbe7
1 changed files with 15 additions and 6 deletions

View File

@ -47,24 +47,32 @@ To make the addon appear in `minikube addons list`, add it to `pkg/addons/config
},
```
Next, add all required files using `//go:embed` directives to a new embed.FS variable in `deploy/addons/assets.go`. Here is the entry used by the `csi-hostpath-driver` addon:
```go
// CsiHostpathDriverAssets assets for csi-hostpath-driver addon
//go:embed csi-hostpath-driver/deploy/*.tmpl csi-hostpath-driver/rbac/*.tmpl
CsiHostpathDriverAssets embed.FS
```
Then, add into `pkg/minikube/assets/addons.go` the list of files to copy into the cluster, including manifests. Here is the entry used by the `registry` addon:
```go
"registry": NewAddon([]*BinAsset{
MustBinAsset(
"deploy/addons/registry/registry-rc.yaml.tmpl",
MustBinAsset(addons.RegistryAssets,
"registry/registry-rc.yaml.tmpl",
vmpath.GuestAddonsDir,
"registry-rc.yaml",
"0640",
false),
MustBinAsset(
"deploy/addons/registry/registry-svc.yaml.tmpl",
MustBinAsset(addons.RegistryAssets,
"registry/registry-svc.yaml.tmpl",
vmpath.GuestAddonsDir,
"registry-svc.yaml",
"0640",
false),
MustBinAsset(
"deploy/addons/registry/registry-proxy.yaml.tmpl",
MustBinAsset(addons.RegistryAssets,
"registry/registry-proxy.yaml.tmpl",
vmpath.GuestAddonsDir,
"registry-proxy.yaml",
"0640",
@ -74,6 +82,7 @@ Then, add into `pkg/minikube/assets/addons.go` the list of files to copy into th
The `MustBinAsset` arguments are:
* asset variable (typically present in `deploy/addons/assets.go`)
* source filename
* destination directory (typically `vmpath.GuestAddonsDir`)
* destination filename