From 2eafc1ed8b67ccd29b3ef382143524626f9d4c62 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Wed, 4 Oct 2023 11:03:06 +0200 Subject: [PATCH] add targets to update crd documentation --- Makefile | 13 +++++++++ docs/user/02-configuration.md | 52 +++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/Makefile b/Makefile index afadf4fc..74a2efc0 100644 --- a/Makefile +++ b/Makefile @@ -89,6 +89,7 @@ help: ## Display this help. .PHONY: manifests manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. $(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases + $(MAKE) crd-docs-gen .PHONY: generate generate: go-gen controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. @@ -287,3 +288,15 @@ e2e-only: e2e-setup e2e-bench e2e-nats-server e2e-cleanup .PHONY: e2e e2e: install docker-build docker-push deploy e2e-setup e2e-bench e2e-nats-server e2e-cleanup + +TABLE_GEN ?= $(LOCALBIN)/table-gen +TABLE_GEN_VERSION ?= v0.0.0-20230523174756-3dae9f177ffd + +.PHONY: tablegen +tablegen: $(TABLE_GEN) ## Download table-gen locally if necessary. +$(TABLE_GEN): $(LOCALBIN) + test -s $(TABLE_GEN) || GOBIN=$(LOCALBIN) go install github.com/kyma-project/kyma/hack/table-gen@$(TABLE_GEN_VERSION) + +.PHONY: crd-docs-gen +crd-docs-gen: tablegen ## Generates CRD spec into docs folder + ${TABLE_GEN} --crd-filename ./config/crd/bases/operator.kyma-project.io_nats.yaml --md-filename ./docs/user/02-configuration.md diff --git a/docs/user/02-configuration.md b/docs/user/02-configuration.md index 89974118..32de57c1 100644 --- a/docs/user/02-configuration.md +++ b/docs/user/02-configuration.md @@ -24,3 +24,55 @@ Use the following sample CRs as guidance. Each can be applied immediately when y - [Default CR](https://github.com/kyma-project/nats-manager/blob/main/config/samples/default.yaml#L1) - [Minimal CR](https://github.com/kyma-project/nats-manager/blob/main/config/samples/minimal.yaml#L1) - [Full spec CR](https://github.com/kyma-project/nats-manager/blob/main/config/samples/nats-full-spec.yaml#L1) + +## Reference + + + + + + +### NATS.operator.kyma-project.io/v1alpha1 + +**Spec:** + +| Parameter | Type | Description | +| ---- | ----------- | ---- | +| **annotations** | map\[string\]string | Annotations allows to add annotations to NATS. | +| **cluster** | object | Cluster defines configurations that are specific to NATS clusters. | +| **cluster.​size** | integer | Size of a NATS cluster, i.e. number of NATS nodes. | +| **jetStream** | object | JetStream defines configurations that are specific to NATS JetStream. | +| **jetStream.​fileStorage** | object | FileStorage defines configurations to file storage in NATS JetStream. | +| **jetStream.​fileStorage.​size** | \{integer or string\} | Size defines the file storage size. | +| **jetStream.​fileStorage.​storageClassName** | string | StorageClassName defines the file storage class name. | +| **jetStream.​memStorage** | object | MemStorage defines configurations to memory storage in NATS JetStream. | +| **jetStream.​memStorage.​enabled** | boolean | Enabled allows the enablement of memory storage. | +| **jetStream.​memStorage.​size** | \{integer or string\} | Size defines the mem. | +| **labels** | map\[string\]string | Labels allows to add Labels to NATS. | +| **logging** | object | JetStream defines configurations that are specific to NATS logging in NATS. | +| **logging.​debug** | boolean | Debug allows debug logging. | +| **logging.​trace** | boolean | Trace allows trace logging. | +| **resources** | object | Resources defines resources for NATS. | +| **resources.​claims** | \[\]object | Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. + This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. + This field is immutable. It can only be set for containers. | +| **resources.​claims.​name** (required) | string | Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. | +| **resources.​limits** | map\[string\]\{integer or string\} | Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | +| **resources.​requests** | map\[string\]\{integer or string\} | Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | + +**Status:** + +| Parameter | Type | Description | +| ---- | ----------- | ---- | +| **conditions** | \[\]object | Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, + type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` + // other fields } | +| **conditions.​lastTransitionTime** (required) | string | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. | +| **conditions.​message** (required) | string | message is a human readable message indicating details about the transition. This may be an empty string. | +| **conditions.​observedGeneration** | integer | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. | +| **conditions.​reason** (required) | string | reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. | +| **conditions.​status** (required) | string | status of the condition, one of True, False, Unknown. | +| **conditions.​type** (required) | string | type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) | +| **state** (required) | string | | + +