diff --git a/Makefile b/Makefile index dd40391..06ca89c 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ CRD_OPTIONS ?= "crd:trivialVersions=true" TOOLBINDIR := tools/bin +API_REF_GEN_VERSION = v0.3.0 CONTROLLER_GEN_VERSION = v0.3.0 # linting @@ -29,7 +30,7 @@ DOCKER_PROXY_FLAGS += --build-arg NO_PROXY=$(NO_PROXY) all: manager # Run tests -test: generate fmt vet manifests lint +test: generate fmt vet manifests lint api-docs go test ./... -coverprofile cover.out # Build manager binary @@ -85,6 +86,26 @@ docker-push-controller: docker-push-nodelabeler: docker push ${NODE_LABELER_IMG} +# Generate API reference documentation +api-docs: gen-crd-api-reference-docs + $(API_REF_GEN) -api-dir=./pkg/api/v1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/vino.md + +API_REF_GEN=$(GOBIN)/gen-crd-api-reference-docs + +# Find or download gen-crd-api-reference-docs +gen-crd-api-reference-docs: + @{ \ + if ! which $(API_REF_GEN);\ + then\ + set -e ;\ + API_REF_GEN_TMP_DIR=$$(mktemp -d) ;\ + cd $$API_REF_GEN_TMP_DIR ;\ + go mod init tmp ;\ + go get github.com/ahmetb/gen-crd-api-reference-docs@$(API_REF_GEN_VERSION) ;\ + rm -rf $$API_REF_GEN_TMP_DIR ;\ + fi;\ + } + CONTROLLER_GEN:=$(GOBIN)/controller-gen # find or download controller-gen diff --git a/docs/api/vino.md b/docs/api/vino.md new file mode 100644 index 0000000..2c674de --- /dev/null +++ b/docs/api/vino.md @@ -0,0 +1,870 @@ +
Packages:
+Package v1 contains API Schema definitions for the airship v1 API group
+Resource Types: ++(Appears on: +VinoSpec) +
+CPUConfiguration CPU node configuration
+| Field | +Description | +
|---|---|
+cpuExclude+ +string + + |
+
+ Exclude CPU example 0-4,54-60 + |
+
+(Appears on: +VinoSpec) +
+DaemonSetOptions be used to spawn vino-builder, libvirt, sushy an
+| Field | +Description | +
|---|---|
+namespacedName+ + +NamespacedName + + + |
++ | +
+libvirtImage+ +string + + |
++ | +
+sushyImage+ +string + + |
++ | +
+vinoBuilderImage+ +string + + |
++ | +
+nodeAnnotatorImage+ +string + + |
++ | +
+(Appears on: +NodeSet) +
+DiskDrivesTemplate defines disks on the VM
+| Field | +Description | +
|---|---|
+name+ +string + + |
++ | +
+type+ +string + + |
++ | +
+path+ +string + + |
++ | +
+options+ + +DiskOptions + + + |
++ | +
+(Appears on: +DiskDrivesTemplate) +
+DiskOptions disk options
+| Field | +Description | +
|---|---|
+sizeGb+ +int + + |
++ | +
+sparse+ +bool + + |
++ | +
+(Appears on: +DaemonSetOptions, +NodeSet) +
+NamespacedName to be used to spawn VMs
+| Field | +Description | +
|---|---|
+name+ +string + + |
++ | +
+namespace+ +string + + |
++ | +
+(Appears on: +VinoSpec) +
+Network defines libvirt networks
+| Field | +Description | +
|---|---|
+name+ +string + + |
+
+ Network Parameter defined + |
+
+subnet+ +string + + |
++ | +
+allocationStart+ +string + + |
++ | +
+allocationStop+ +string + + |
++ | +
+dns_servers+ +[]string + + |
++ | +
+routes+ + +VMRoutes + + + |
++ | +
+(Appears on: +NodeSet) +
+NetworkInterface define interface on the VM
+| Field | +Description | +
|---|---|
+name+ +string + + |
+
+ Define parameter for network interfaces + |
+
+type+ +string + + |
++ | +
+network+ +string + + |
++ | +
+mtu+ +int + + |
++ | +
+options+ +map[string]string + + |
++ | +
+(Appears on: +VinoSpec) +
+NodeSelector identifies nodes to create VMs on
+| Field | +Description | +
|---|---|
+matchLabels+ +map[string]string + + |
+
+ Node type needs to specified + |
+
+(Appears on: +VinoSpec) +
+NodeSet node definitions
+| Field | +Description | +
|---|---|
+name+ +string + + |
+
+ Parameter for Node master or worker-standard + |
+
+count+ +int + + |
++ | +
+labels+ + +VMNodeFlavor + + + |
++ | +
+libvirtTemplate+ + +NamespacedName + + + |
++ | +
+networkInterfaces+ + +NetworkInterface + + + |
++ | +
+diskDrives+ + +DiskDrivesTemplate + + + |
++ | +
+(Appears on: +NodeSet) +
+VMNodeFlavor labels for node to be annotated
+| Field | +Description | +
|---|---|
+vmFlavor+ +map[string]string + + |
++ | +
+(Appears on: +Network) +
+VMRoutes defined
+| Field | +Description | +
|---|---|
+to+ +string + + |
++ | +
+via+ +string + + |
++ | +
Vino is the Schema for the vinoes API
+| Field | +Description | +||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
+metadata+ + +Kubernetes meta/v1.ObjectMeta + + + |
+
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+||||||||||
+spec+ + +VinoSpec + + + |
+
+ + +
|
+||||||||||
+status+ + +VinoStatus + + + |
++ | +
+(Appears on: +Vino) +
+VinoSpec defines the desired state of Vino
+| Field | +Description | +
|---|---|
+nodeSelector+ + +NodeSelector + + + |
+
+ Define nodelabel parameters + |
+
+configuration+ + +CPUConfiguration + + + |
+
+ Define CPU configuration + |
+
+networks+ + +Network + + + |
+
+ Define network parameters + |
+
+nodes+ + +[]NodeSet + + + |
+
+ Define node details + |
+
+daemonSetOptions+ + +DaemonSetOptions + + + |
+
+ DaemonSetOptions defines how vino will spawn daemonset on nodes + |
+
+(Appears on: +Vino) +
+VinoStatus defines the observed state of Vino
+| Field | +Description | +
|---|---|
+configMapRef+ + +Kubernetes core/v1.ObjectReference + + + |
++ | +
+conditions+ + +[]Kubernetes meta/v1.Condition + + + |
++ | +
This page was automatically generated with gen-crd-api-reference-docs
{{ fieldName . }}
+ (Members of {{ fieldName . }} are embedded into this type.)
+
metadata field.
+ {{ end }}
+
+ {{ if or (eq (fieldName .) "spec") }}
+ Packages:
+This page was automatically generated with gen-crd-api-reference-docs
{{.Underlying}} alias){{ end -}}
+ + (Appears on: + {{- $prev := "" -}} + {{- range . -}} + {{- if $prev -}}, {{ end -}} + {{ $prev = . }} + {{ typeDisplayName . }} + {{- end -}} + ) +
+ {{ end }} + + {{ with .CommentLines }} + {{ safe (renderComments .) }} + {{ end }} + + {{ if .Members }} +| Field | +Description | +
|---|---|
+ apiVersion+ string |
+
+ {{ apiGroup . }}
+ |
+
+ kind+ string + |
+
+ {{ .Name.Name }}
+ |
+