diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1075d04 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +API_DOCS ?= $(CURDIR)/bin/gen-crd-api-reference-docs +BRANCH ?= $(shell git tag --sort=-version:refname | grep -v '^manager/' | grep -v '^helm/' | head -1) + +.PHONY: gen-api-docs +gen-api-docs: $(API_DOCS) + @TEMPDIR=$$(mktemp -d) && \ + trap 'rm -rf "$$TEMPDIR"' EXIT && \ + echo "Extracting Go types from $(BRANCH)..." && \ + git archive $(BRANCH) -- api/ go.mod go.sum | tar -x -C "$$TEMPDIR" && \ + if [ ! -f "$$TEMPDIR/api/v1alpha1/doc.go" ]; then \ + git show main:api/v1alpha1/doc.go > "$$TEMPDIR/api/v1alpha1/doc.go"; \ + fi && \ + echo "Downloading dependencies..." && \ + cd "$$TEMPDIR" && \ + go mod download && \ + echo "Generating API reference..." && \ + $(API_DOCS) \ + -config $(CURDIR)/hack/api-reference/config.json \ + -template-dir $(CURDIR)/hack/api-reference/template \ + -api-dir ./api/v1alpha1 \ + -out-file $(CURDIR)/includes/api-reference.html && \ + echo "Done: $(CURDIR)/includes/api-reference.html" + +$(API_DOCS): + GOBIN=$(CURDIR)/bin go install github.com/ahmetb/gen-crd-api-reference-docs@latest diff --git a/content/en/docs/reference/_index.md b/content/en/docs/reference/_index.md new file mode 100644 index 0000000..ea2b46e --- /dev/null +++ b/content/en/docs/reference/_index.md @@ -0,0 +1,10 @@ +--- +title: "Reference" +linkTitle: "Reference" +weight: 99 +type: "docs" +description: > + API reference +--- + +{{% include "includes/api-reference.html" %}} diff --git a/hack/api-reference/config.json b/hack/api-reference/config.json new file mode 100644 index 0000000..9b853bd --- /dev/null +++ b/hack/api-reference/config.json @@ -0,0 +1,20 @@ +{ + "hideMemberFields": [ + "TypeMeta" + ], + "hideTypePatterns": [ + "ParseError$", + "List$" + ], + "externalPackages": [ + { + "typeMatchPrefix": "^k8s\\.io/(api|apimachinery/pkg/apis)/", + "docsURLTemplate": "https://pkg.go.dev/{{.PackagePath}}#{{.TypeIdentifier}}" + } + ], + "typeDisplayNamePrefixOverrides": { + "k8s.io/api/": "Kubernetes ", + "k8s.io/apimachinery/pkg/apis/": "Kubernetes " + }, + "markdownDisabled": false +} diff --git a/hack/api-reference/template/members.tpl b/hack/api-reference/template/members.tpl new file mode 100644 index 0000000..a529c67 --- /dev/null +++ b/hack/api-reference/template/members.tpl @@ -0,0 +1,48 @@ +{{ define "members" }} + +{{ range .Members }} +{{ if not (hiddenMember .)}} +
{{ fieldName . }}
+ (Members of {{ fieldName . }} are embedded into this type.)
+
metadata field.
+ {{ end }}
+
+ {{ if or (eq (fieldName .) "spec") }}
+ Packages:
+
+ Generated with gen-crd-api-reference-docs
+ {{ with .gitCommit }} on git commit {{ . }}{{end}}.
+
{{.Underlying}} alias){{ end -}}
++ (Appears on: + {{- $prev := "" -}} + {{- range . -}} + {{- if $prev -}}, {{ end -}} + {{- $prev = . -}} + {{ typeDisplayName . }} + {{- end -}} + ) +
+{{ end }} + +| Value | +Description | +
|---|---|
{{ typeDisplayName . }} |
+ {{ safe (renderComments .CommentLines) }} | +
| Field | +Description | +
|---|---|
+ apiVersion+ string |
+
+
+ {{apiGroup .}}
+
+ |
+
+ kind+ string + |
+ {{.Name.Name}} |
+
Packages:
+ +Package v1alpha1 contains API Schema definitions for the operator v1alpha1 API group
+CAPOperator is the Schema for the CAPOperators API
+| Field | +Description | +||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+metadata+ + +Kubernetes meta/v1.ObjectMeta + + + |
+
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+||||||||||||
+spec+ + +CAPOperatorSpec + + + |
+
+ + +
|
+||||||||||||
+status+ + +CAPOperatorStatus + + + |
++ | +
+(Appears on: CAPOperator) +
+CAPOperatorSpec defines the desired state of CAPOperator
+| Field | +Description | +
|---|---|
+subscriptionServer+ + +SubscriptionServer + + + |
+
+ SubscriptionServer specification + |
+
+dnsTarget+ +string + + |
+
+ Public ingress URL for the cluster Load Balancer + |
+
+ingressGatewayLabels+ + +[]NameValue + + + |
+
+ Labels used to identify the istio ingress-gateway component and its corresponding namespace. Usually {“app”:“istio-ingressgateway”,“istio”:“ingressgateway”} + |
+
+controller+ + +Controller + + + |
+
+ Controller specification + |
+
+monitoring+ + +Monitoring + + + |
+
+ Monitoring specification + |
+
+webhook+ + +Webhook + + + |
+
+ Webhook specification + |
+
+(Appears on: CAPOperator) +
+| Field | +Description | +
|---|---|
+Status+ +github.com/sap/component-operator-runtime/pkg/component.Status + + |
+
+
+(Members of add other fields to status subresource here + |
+
+(Appears on: CertificateConfig) +
+| Field | +Description | +
|---|---|
+issuerName+ +string + + |
+
+ Issuer name + |
+
+issuerKind+ +string + + |
+
+ Issuer kind + |
+
+issuerGroup+ +string + + |
+
+ Issuer group + |
+
+(Appears on: SubscriptionServer, Webhook) +
+| Field | +Description | +
|---|---|
+gardener+ + +Gardener + + + |
+
+ Gardener configuration + |
+
+certManager+ + +CertManager + + + |
+
+ CertManager configuration + |
+
string alias)+(Appears on: SubscriptionServer, Webhook) +
+Supported values are Gardener, CertManager, or Default +For the subscription server, it can be either Gardener or CertManager, while for the webhook, it can be either Default or CertManager
++(Appears on: Controller, SubscriptionServer, Webhook) +
+Common aspects for Controller, SubscriptionServer and Webhook
| Field | +Description | +
|---|---|
+resources+ + +Kubernetes core/v1.ResourceRequirements + + + |
+
+ Resource Requirements configuration + |
+
+(Appears on: CAPOperatorSpec) +
+| Field | +Description | +
|---|---|
+CommonConfig+ + +CommonConfig + + + |
+
+
+(Members of |
+
+detailedOperationalMetrics+ +bool + + |
+
+ Optionally enable detailed opertational metrics for the controller by setting this to true + |
+
+maxConcurrentReconciles+ + +MaxConcurrentReconciles + + + |
+
+ Configuration of maximum number of concurrent reconciles for the resources managed by the controller + |
+
+versionMonitoring+ + +VersionMonitoring + + + |
+
+ Version monitoring configuration + |
+
+volumes+ + +[]Kubernetes core/v1.Volume + + + |
+
+ Optionally specify list of additional volumes for the controller pod(s) + |
+
+volumeMounts+ + +[]Kubernetes core/v1.VolumeMount + + + |
+
+ Optionally specify list of additional volumeMounts for the controller container(s) + |
+
string alias)+(Appears on: VersionMonitoring) +
+Duration is a valid time duration that can be parsed by Prometheus
+Supported units: y, w, d, h, m, s, ms
+Examples: 30s, 1m, 1h20m15s, 15d
+(Appears on: CertificateConfig) +
+| Field | +Description | +
|---|---|
+issuerName+ +string + + |
+
+ Issuer name + |
+
+issuerNamespace+ +string + + |
+
+ Issuer namespace + |
+
+(Appears on: Monitoring) +
+| Field | +Description | +
|---|---|
+dashboard+ + +GrafanaDashboard + + + |
+
+ Dashboard configuration + |
+
+(Appears on: Grafana) +
+| Field | +Description | +
|---|---|
+configMapLabels+ +map[string]string + + |
+
+ Labels for selecting ConfigMaps with dashboards in Grafana + |
+
+(Appears on: Controller) +
+| Field | +Description | +
|---|---|
+capApplication+ +string + + |
+
+ Maximum number of concurrent reconciles for the cap application + |
+
+capApplicationVersion+ +string + + |
+
+ Maximum number of concurrent reconciles for the cap application version + |
+
+capTenant+ +string + + |
+
+ Maximum number of concurrent reconciles for the cap tenant + |
+
+capTenantOperation+ +string + + |
+
+ Maximum number of concurrent reconciles for the cap tenant operation + |
+
+domain+ +string + + |
+
+ Maximum number of concurrent reconciles for the domain + |
+
+clusterDomain+ +string + + |
+
+ Maximum number of concurrent reconciles for the cluster domain + |
+
+(Appears on: CAPOperatorSpec) +
+| Field | +Description | +
|---|---|
+enabled+ +bool + + |
+
+ Optionally enable Prometheus monitoring for all components + |
+
+serviceMonitorSelectorLabels+ +map[string]string + + |
+
+ Prometheus service monitor selector labels + |
+
+grafana+ + +Grafana + + + |
+
+ Grafana configuration + |
+
+(Appears on: CAPOperatorSpec) +
+Generic Name/Value configuration
+| Field | +Description | +
|---|---|
+name+ +string + + |
++ | +
+value+ +string + + |
++ | +
+(Appears on: CAPOperatorSpec) +
+| Field | +Description | +
|---|---|
+CommonConfig+ + +CommonConfig + + + |
+
+
+(Members of |
+
+subDomain+ +string + + |
++ | +
+certificateManager+ + +CertificateManager + + + |
+
+ Certificate manager which can be either |
+
+certificateConfig+ + +CertificateConfig + + + |
+
+ Certificate configuration + |
+
+(Appears on: Controller) +
+| Field | +Description | +
|---|---|
+prometheusAddress+ +string + + |
+
+ URL of the Prometheus server from which metrics related to managed application versions can be queried + |
+
+metricsEvaluationInterval+ + +Duration + + + |
+
+ The duration (example 2h) after which versions are evaluated for deletion; based on specified workload metrics + |
+
+promClientAcquireRetryDelay+ + +Duration + + + |
+
+ The duration (example 10m) to wait before retrying to acquire Prometheus client and verify connection, after a failed attempt + |
+
+(Appears on: CAPOperatorSpec) +
+| Field | +Description | +
|---|---|
+CommonConfig+ + +CommonConfig + + + |
+
+
+(Members of |
+
+certificateManager+ + +CertificateManager + + + |
+
+ Certificate manager which can be either |
+
+certificateConfig+ + +CertificateConfig + + + |
+
+ Certificate configuration + |
+
+Generated with gen-crd-api-reference-docs
+.
+