From 3d1f84669fff125d7589e762f27d58ff2ddc8446 Mon Sep 17 00:00:00 2001 From: Periklis Tsirakidis Date: Mon, 3 Aug 2020 09:48:00 +0200 Subject: [PATCH 1/4] Add CRD v1beta1 generation via operator-sdk --- Makefile | 5 +- hack/generate-crd.sh | 33 ++ .../4.6/crd-drop-status-validation-patch.yaml | 4 + manifests/4.6/elasticsearches.crd.yaml | 210 ---------- manifests/4.6/kibanas.crd.yaml | 65 --- manifests/4.6/kustomization.yaml | 16 + ...ging.openshift.io_elasticsearches_crd.yaml | 387 ++++++++++++++++++ .../4.6/logging.openshift.io_kibanas_crd.yaml | 157 +++++++ pkg/apis/logging/v1/elasticsearch_types.go | 143 +++++-- pkg/apis/logging/v1/index_management_types.go | 49 ++- pkg/apis/logging/v1/kibana_types.go | 40 +- pkg/apis/logging/v1/zz_generated.deepcopy.go | 2 +- 12 files changed, 771 insertions(+), 340 deletions(-) create mode 100755 hack/generate-crd.sh create mode 100644 manifests/4.6/crd-drop-status-validation-patch.yaml delete mode 100644 manifests/4.6/elasticsearches.crd.yaml delete mode 100644 manifests/4.6/kibanas.crd.yaml create mode 100644 manifests/4.6/kustomization.yaml create mode 100644 manifests/4.6/logging.openshift.io_elasticsearches_crd.yaml create mode 100644 manifests/4.6/logging.openshift.io_kibanas_crd.yaml diff --git a/Makefile b/Makefile index 7294fdeb1..71ae97039 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,8 @@ export GOROOT=$(shell go env GOROOT) export GOFLAGS=-mod=vendor export GO111MODULE=on +export OCP_VERSION=4.6 + export APP_NAME=elasticsearch-operator IMAGE_TAG?=127.0.0.1:5000/openshift/origin-$(APP_NAME):latest APP_REPO=github.com/openshift/$(APP_NAME) @@ -32,8 +34,7 @@ gobindir: GEN_TIMESTAMP=.zz_generate_timestamp generate: $(GEN_TIMESTAMP) $(OPERATOR_SDK) $(GEN_TIMESTAMP): $(shell find pkg/apis -name '*.go') - $(OPERATOR_SDK) generate k8s - $(OPERATOR_SDK) generate crds + @./hack/generate-crd.sh @$(MAKE) fmt @touch $@ diff --git a/hack/generate-crd.sh b/hack/generate-crd.sh new file mode 100755 index 000000000..7fecb6a39 --- /dev/null +++ b/hack/generate-crd.sh @@ -0,0 +1,33 @@ +#!/usr/bin/bash + +source .bingo/variables.env + +set -euo pipefail + +MANIFESTS_DIR=${1:-"manifests/${OCP_VERSION}"} +ES_CRD_FILE="logging.openshift.io_elasticsearches_crd.yaml" +KB_CRD_FILE="logging.openshift.io_kibanas_crd.yaml" + +echo "--------------------------------------------------------------" +echo "Generate k8s golang code" +echo "--------------------------------------------------------------" +$OPERATOR_SDK generate k8s + +echo "--------------------------------------------------------------" +echo "Generate CRDs for apiVersion v1beta1" +echo "--------------------------------------------------------------" +$OPERATOR_SDK generate crds --crd-version v1beta1 +mv deploy/crds/*.yaml "${MANIFESTS_DIR}" + +echo "---------------------------------------------------------------" +echo "Kustomize: Patch CRDs for backward-compatibility" +echo "---------------------------------------------------------------" +oc kustomize "${MANIFESTS_DIR}" | \ + awk -v es="${MANIFESTS_DIR}/${ES_CRD_FILE}" \ + -v kb="${MANIFESTS_DIR}/${KB_CRD_FILE}"\ + 'BEGIN{filename = es} /---/ {getline; filename = kb}{print $0> filename}' + +echo "---------------------------------------------------------------" +echo "Cleanup operator-sdk generation folder" +echo "---------------------------------------------------------------" +rm -rf deploy diff --git a/manifests/4.6/crd-drop-status-validation-patch.yaml b/manifests/4.6/crd-drop-status-validation-patch.yaml new file mode 100644 index 000000000..07362fd7f --- /dev/null +++ b/manifests/4.6/crd-drop-status-validation-patch.yaml @@ -0,0 +1,4 @@ +- op: replace + path: /spec/validation/openAPIV3Schema/properties/status + value: + type: object diff --git a/manifests/4.6/elasticsearches.crd.yaml b/manifests/4.6/elasticsearches.crd.yaml deleted file mode 100644 index 79eb6c9ed..000000000 --- a/manifests/4.6/elasticsearches.crd.yaml +++ /dev/null @@ -1,210 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: elasticsearches.logging.openshift.io -spec: - group: logging.openshift.io - names: - kind: Elasticsearch - listKind: ElasticsearchList - plural: elasticsearches - singular: elasticsearch - scope: Namespaced - version: v1 - validation: - openAPIV3Schema: - type: object - properties: - spec: - description: Specification of the desired behavior of the Elasticsearch cluster - type: object - properties: - managementState: - description: Indicator if the resource is 'Managed' or 'Unmanaged' by the operator - type: string - enum: - - "Managed" - - "Unmanaged" - redundancyPolicy: - description: The policy towards data redundancy to specify the number of redundant primary shards - type: string - enum: - - "FullRedundancy" - - "MultipleRedundancy" - - "SingleRedundancy" - - "ZeroRedundancy" - nodes: - description: Specification of the different Elasticsearch nodes - type: array - items: - type: object - properties: - roles: - description: The specific Elasticsearch cluster roles the node should perform - type: array - items: - type: string - nodeCount: - description: Number of nodes to deploy - format: int32 - type: integer - resources: - description: The resource requirements for the Elasticsearch node - type: object - nullable: true - properties: - limits: - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - requests: - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - nodeSelector: - description: Define which Nodes the Pods are scheduled on. - type: object - tolerations: - type: array - items: - type: object - storage: - description: The type of backing storage that should be used for the node - type: object - properties: - storageClassName: - description: The name of the storage class to use with creating the node's PVC - type: string - size: - description: The max storage capacity for the node - type: string - genUUID: - type: string - nullable: true - proxyResources: - description: The resource requirements for the Elasticsearch proxy - type: object - properties: - limits: - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - requests: - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - indexManagement: - description: Management spec for indicies - type: object - nullable: true - properties: - policies: - description: A list of polices for managing an indices - type: array - items: - type: object - properties: - name: - description: The unique name of the policy - type: string - pollInterval: - description: How often to check an index meets the desired criteria (e.g. 1m) - type: string - phases: - type: object - properties: - delete: - type: object - nullable: true - properties: - minAge: - description: The minimum age of an index before it should be deleted (e.g. 10d) - type: string - hot: - type: object - nullable: true - properties: - actions: - type: object - properties: - rollover: - type: object - nullable: true - properties: - maxAge: - description: The maximum age of an index before it should be rolled over (e.g. 7d) - type: string - mappings: - description: Mappings of policies to indicies - type: array - items: - type: object - properties: - name: - description: The unique name of the policy mapping - type: string - policyRef: - description: A reference to a defined policy - type: string - aliases: - description: Aliases to apply to a template - type: array - items: - type: string - nodeSpec: - description: Default specification applied to all Elasticsearch nodes - type: object - properties: - image: - description: The image to use for the Elasticsearch nodes - type: string - nullable: true - resources: - description: The resource requirements for the Elasticsearch nodes - type: object - nullable: true - properties: - limits: - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - requests: - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - tolerations: - type: array - items: - type: object - nodeSelector: - description: Define which Nodes the Pods are scheduled on. - type: object - nullable: true - proxyResources: - description: The resource requirements for the Elasticsearch proxy - type: object - properties: - limits: - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - requests: - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true diff --git a/manifests/4.6/kibanas.crd.yaml b/manifests/4.6/kibanas.crd.yaml deleted file mode 100644 index 246667fc8..000000000 --- a/manifests/4.6/kibanas.crd.yaml +++ /dev/null @@ -1,65 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: kibanas.logging.openshift.io -spec: - subresources: - status: {} - group: logging.openshift.io - names: - kind: Kibana - listKind: KibanaList - plural: kibanas - singular: kibana - scope: Namespaced - version: v1 - validation: - openAPIV3Schema: - type: object - properties: - spec: - type: object - description: Specification of the desired behavior of the Kibana - properties: - resources: - type: object - description: The resource requirements for Kibana - nullable: true - properties: - limits: - type: object - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - nullable: true - requests: - type: object - nullable: true - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - replicas: - type: integer - description: Number of instances to deploy for a Kibana deployment - format: int32 - proxySpec: - type: object - description: Specification of the Kibana Proxy component - properties: - resources: - type: object - description: The resource requirements for Kibana - nullable: true - properties: - limits: - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - requests: - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true diff --git a/manifests/4.6/kustomization.yaml b/manifests/4.6/kustomization.yaml new file mode 100644 index 000000000..5030f49fe --- /dev/null +++ b/manifests/4.6/kustomization.yaml @@ -0,0 +1,16 @@ +resources: +- logging.openshift.io_elasticsearches_crd.yaml +- logging.openshift.io_kibanas_crd.yaml +patchesJson6902: +- path: crd-drop-status-validation-patch.yaml + target: + group: apiextensions.k8s.io + version: v1beta1 + kind: CustomResourceDefinition + name: elasticsearches.logging.openshift.io +- path: crd-drop-status-validation-patch.yaml + target: + group: apiextensions.k8s.io + version: v1beta1 + kind: CustomResourceDefinition + name: kibanas.logging.openshift.io diff --git a/manifests/4.6/logging.openshift.io_elasticsearches_crd.yaml b/manifests/4.6/logging.openshift.io_elasticsearches_crd.yaml new file mode 100644 index 000000000..7f325548f --- /dev/null +++ b/manifests/4.6/logging.openshift.io_elasticsearches_crd.yaml @@ -0,0 +1,387 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: elasticsearches.logging.openshift.io +spec: + group: logging.openshift.io + names: + kind: Elasticsearch + listKind: ElasticsearchList + plural: elasticsearches + shortNames: + - es + singular: elasticsearch + scope: Namespaced + validation: + openAPIV3Schema: + description: Elasticsearch is the Schema for the elasticsearches API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Specification of the desired behavior of the Elasticsearch + cluster + properties: + indexManagement: + description: Management spec for indicies + nullable: true + properties: + mappings: + description: Mappings of policies to indicies + items: + description: IndexManagementPolicyMappingSpec maps a management + policy to an index + properties: + aliases: + description: Aliases to apply to a template + items: + type: string + type: array + name: + description: The unique name of the policy mapping + type: string + policyRef: + description: A reference to a defined policy + type: string + type: object + type: array + policies: + description: A list of polices for managing an indices + items: + description: IndexManagementPolicySpec is a definition of an index + management policy + properties: + name: + description: The unique name of the policy + type: string + phases: + properties: + delete: + nullable: true + properties: + minAge: + description: The minimum age of an index before it + should be deleted (e.g. 10d) + pattern: ^([0-9]+)([yMwdhHms]{0,1})$ + type: string + required: + - minAge + type: object + hot: + nullable: true + properties: + actions: + properties: + rollover: + nullable: true + properties: + maxAge: + description: The maximum age of an index before + it should be rolled over (e.g. 7d) + pattern: ^([0-9]+)([yMwdhHms]{0,1})$ + type: string + required: + - maxAge + type: object + type: object + type: object + type: object + pollInterval: + description: How often to check an index meets the desired + criteria (e.g. 1m) + pattern: ^([0-9]+)([yMwdhHms]{0,1})$ + type: string + required: + - name + - phases + - pollInterval + type: object + type: array + type: object + managementState: + description: ManagementState indicates whether and how the operator + should manage the component. Indicator if the resource is 'Managed' + or 'Unmanaged' by the operator. + enum: + - Managed + - Unmanaged + type: string + nodeSpec: + description: Default specification applied to all Elasticsearch nodes + properties: + image: + description: The image to use for the Elasticsearch nodes + nullable: true + type: string + nodeSelector: + additionalProperties: + type: string + description: Define which Nodes the Pods are scheduled on. + nullable: true + type: object + proxyResources: + description: The resource requirements for the Elasticsearch proxy + nullable: true + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + resources: + description: The resource requirements for the Elasticsearch nodes + nullable: true + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + tolerations: + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + nodes: + description: Specification of the different Elasticsearch nodes + items: + description: ElasticsearchNode struct represents individual node in + Elasticsearch cluster + properties: + genUUID: + description: GenUUID will be populated by the operator if not + provided + nullable: true + type: string + nodeCount: + description: Number of nodes to deploy + format: int32 + type: integer + nodeSelector: + additionalProperties: + type: string + description: Define which Nodes the Pods are scheduled on. + type: object + proxyResources: + description: The resource requirements for the Elasticsearch proxy + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + resources: + description: The resource requirements for the Elasticsearch node + nullable: true + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + roles: + description: The specific Elasticsearch cluster roles the node + should perform + items: + enum: + - master + - client + - data + type: string + type: array + storage: + description: The type of backing storage that should be used for + the node + properties: + size: + anyOf: + - type: integer + - type: string + description: The max storage capacity for the node to provision. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + storageClassName: + description: 'The name of the storage class to use with creating + the node''s PVC. More info: https://kubernetes.io/docs/concepts/storage/storage-classes/' + type: string + type: object + tolerations: + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using + the matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. + Empty means match all taint effects. When specified, allowed + values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to + the value. Valid operators are Exists and Equal. Defaults + to Equal. Exists is equivalent to wildcard for value, + so that a pod can tolerate all taints of a particular + category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of + time the toleration (which must be of effect NoExecute, + otherwise this field is ignored) tolerates the taint. + By default, it is not set, which means tolerate the taint + forever (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + type: array + redundancyPolicy: + description: The policy towards data redundancy to specify the number + of redundant primary shards + enum: + - FullRedundancy + - MultipleRedundancy + - SingleRedundancy + - ZeroRedundancy + type: string + required: + - managementState + - redundancyPolicy + type: object + status: + type: object + type: object + version: v1 + versions: + - name: v1 + served: true + storage: true diff --git a/manifests/4.6/logging.openshift.io_kibanas_crd.yaml b/manifests/4.6/logging.openshift.io_kibanas_crd.yaml new file mode 100644 index 000000000..d3791ca4a --- /dev/null +++ b/manifests/4.6/logging.openshift.io_kibanas_crd.yaml @@ -0,0 +1,157 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: kibanas.logging.openshift.io +spec: + group: logging.openshift.io + names: + kind: Kibana + listKind: KibanaList + plural: kibanas + singular: kibana + scope: Namespaced + subresources: + status: {} + validation: + openAPIV3Schema: + description: Kibana is the Schema for the kibanas API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Specification of the desired behavior of the Kibana + properties: + managementState: + description: Indicator if the resource is 'Managed' or 'Unmanaged' by + the operator + enum: + - Managed + - Unmanaged + type: string + nodeSelector: + additionalProperties: + type: string + description: Define which Nodes the Pods are scheduled on. + type: object + proxy: + description: Specification of the Kibana Proxy component + properties: + resources: + description: The resource requirements for Kibana proxy + nullable: true + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + type: object + replicas: + description: Number of instances to deploy for a Kibana deployment + format: int32 + type: integer + resources: + description: The resource requirements for Kibana + nullable: true + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + tolerations: + items: + description: The pod this Toleration is attached to tolerates any + taint that matches the triple using the matching + operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, operator + must be Exists; this combination means to match all values and + all keys. + type: string + operator: + description: Operator represents a key's relationship to the value. + Valid operators are Exists and Equal. Defaults to Equal. Exists + is equivalent to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time the + toleration (which must be of effect NoExecute, otherwise this + field is ignored) tolerates the taint. By default, it is not + set, which means tolerate the taint forever (do not evict). + Zero and negative values will be treated as 0 (evict immediately) + by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches to. + If the operator is Exists, the value should be empty, otherwise + just a regular string. + type: string + type: object + type: array + required: + - managementState + type: object + status: + type: object + type: object + version: v1 + versions: + - name: v1 + served: true + storage: true diff --git a/pkg/apis/logging/v1/elasticsearch_types.go b/pkg/apis/logging/v1/elasticsearch_types.go index df7e1201e..177b9abf2 100644 --- a/pkg/apis/logging/v1/elasticsearch_types.go +++ b/pkg/apis/logging/v1/elasticsearch_types.go @@ -1,7 +1,7 @@ package v1 import ( - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -13,18 +13,20 @@ const ( ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// Elasticsearch is the Schema for the elasticsearches API // +k8s:openapi-gen=true +// +kubebuilder:resource:shortName=es +// +// Elasticsearch is the Schema for the elasticsearches API type Elasticsearch struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` + // Specification of the desired behavior of the Elasticsearch cluster Spec ElasticsearchSpec `json:"spec,omitempty"` Status ElasticsearchStatus `json:"status,omitempty"` } -//AddOwnerRefTo appends the Elasticsearch object as an OwnerReference to the passed object +// AddOwnerRefTo appends the Elasticsearch object as an OwnerReference to the passed object func (es *Elasticsearch) AddOwnerRefTo(o metav1.Object) { trueVar := true ref := metav1.OwnerReference{ @@ -40,7 +42,7 @@ func (es *Elasticsearch) AddOwnerRefTo(o metav1.Object) { } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - +// // ElasticsearchList contains a list of Elasticsearch type ElasticsearchList struct { metav1.TypeMeta `json:",inline"` @@ -53,26 +55,35 @@ func init() { } // ElasticsearchSpec defines the desired state of Elasticsearch -// +k8s:openapi-gen=true -// ManagementState indicates whether and how the operator should manage the component type ElasticsearchSpec struct { - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file - // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html - - ManagementState ManagementState `json:"managementState"` - RedundancyPolicy RedundancyPolicyType `json:"redundancyPolicy"` - Nodes []ElasticsearchNode `json:"nodes"` - Spec ElasticsearchNodeSpec `json:"nodeSpec"` - IndexManagement *IndexManagementSpec `json:"indexManagement"` + + // ManagementState indicates whether and how the operator should manage the component. + // Indicator if the resource is 'Managed' or 'Unmanaged' by the operator. + ManagementState ManagementState `json:"managementState"` + + // The policy towards data redundancy to specify the number of redundant primary shards + RedundancyPolicy RedundancyPolicyType `json:"redundancyPolicy"` + + // Specification of the different Elasticsearch nodes + // + // +optional + Nodes []ElasticsearchNode `json:"nodes"` + + // Default specification applied to all Elasticsearch nodes + // + // +optional + Spec ElasticsearchNodeSpec `json:"nodeSpec"` + + // Management spec for indicies + // + // +nullable + // +optional + IndexManagement *IndexManagementSpec `json:"indexManagement"` } // ElasticsearchStatus defines the observed state of Elasticsearch // +k8s:openapi-gen=true type ElasticsearchStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file - // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html - Nodes []ElasticsearchNodeStatus `json:"nodes"` ClusterHealth string `json:"clusterHealth"` Cluster ClusterHealth `json:"cluster"` @@ -95,31 +106,74 @@ type ClusterHealth struct { } // ElasticsearchNode struct represents individual node in Elasticsearch cluster -// GenUUID will be populated by the operator if not provided type ElasticsearchNode struct { - Roles []ElasticsearchNodeRole `json:"roles"` - NodeCount int32 `json:"nodeCount"` - Resources v1.ResourceRequirements `json:"resources"` - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - Tolerations []v1.Toleration `json:"tolerations,omitempty"` - Storage ElasticsearchStorageSpec `json:"storage"` - GenUUID *string `json:"genUUID,omitempty"` - ProxyResources v1.ResourceRequirements `json:"proxyResources,omitempty"` + // The specific Elasticsearch cluster roles the node should perform + // + // +optional + Roles []ElasticsearchNodeRole `json:"roles"` + + // Number of nodes to deploy + // + // +optional + NodeCount int32 `json:"nodeCount"` + + // The resource requirements for the Elasticsearch node + // + // +nullable + // +optional + Resources corev1.ResourceRequirements `json:"resources"` + + // Define which Nodes the Pods are scheduled on. + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` + + // The type of backing storage that should be used for the node + // + // +optional + Storage ElasticsearchStorageSpec `json:"storage"` + + // GenUUID will be populated by the operator if not provided + // + // +nullable + GenUUID *string `json:"genUUID,omitempty"` + + // The resource requirements for the Elasticsearch proxy + ProxyResources corev1.ResourceRequirements `json:"proxyResources,omitempty"` } // ElasticsearchNodeSpec represents configuration of an individual Elasticsearch node type ElasticsearchNodeSpec struct { - Image string `json:"image,omitempty"` - Resources v1.ResourceRequirements `json:"resources"` - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - Tolerations []v1.Toleration `json:"tolerations,omitempty"` - ProxyResources v1.ResourceRequirements `json:"proxyResources,omitempty"` + // The image to use for the Elasticsearch nodes + // + // +nullable + // +optional + Image string `json:"image,omitempty"` + + // The resource requirements for the Elasticsearch nodes + // + // +nullable + // +optional + Resources corev1.ResourceRequirements `json:"resources"` + + // Define which Nodes the Pods are scheduled on. + // + // +nullable + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` + + // The resource requirements for the Elasticsearch proxy + // + // +nullable + // +optional + ProxyResources corev1.ResourceRequirements `json:"proxyResources,omitempty"` } type ElasticsearchStorageSpec struct { - // The class of storage to provision. More info: https://kubernetes.io/docs/concepts/storage/storage-classes/ + // The name of the storage class to use with creating the node's PVC. + // More info: https://kubernetes.io/docs/concepts/storage/storage-classes/ StorageClassName *string `json:"storageClassName,omitempty"` - // The capacity of storage to provision. + + // The max storage capacity for the node to provision. Size *resource.Quantity `json:"size,omitempty"` } @@ -134,16 +188,16 @@ type ElasticsearchNodeStatus struct { } type ElasticsearchNodeUpgradeStatus struct { - ScheduledForUpgrade v1.ConditionStatus `json:"scheduledUpgrade,omitempty"` - ScheduledForRedeploy v1.ConditionStatus `json:"scheduledRedeploy,omitempty"` - ScheduledForCertRedeploy v1.ConditionStatus `json:"scheduledCertRedeploy,omitempty"` - UnderUpgrade v1.ConditionStatus `json:"underUpgrade,omitempty"` + ScheduledForUpgrade corev1.ConditionStatus `json:"scheduledUpgrade,omitempty"` + ScheduledForRedeploy corev1.ConditionStatus `json:"scheduledRedeploy,omitempty"` + ScheduledForCertRedeploy corev1.ConditionStatus `json:"scheduledCertRedeploy,omitempty"` + UnderUpgrade corev1.ConditionStatus `json:"underUpgrade,omitempty"` UpgradePhase ElasticsearchUpgradePhase `json:"upgradePhase,omitempty"` } type ClusterCondition struct { - Type ClusterConditionType `json:"type"` - Status v1.ConditionStatus `json:"status"` + Type ClusterConditionType `json:"type"` + Status corev1.ConditionStatus `json:"status"` // Last time the condition transitioned from one status to another. LastTransitionTime metav1.Time `json:"lastTransitionTime"` // Unique, one-word, CamelCase reason for the condition's last transition. @@ -154,9 +208,9 @@ type ClusterCondition struct { type ClusterConditions []ClusterCondition -// +kubebuilder:validation:Enum=FullRedundancy;MultipleRedundancy;SingleRedundancy;ZeroRedundancy - // The policy towards data redundancy to specify the number of redundant primary shards +// +// +kubebuilder:validation:Enum=FullRedundancy;MultipleRedundancy;SingleRedundancy;ZeroRedundancy type RedundancyPolicyType string const ( @@ -170,6 +224,7 @@ const ( ZeroRedundancy RedundancyPolicyType = "ZeroRedundancy" ) +// +kubebuilder:validation:Enum:=master;client;data type ElasticsearchNodeRole string const ( @@ -209,6 +264,8 @@ const ( // Managed means that the operator is actively managing its resources and trying to keep the component active. // It will only upgrade the component if it is safe to do so // Unmanaged means that the operator will not take any action related to the component +// +// +kubebuilder:validation:Enum:=Managed;Unmanaged type ManagementState string const ( diff --git a/pkg/apis/logging/v1/index_management_types.go b/pkg/apis/logging/v1/index_management_types.go index 9aee22d0f..5f1e6c49b 100644 --- a/pkg/apis/logging/v1/index_management_types.go +++ b/pkg/apis/logging/v1/index_management_types.go @@ -8,53 +8,82 @@ import ( // IndexManagementSpec specifies index management for an Elasticsearch cluster // +k8s:openapi-gen=true type IndexManagementSpec struct { - Policies []IndexManagementPolicySpec `json:"policies"` + // A list of polices for managing an indices + // + // +optional + Policies []IndexManagementPolicySpec `json:"policies"` + + // Mappings of policies to indicies + // + // +optional Mappings []IndexManagementPolicyMappingSpec `json:"mappings"` } -//TimeUnit is a time unit like h,m,d +// TimeUnit is a time unit like h,m,d +// +// +kubebuilder:validation:Pattern:="^([0-9]+)([yMwdhHms]{0,1})$" type TimeUnit string -//IndexManagementPolicySpec is a definition of an index management policy +// IndexManagementPolicySpec is a definition of an index management policy // +k8s:openapi-gen=true type IndexManagementPolicySpec struct { - Name string `json:"name"` - PollInterval TimeUnit `json:"pollInterval"` - Phases IndexManagementPhasesSpec `json:"phases"` + // The unique name of the policy + Name string `json:"name"` + + // How often to check an index meets the desired criteria (e.g. 1m) + PollInterval TimeUnit `json:"pollInterval"` + + Phases IndexManagementPhasesSpec `json:"phases"` } // +k8s:openapi-gen=true type IndexManagementPhasesSpec struct { - Hot *IndexManagementHotPhaseSpec `json:"hot,omitempty"` + // +nullable + Hot *IndexManagementHotPhaseSpec `json:"hot,omitempty"` + // +nullable Delete *IndexManagementDeletePhaseSpec `json:"delete,omitempty"` } // +k8s:openapi-gen=true type IndexManagementDeletePhaseSpec struct { + // The minimum age of an index before it should be deleted (e.g. 10d) + // MinAge TimeUnit `json:"minAge"` } // +k8s:openapi-gen=true type IndexManagementHotPhaseSpec struct { + // +optional Actions IndexManagementActionsSpec `json:"actions"` } // +k8s:openapi-gen=true type IndexManagementActionsSpec struct { + // +nullable + // +optional Rollover *IndexManagementActionSpec `json:"rollover"` } // +k8s:openapi-gen=true type IndexManagementActionSpec struct { + // The maximum age of an index before it should be rolled over (e.g. 7d) MaxAge TimeUnit `json:"maxAge"` } //IndexManagementPolicyMappingSpec maps a management policy to an index // +k8s:openapi-gen=true type IndexManagementPolicyMappingSpec struct { - Name string `json:"name"` - PolicyRef string `json:"policyRef"` - Aliases []string `json:"aliases,omitempty"` + // The unique name of the policy mapping + // + // +optional + Name string `json:"name"` + + // A reference to a defined policy + // +optional + PolicyRef string `json:"policyRef"` + + // Aliases to apply to a template + Aliases []string `json:"aliases,omitempty"` } type PolicyMap map[string]IndexManagementPolicySpec diff --git a/pkg/apis/logging/v1/kibana_types.go b/pkg/apis/logging/v1/kibana_types.go index d4df90564..13d0d59bd 100644 --- a/pkg/apis/logging/v1/kibana_types.go +++ b/pkg/apis/logging/v1/kibana_types.go @@ -1,23 +1,45 @@ package v1 import ( - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// KibanaSpec defines the desired state of Kibana +// Specification of the desired behavior of the Kibana +// // +k8s:openapi-gen=true type KibanaSpec struct { - ManagementState ManagementState `json:"managementState"` - Resources *v1.ResourceRequirements `json:"resources"` - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - Tolerations []v1.Toleration `json:"tolerations,omitempty"` - Replicas int32 `json:"replicas"` - ProxySpec `json:"proxy,omitempty"` + // Indicator if the resource is 'Managed' or 'Unmanaged' by the operator + // + ManagementState ManagementState `json:"managementState"` + + // The resource requirements for Kibana + // + // +nullable + // +optional + Resources *corev1.ResourceRequirements `json:"resources"` + + // Define which Nodes the Pods are scheduled on. + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` + + // Number of instances to deploy for a Kibana deployment + // + // +optional + Replicas int32 `json:"replicas"` + + // Specification of the Kibana Proxy component + // + // +optional + ProxySpec `json:"proxy,omitempty"` } type ProxySpec struct { - Resources *v1.ResourceRequirements `json:"resources"` + // The resource requirements for Kibana proxy + // + // +nullable + // +optional + Resources *corev1.ResourceRequirements `json:"resources"` } // KibanaStatus defines the observed state of Kibana diff --git a/pkg/apis/logging/v1/zz_generated.deepcopy.go b/pkg/apis/logging/v1/zz_generated.deepcopy.go index 4faaf2cef..4f4dab80a 100644 --- a/pkg/apis/logging/v1/zz_generated.deepcopy.go +++ b/pkg/apis/logging/v1/zz_generated.deepcopy.go @@ -1,6 +1,6 @@ // +build !ignore_autogenerated -// Code generated by operator-sdk. DO NOT EDIT. +// Code generated by operator-sdk-v0.18.2. DO NOT EDIT. package v1 From 156d9c878572b457c576dbc92e929e13d22c3d79 Mon Sep 17 00:00:00 2001 From: Periklis Tsirakidis Date: Tue, 4 Aug 2020 16:19:14 +0200 Subject: [PATCH 2/4] Add CRD printer columns and categories --- ...ging.openshift.io_elasticsearches_crd.yaml | 23 +++++++++++++++++++ .../4.6/logging.openshift.io_kibanas_crd.yaml | 12 ++++++++-- pkg/apis/logging/v1/elasticsearch_types.go | 8 ++++++- pkg/apis/logging/v1/kibana_types.go | 5 ++-- 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/manifests/4.6/logging.openshift.io_elasticsearches_crd.yaml b/manifests/4.6/logging.openshift.io_elasticsearches_crd.yaml index 7f325548f..ed90f7cb4 100644 --- a/manifests/4.6/logging.openshift.io_elasticsearches_crd.yaml +++ b/manifests/4.6/logging.openshift.io_elasticsearches_crd.yaml @@ -3,8 +3,30 @@ kind: CustomResourceDefinition metadata: name: elasticsearches.logging.openshift.io spec: + additionalPrinterColumns: + - JSONPath: .spec.managementState + name: Management State + type: string + - JSONPath: .status.cluster.status + name: Health + type: string + - JSONPath: .status.cluster.numNodes + name: Nodes + type: integer + - JSONPath: .status.cluster.numDataNodes + name: Data Nodes + type: integer + - JSONPath: .status.shardAllocationEnabled + name: Shard Allocation + type: string + - JSONPath: .status.indexManagement.State + name: Index Management + type: string group: logging.openshift.io names: + categories: + - logging + - tracing kind: Elasticsearch listKind: ElasticsearchList plural: elasticsearches @@ -12,6 +34,7 @@ spec: - es singular: elasticsearch scope: Namespaced + subresources: {} validation: openAPIV3Schema: description: Elasticsearch is the Schema for the elasticsearches API diff --git a/manifests/4.6/logging.openshift.io_kibanas_crd.yaml b/manifests/4.6/logging.openshift.io_kibanas_crd.yaml index d3791ca4a..81cd432be 100644 --- a/manifests/4.6/logging.openshift.io_kibanas_crd.yaml +++ b/manifests/4.6/logging.openshift.io_kibanas_crd.yaml @@ -3,15 +3,23 @@ kind: CustomResourceDefinition metadata: name: kibanas.logging.openshift.io spec: + additionalPrinterColumns: + - JSONPath: .spec.managementState + name: Management State + type: string + - JSONPath: .spec.replicas + name: Replicas + type: integer group: logging.openshift.io names: + categories: + - logging kind: Kibana listKind: KibanaList plural: kibanas singular: kibana scope: Namespaced - subresources: - status: {} + subresources: {} validation: openAPIV3Schema: description: Kibana is the Schema for the kibanas API diff --git a/pkg/apis/logging/v1/elasticsearch_types.go b/pkg/apis/logging/v1/elasticsearch_types.go index 177b9abf2..c1fe1c544 100644 --- a/pkg/apis/logging/v1/elasticsearch_types.go +++ b/pkg/apis/logging/v1/elasticsearch_types.go @@ -14,7 +14,13 @@ const ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:openapi-gen=true -// +kubebuilder:resource:shortName=es +// +kubebuilder:resource:categories=logging;tracing,shortName=es +// +kubebuilder:printcolumn:name="Management State",JSONPath=".spec.managementState",type=string +// +kubebuilder:printcolumn:name="Health",JSONPath=".status.cluster.status",type=string +// +kubebuilder:printcolumn:name="Nodes",JSONPath=".status.cluster.numNodes",type=integer +// +kubebuilder:printcolumn:name="Data Nodes",JSONPath=".status.cluster.numDataNodes",type=integer +// +kubebuilder:printcolumn:name="Shard Allocation",JSONPath=".status.shardAllocationEnabled",type=string +// +kubebuilder:printcolumn:name="Index Management",JSONPath=".status.indexManagement.State",type=string // // Elasticsearch is the Schema for the elasticsearches API type Elasticsearch struct { diff --git a/pkg/apis/logging/v1/kibana_types.go b/pkg/apis/logging/v1/kibana_types.go index 13d0d59bd..5b254410a 100644 --- a/pkg/apis/logging/v1/kibana_types.go +++ b/pkg/apis/logging/v1/kibana_types.go @@ -56,8 +56,9 @@ type KibanaStatus struct { // Kibana is the Schema for the kibanas API // +k8s:openapi-gen=true -// +kubebuilder:subresource:status -// +kubebuilder:resource:path=kibanas,scope=Namespaced +// +kubebuilder:resource:path=kibanas,categories=logging,scope=Namespaced +// +kubebuilder:printcolumn:name="Management State",JSONPath=".spec.managementState",type=string +// +kubebuilder:printcolumn:name="Replicas",JSONPath=".spec.replicas",type=integer type Kibana struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` From f44a66b4c79c9b05b8fb6f56c4130f10544cb58f Mon Sep 17 00:00:00 2001 From: Periklis Tsirakidis Date: Mon, 3 Aug 2020 09:55:49 +0200 Subject: [PATCH 3/4] Move opm tool pining to bingo format --- .bingo/Variables.mk | 10 ++++++++-- .bingo/opm.mod | 5 +++++ .bingo/variables.env | 7 +++++-- Makefile | 18 +++++------------- 4 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 .bingo/opm.mod diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index ee568736d..3d1c6fe8c 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -1,4 +1,4 @@ -# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.2. DO NOT EDIT. +# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.3. DO NOT EDIT. # All tools are designed to be build inside $GOBIN. GOPATH ?= $(shell go env GOPATH) GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin @@ -38,5 +38,11 @@ OPERATOR_SDK := $(GOBIN)/operator-sdk-v0.18.2 $(OPERATOR_SDK): .bingo/operator-sdk.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. @echo "(re)installing $(GOBIN)/operator-sdk-v0.18.2" - @cd .bingo && $(GO) build -mod=mod -modfile=operator-sdk.mod -o=$(GOBIN)/operator-sdk-v0.18.2 "github.com/operator-framework/operator-sdk/cmd/operator-sdk" + @cd .bingo && $(GO) build -mod=mod -modfile=operator-sdk.mod -o=$(GOBIN)/operator-sdk-v0.18.2 "github.com/operator-framework/operator-sdk/cmd/operator-sdk" + +OPM := $(GOBIN)/opm-v1.13.6 +$(OPM): .bingo/opm.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/opm-v1.13.6" + @cd .bingo && $(GO) build -mod=mod -modfile=opm.mod -o=$(GOBIN)/opm-v1.13.6 "github.com/operator-framework/operator-registry/cmd/opm" diff --git a/.bingo/opm.mod b/.bingo/opm.mod new file mode 100644 index 000000000..07eb24e2e --- /dev/null +++ b/.bingo/opm.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.14 + +require github.com/operator-framework/operator-registry v1.13.6 // cmd/opm diff --git a/.bingo/variables.env b/.bingo/variables.env index 93a24c024..c27c23960 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -1,4 +1,4 @@ -# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.2. DO NOT EDIT. +# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.2.3. DO NOT EDIT. # All tools are designed to be build inside $GOBIN. # Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk. gobin=$(go env GOBIN) @@ -14,4 +14,7 @@ GOLANGCI_LINT="${gobin}/golangci-lint-v1.27.0" JUNITREPORT="${gobin}/junitreport" -OPERATOR_SDK="${gobin}/operator-sdk-v0.18.2" \ No newline at end of file +OPERATOR_SDK="${gobin}/operator-sdk-v0.18.2" + +OPM="${gobin}/opm-v1.13.6" + diff --git a/Makefile b/Makefile index 71ae97039..6cac56367 100644 --- a/Makefile +++ b/Makefile @@ -119,19 +119,11 @@ uninstall: $(MAKE) elasticsearch-catalog-uninstall .PHONY: uninstall -opm: - @if [ ! -f "${GOPATH}/src/github.com/operator-framework/operator-registry/opm" ] ; then \ - mkdir -p ${GOPATH}/src/github.com/operator-framework ||: ; \ - pushd ${GOPATH}/src/github.com/operator-framework ; \ - [ ! -d ./operator-registry ] && git clone https://github.com/operator-framework/operator-registry ; \ - cd operator-registry ; \ - go build ./cmd/opm/ ; \ - popd ; \ - fi -.PHONY: opm - -generate-bundle: opm - mkdir -p bundle; pushd bundle; ${GOPATH}/src/github.com/operator-framework/operator-registry/opm alpha bundle generate --directory ../manifests/4.6/ --package elasticsearch-operator --channels 4.6 --output-dir .; popd +generate-bundle: $(OPM) + mkdir -p bundle; \ + pushd bundle; \ + $(OPM) alpha bundle generate --directory ../manifests/$(OCP_VERSION)/ --package elasticsearch-operator --channels $(OCP_VERSION) --output-dir .; \ + popd .PHONY: generate-bundle # to use these targets, ensure the following env vars are set: From df940be26b6010236723c78932a86179abf68508 Mon Sep 17 00:00:00 2001 From: Periklis Tsirakidis Date: Mon, 3 Aug 2020 09:56:08 +0200 Subject: [PATCH 4/4] Add generated CRDs to operator bundle --- .../crd-drop-status-validation-patch.yaml | 4 + bundle/manifests/elasticsearches.crd.yaml | 210 --------- bundle/manifests/kibanas.crd.yaml | 65 --- bundle/manifests/kustomization.yaml | 16 + ...ging.openshift.io_elasticsearches_crd.yaml | 410 ++++++++++++++++++ .../logging.openshift.io_kibanas_crd.yaml | 165 +++++++ 6 files changed, 595 insertions(+), 275 deletions(-) create mode 100644 bundle/manifests/crd-drop-status-validation-patch.yaml delete mode 100644 bundle/manifests/elasticsearches.crd.yaml delete mode 100644 bundle/manifests/kibanas.crd.yaml create mode 100644 bundle/manifests/kustomization.yaml create mode 100644 bundle/manifests/logging.openshift.io_elasticsearches_crd.yaml create mode 100644 bundle/manifests/logging.openshift.io_kibanas_crd.yaml diff --git a/bundle/manifests/crd-drop-status-validation-patch.yaml b/bundle/manifests/crd-drop-status-validation-patch.yaml new file mode 100644 index 000000000..07362fd7f --- /dev/null +++ b/bundle/manifests/crd-drop-status-validation-patch.yaml @@ -0,0 +1,4 @@ +- op: replace + path: /spec/validation/openAPIV3Schema/properties/status + value: + type: object diff --git a/bundle/manifests/elasticsearches.crd.yaml b/bundle/manifests/elasticsearches.crd.yaml deleted file mode 100644 index 79eb6c9ed..000000000 --- a/bundle/manifests/elasticsearches.crd.yaml +++ /dev/null @@ -1,210 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: elasticsearches.logging.openshift.io -spec: - group: logging.openshift.io - names: - kind: Elasticsearch - listKind: ElasticsearchList - plural: elasticsearches - singular: elasticsearch - scope: Namespaced - version: v1 - validation: - openAPIV3Schema: - type: object - properties: - spec: - description: Specification of the desired behavior of the Elasticsearch cluster - type: object - properties: - managementState: - description: Indicator if the resource is 'Managed' or 'Unmanaged' by the operator - type: string - enum: - - "Managed" - - "Unmanaged" - redundancyPolicy: - description: The policy towards data redundancy to specify the number of redundant primary shards - type: string - enum: - - "FullRedundancy" - - "MultipleRedundancy" - - "SingleRedundancy" - - "ZeroRedundancy" - nodes: - description: Specification of the different Elasticsearch nodes - type: array - items: - type: object - properties: - roles: - description: The specific Elasticsearch cluster roles the node should perform - type: array - items: - type: string - nodeCount: - description: Number of nodes to deploy - format: int32 - type: integer - resources: - description: The resource requirements for the Elasticsearch node - type: object - nullable: true - properties: - limits: - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - requests: - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - nodeSelector: - description: Define which Nodes the Pods are scheduled on. - type: object - tolerations: - type: array - items: - type: object - storage: - description: The type of backing storage that should be used for the node - type: object - properties: - storageClassName: - description: The name of the storage class to use with creating the node's PVC - type: string - size: - description: The max storage capacity for the node - type: string - genUUID: - type: string - nullable: true - proxyResources: - description: The resource requirements for the Elasticsearch proxy - type: object - properties: - limits: - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - requests: - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - indexManagement: - description: Management spec for indicies - type: object - nullable: true - properties: - policies: - description: A list of polices for managing an indices - type: array - items: - type: object - properties: - name: - description: The unique name of the policy - type: string - pollInterval: - description: How often to check an index meets the desired criteria (e.g. 1m) - type: string - phases: - type: object - properties: - delete: - type: object - nullable: true - properties: - minAge: - description: The minimum age of an index before it should be deleted (e.g. 10d) - type: string - hot: - type: object - nullable: true - properties: - actions: - type: object - properties: - rollover: - type: object - nullable: true - properties: - maxAge: - description: The maximum age of an index before it should be rolled over (e.g. 7d) - type: string - mappings: - description: Mappings of policies to indicies - type: array - items: - type: object - properties: - name: - description: The unique name of the policy mapping - type: string - policyRef: - description: A reference to a defined policy - type: string - aliases: - description: Aliases to apply to a template - type: array - items: - type: string - nodeSpec: - description: Default specification applied to all Elasticsearch nodes - type: object - properties: - image: - description: The image to use for the Elasticsearch nodes - type: string - nullable: true - resources: - description: The resource requirements for the Elasticsearch nodes - type: object - nullable: true - properties: - limits: - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - requests: - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - tolerations: - type: array - items: - type: object - nodeSelector: - description: Define which Nodes the Pods are scheduled on. - type: object - nullable: true - proxyResources: - description: The resource requirements for the Elasticsearch proxy - type: object - properties: - limits: - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - requests: - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true diff --git a/bundle/manifests/kibanas.crd.yaml b/bundle/manifests/kibanas.crd.yaml deleted file mode 100644 index 246667fc8..000000000 --- a/bundle/manifests/kibanas.crd.yaml +++ /dev/null @@ -1,65 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: kibanas.logging.openshift.io -spec: - subresources: - status: {} - group: logging.openshift.io - names: - kind: Kibana - listKind: KibanaList - plural: kibanas - singular: kibana - scope: Namespaced - version: v1 - validation: - openAPIV3Schema: - type: object - properties: - spec: - type: object - description: Specification of the desired behavior of the Kibana - properties: - resources: - type: object - description: The resource requirements for Kibana - nullable: true - properties: - limits: - type: object - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - nullable: true - requests: - type: object - nullable: true - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - replicas: - type: integer - description: Number of instances to deploy for a Kibana deployment - format: int32 - proxySpec: - type: object - description: Specification of the Kibana Proxy component - properties: - resources: - type: object - description: The resource requirements for Kibana - nullable: true - properties: - limits: - description: 'Limits describes the maximum amount of compute - resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true - requests: - description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' - type: object - nullable: true diff --git a/bundle/manifests/kustomization.yaml b/bundle/manifests/kustomization.yaml new file mode 100644 index 000000000..5030f49fe --- /dev/null +++ b/bundle/manifests/kustomization.yaml @@ -0,0 +1,16 @@ +resources: +- logging.openshift.io_elasticsearches_crd.yaml +- logging.openshift.io_kibanas_crd.yaml +patchesJson6902: +- path: crd-drop-status-validation-patch.yaml + target: + group: apiextensions.k8s.io + version: v1beta1 + kind: CustomResourceDefinition + name: elasticsearches.logging.openshift.io +- path: crd-drop-status-validation-patch.yaml + target: + group: apiextensions.k8s.io + version: v1beta1 + kind: CustomResourceDefinition + name: kibanas.logging.openshift.io diff --git a/bundle/manifests/logging.openshift.io_elasticsearches_crd.yaml b/bundle/manifests/logging.openshift.io_elasticsearches_crd.yaml new file mode 100644 index 000000000..ed90f7cb4 --- /dev/null +++ b/bundle/manifests/logging.openshift.io_elasticsearches_crd.yaml @@ -0,0 +1,410 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: elasticsearches.logging.openshift.io +spec: + additionalPrinterColumns: + - JSONPath: .spec.managementState + name: Management State + type: string + - JSONPath: .status.cluster.status + name: Health + type: string + - JSONPath: .status.cluster.numNodes + name: Nodes + type: integer + - JSONPath: .status.cluster.numDataNodes + name: Data Nodes + type: integer + - JSONPath: .status.shardAllocationEnabled + name: Shard Allocation + type: string + - JSONPath: .status.indexManagement.State + name: Index Management + type: string + group: logging.openshift.io + names: + categories: + - logging + - tracing + kind: Elasticsearch + listKind: ElasticsearchList + plural: elasticsearches + shortNames: + - es + singular: elasticsearch + scope: Namespaced + subresources: {} + validation: + openAPIV3Schema: + description: Elasticsearch is the Schema for the elasticsearches API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Specification of the desired behavior of the Elasticsearch + cluster + properties: + indexManagement: + description: Management spec for indicies + nullable: true + properties: + mappings: + description: Mappings of policies to indicies + items: + description: IndexManagementPolicyMappingSpec maps a management + policy to an index + properties: + aliases: + description: Aliases to apply to a template + items: + type: string + type: array + name: + description: The unique name of the policy mapping + type: string + policyRef: + description: A reference to a defined policy + type: string + type: object + type: array + policies: + description: A list of polices for managing an indices + items: + description: IndexManagementPolicySpec is a definition of an index + management policy + properties: + name: + description: The unique name of the policy + type: string + phases: + properties: + delete: + nullable: true + properties: + minAge: + description: The minimum age of an index before it + should be deleted (e.g. 10d) + pattern: ^([0-9]+)([yMwdhHms]{0,1})$ + type: string + required: + - minAge + type: object + hot: + nullable: true + properties: + actions: + properties: + rollover: + nullable: true + properties: + maxAge: + description: The maximum age of an index before + it should be rolled over (e.g. 7d) + pattern: ^([0-9]+)([yMwdhHms]{0,1})$ + type: string + required: + - maxAge + type: object + type: object + type: object + type: object + pollInterval: + description: How often to check an index meets the desired + criteria (e.g. 1m) + pattern: ^([0-9]+)([yMwdhHms]{0,1})$ + type: string + required: + - name + - phases + - pollInterval + type: object + type: array + type: object + managementState: + description: ManagementState indicates whether and how the operator + should manage the component. Indicator if the resource is 'Managed' + or 'Unmanaged' by the operator. + enum: + - Managed + - Unmanaged + type: string + nodeSpec: + description: Default specification applied to all Elasticsearch nodes + properties: + image: + description: The image to use for the Elasticsearch nodes + nullable: true + type: string + nodeSelector: + additionalProperties: + type: string + description: Define which Nodes the Pods are scheduled on. + nullable: true + type: object + proxyResources: + description: The resource requirements for the Elasticsearch proxy + nullable: true + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + resources: + description: The resource requirements for the Elasticsearch nodes + nullable: true + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + tolerations: + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using the + matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the + value. Valid operators are Exists and Equal. Defaults to + Equal. Exists is equivalent to wildcard for value, so that + a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time + the toleration (which must be of effect NoExecute, otherwise + this field is ignored) tolerates the taint. By default, + it is not set, which means tolerate the taint forever (do + not evict). Zero and negative values will be treated as + 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + nodes: + description: Specification of the different Elasticsearch nodes + items: + description: ElasticsearchNode struct represents individual node in + Elasticsearch cluster + properties: + genUUID: + description: GenUUID will be populated by the operator if not + provided + nullable: true + type: string + nodeCount: + description: Number of nodes to deploy + format: int32 + type: integer + nodeSelector: + additionalProperties: + type: string + description: Define which Nodes the Pods are scheduled on. + type: object + proxyResources: + description: The resource requirements for the Elasticsearch proxy + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + resources: + description: The resource requirements for the Elasticsearch node + nullable: true + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + roles: + description: The specific Elasticsearch cluster roles the node + should perform + items: + enum: + - master + - client + - data + type: string + type: array + storage: + description: The type of backing storage that should be used for + the node + properties: + size: + anyOf: + - type: integer + - type: string + description: The max storage capacity for the node to provision. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + storageClassName: + description: 'The name of the storage class to use with creating + the node''s PVC. More info: https://kubernetes.io/docs/concepts/storage/storage-classes/' + type: string + type: object + tolerations: + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using + the matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. + Empty means match all taint effects. When specified, allowed + values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to + the value. Valid operators are Exists and Equal. Defaults + to Equal. Exists is equivalent to wildcard for value, + so that a pod can tolerate all taints of a particular + category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of + time the toleration (which must be of effect NoExecute, + otherwise this field is ignored) tolerates the taint. + By default, it is not set, which means tolerate the taint + forever (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + type: object + type: array + redundancyPolicy: + description: The policy towards data redundancy to specify the number + of redundant primary shards + enum: + - FullRedundancy + - MultipleRedundancy + - SingleRedundancy + - ZeroRedundancy + type: string + required: + - managementState + - redundancyPolicy + type: object + status: + type: object + type: object + version: v1 + versions: + - name: v1 + served: true + storage: true diff --git a/bundle/manifests/logging.openshift.io_kibanas_crd.yaml b/bundle/manifests/logging.openshift.io_kibanas_crd.yaml new file mode 100644 index 000000000..81cd432be --- /dev/null +++ b/bundle/manifests/logging.openshift.io_kibanas_crd.yaml @@ -0,0 +1,165 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: kibanas.logging.openshift.io +spec: + additionalPrinterColumns: + - JSONPath: .spec.managementState + name: Management State + type: string + - JSONPath: .spec.replicas + name: Replicas + type: integer + group: logging.openshift.io + names: + categories: + - logging + kind: Kibana + listKind: KibanaList + plural: kibanas + singular: kibana + scope: Namespaced + subresources: {} + validation: + openAPIV3Schema: + description: Kibana is the Schema for the kibanas API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Specification of the desired behavior of the Kibana + properties: + managementState: + description: Indicator if the resource is 'Managed' or 'Unmanaged' by + the operator + enum: + - Managed + - Unmanaged + type: string + nodeSelector: + additionalProperties: + type: string + description: Define which Nodes the Pods are scheduled on. + type: object + proxy: + description: Specification of the Kibana Proxy component + properties: + resources: + description: The resource requirements for Kibana proxy + nullable: true + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute + resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + type: object + replicas: + description: Number of instances to deploy for a Kibana deployment + format: int32 + type: integer + resources: + description: The resource requirements for Kibana + nullable: true + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount of compute resources + allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: '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. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + tolerations: + items: + description: The pod this Toleration is attached to tolerates any + taint that matches the triple using the matching + operator . + properties: + effect: + description: Effect indicates the taint effect to match. Empty + means match all taint effects. When specified, allowed values + are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, operator + must be Exists; this combination means to match all values and + all keys. + type: string + operator: + description: Operator represents a key's relationship to the value. + Valid operators are Exists and Equal. Defaults to Equal. Exists + is equivalent to wildcard for value, so that a pod can tolerate + all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time the + toleration (which must be of effect NoExecute, otherwise this + field is ignored) tolerates the taint. By default, it is not + set, which means tolerate the taint forever (do not evict). + Zero and negative values will be treated as 0 (evict immediately) + by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches to. + If the operator is Exists, the value should be empty, otherwise + just a regular string. + type: string + type: object + type: array + required: + - managementState + type: object + status: + type: object + type: object + version: v1 + versions: + - name: v1 + served: true + storage: true