diff --git a/ci.cue b/ci.cue index 5f609d5fb9..d24c26a2e6 100644 --- a/ci.cue +++ b/ci.cue @@ -561,6 +561,11 @@ dagger.#Plan & { ] } }, + docker.#Copy & { + contents: client.filesystem.".".read.contents + source: "images/opensearch/entrypoint.sh" + dest: "/usr/share/opensearch/opensearch-docker-entrypoint.sh" + }, ] } push: docker.#Push & { diff --git a/config/crd/bases/logging.opni.io_opniopensearches.yaml b/config/crd/bases/logging.opni.io_opniopensearches.yaml index 2bbb609606..9052f1ee11 100644 --- a/config/crd/bases/logging.opni.io_opniopensearches.yaml +++ b/config/crd/bases/logging.opni.io_opniopensearches.yaml @@ -471,6 +471,8 @@ spec: type: array type: object type: object + basePath: + type: string enable: type: boolean env: @@ -1125,6 +1127,57 @@ spec: type: string type: object type: array + topologySpreadConstraints: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + maxSkew: + format: int32 + type: integer + minDomains: + format: int32 + type: integer + nodeAffinityPolicy: + type: string + nodeTaintsPolicy: + type: string + topologyKey: + type: string + whenUnsatisfiable: + type: string + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + type: object + type: array required: - component - replicas diff --git a/images/opensearch/Dockerfile.dashboards b/images/opensearch/Dockerfile.dashboards deleted file mode 100644 index 957f344839..0000000000 --- a/images/opensearch/Dockerfile.dashboards +++ /dev/null @@ -1,5 +0,0 @@ -ARG VERSION - -FROM opensearchproject/opensearch-dashboards:${VERSION} - -RUN opensearch-dashboards-plugin install https://github.com/rancher/opni-ui/releases/download/plugin-0.4.1/opni-dashboards-plugin-0.4.1-os-${VERSION}.zip \ No newline at end of file diff --git a/images/opensearch/entrypoint.sh b/images/opensearch/entrypoint.sh new file mode 100644 index 0000000000..4e8f2e6e0a --- /dev/null +++ b/images/opensearch/entrypoint.sh @@ -0,0 +1,147 @@ +#!/bin/bash + +# Copyright OpenSearch Contributors +# SPDX-License-Identifier: Apache-2.0 + +# This script specify the entrypoint startup actions for opensearch +# It will start both opensearch and performance analyzer plugin cli +# If either process failed, the entire docker container will be removed +# in favor of a newly started container + +# Export OpenSearch Home +export OPENSEARCH_HOME=/usr/share/opensearch +export OPENSEARCH_PATH_CONF=$OPENSEARCH_HOME/config + +# The virtual file /proc/self/cgroup should list the current cgroup +# membership. For each hierarchy, you can follow the cgroup path from +# this file to the cgroup filesystem (usually /sys/fs/cgroup/) and +# introspect the statistics for the cgroup for the given +# hierarchy. Alas, Docker breaks this by mounting the container +# statistics at the root while leaving the cgroup paths as the actual +# paths. Therefore, OpenSearch provides a mechanism to override +# reading the cgroup path from /proc/self/cgroup and instead uses the +# cgroup path defined the JVM system property +# opensearch.cgroups.hierarchy.override. Therefore, we set this value here so +# that cgroup statistics are available for the container this process +# will run in. +export OPENSEARCH_JAVA_OPTS="-Dopensearch.cgroups.hierarchy.override=/ $OPENSEARCH_JAVA_OPTS" + +# Holds the PID of opensearch and performance analyzer processes. +declare OPENSEARCH_PID +declare PA_PID + +##Security Plugin +function setupSecurityPlugin { + SECURITY_PLUGIN="opensearch-security" + + if [ -d "$OPENSEARCH_HOME/plugins/$SECURITY_PLUGIN" ]; then + if [ "$DISABLE_INSTALL_DEMO_CONFIG" = "true" ]; then + echo "Disabling execution of install_demo_configuration.sh for OpenSearch Security Plugin" + else + echo "Enabling execution of install_demo_configuration.sh for OpenSearch Security Plugin" + bash $OPENSEARCH_HOME/plugins/$SECURITY_PLUGIN/tools/install_demo_configuration.sh -y -i -s + fi + + if [ "$DISABLE_SECURITY_PLUGIN" = "true" ]; then + echo "Disabling OpenSearch Security Plugin" + opensearch_opt="-Eplugins.security.disabled=true" + opensearch_opts+=("${opensearch_opt}") + else + echo "Enabling OpenSearch Security Plugin" + fi + fi +} + +# Trap function that is used to terminate opensearch and performance analyzer +# when a relevant signal is caught. +function terminateProcesses { + if kill -0 $OPENSEARCH_PID >& /dev/null; then + echo "Killing opensearch process $OPENSEARCH_PID" + kill -TERM $OPENSEARCH_PID + wait $OPENSEARCH_PID + fi + if ! [ "$DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI" = "true" ]; then + if kill -0 $PA_PID >& /dev/null; then + echo "Killing performance analyzer process $PA_PID" + kill -TERM $PA_PID + wait $PA_PID + fi + fi +} + +# Start up the opensearch and performance analyzer agent processes. +# When either of them halts, this script exits, or we receive a SIGTERM or SIGINT signal then we want to kill both these processes. +function runOpensearch { + # Files created by OpenSearch should always be group writable too + umask 0002 + + if [[ "$(id -u)" == "0" ]]; then + echo "OpenSearch cannot run as root. Please start your container as another user." + exit 1 + fi + + # Parse Docker env vars to customize OpenSearch + # + # e.g. Setting the env var cluster.name=testcluster + # will cause OpenSearch to be invoked with -Ecluster.name=testcluster + opensearch_opts=() + while IFS='=' read -r envvar_key envvar_value + do + # OpenSearch settings need to have at least two dot separated lowercase + # words, e.g. `cluster.name`, except for `processors` which we handle + # specially + if [[ "$envvar_key" =~ ^[a-z0-9_]+\.[a-z0-9_]+ || "$envvar_key" == "processors" ]]; then + if [[ ! -z $envvar_value ]]; then + opensearch_opt="-E${envvar_key}=${envvar_value}" + opensearch_opts+=("${opensearch_opt}") + fi + fi + done < <(env) + + setupSecurityPlugin + + # Enable job control so we receive SIGCHLD when a child process terminates + set -m + + # Make sure we terminate the child processes in the event of us received TERM (e.g. "docker container stop"), INT (e.g. ctrl-C), EXIT (this script terminates for an unexpected reason), or CHLD (one of the processes terminated unexpectedly) + trap terminateProcesses TERM INT EXIT CHLD + + # Start opensearch + "$@" "${opensearch_opts[@]}" & + OPENSEARCH_PID=$! + + # Start performance analyzer agent + if [ "$DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI" = "true" ]; then + echo "Disabling performance analyzer cli" + else + $OPENSEARCH_HOME/bin/opensearch-performance-analyzer/performance-analyzer-agent-cli > $OPENSEARCH_HOME/logs/performance-analyzer.log 2>&1 & + PA_PID=$! + fi + + # Wait for the child processes to terminate + wait $OPENSEARCH_PID + local opensearch_exit_code=$? + echo "OpenSearch exited with code ${opensearch_exit_code}" + + wait $PA_PID + echo "Performance analyzer exited with code $?" + + # This script should exit with the same code as the opensearch command, but + # it would be a breaking change. Next line should be uncommented for the + # next major release. + # exit ${opensearch_exit_code} +} + +# Prepend "opensearch" command if no argument was provided or if the first +# argument looks like a flag (i.e. starts with a dash). +if [ $# -eq 0 ] || [ "${1:0:1}" = '-' ]; then + set -- opensearch "$@" +fi + +if [ "$1" = "opensearch" ]; then + # If the first argument is opensearch, then run the setup script. + runOpensearch "$@" +else + # Otherwise, just exec the command. + exec "$@" +fi \ No newline at end of file diff --git a/pkg/resources/gateway/rbac.go b/pkg/resources/gateway/rbac.go index 586e6bf715..5212c514f0 100644 --- a/pkg/resources/gateway/rbac.go +++ b/pkg/resources/gateway/rbac.go @@ -60,7 +60,6 @@ func (r *Reconciler) rbac() ([]resources.Resource, error) { }, Resources: []string{ "*", - "gateways", }, Verbs: []string{ "get", @@ -70,6 +69,7 @@ func (r *Reconciler) rbac() ([]resources.Resource, error) { "update", "patch", "delete", + "deletecollection", }, }, { diff --git a/plugins/logging/pkg/apis/loggingadmin/loggingadmin.pb.go b/plugins/logging/pkg/apis/loggingadmin/loggingadmin.pb.go index aff058fc11..d4c5261a4a 100644 --- a/plugins/logging/pkg/apis/loggingadmin/loggingadmin.pb.go +++ b/plugins/logging/pkg/apis/loggingadmin/loggingadmin.pb.go @@ -104,8 +104,8 @@ type OpensearchClusterV2 struct { DataNodes *DataDetails `protobuf:"bytes,2,opt,name=dataNodes,proto3" json:"dataNodes,omitempty"` IngestNodes *IngestDetails `protobuf:"bytes,3,opt,name=ingestNodes,proto3,oneof" json:"ingestNodes,omitempty"` ControlplaneNodes *ControlplaneDetails `protobuf:"bytes,4,opt,name=controlplaneNodes,proto3,oneof" json:"controlplaneNodes,omitempty"` - Dashboards *DashboardsDetails `protobuf:"bytes,5,opt,name=Dashboards,proto3,oneof" json:"Dashboards,omitempty"` - DataRetention *string `protobuf:"bytes,6,opt,name=DataRetention,proto3,oneof" json:"DataRetention,omitempty"` + Dashboards *DashboardsDetails `protobuf:"bytes,5,opt,name=dashboards,proto3,oneof" json:"dashboards,omitempty"` + DataRetention *string `protobuf:"bytes,6,opt,name=dataRetention,proto3,oneof" json:"dataRetention,omitempty"` } func (x *OpensearchClusterV2) Reset() { @@ -187,8 +187,8 @@ type DataPersistence struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Enabled *bool `protobuf:"varint,1,opt,name=Enabled,proto3,oneof" json:"Enabled,omitempty"` - StorageClass *string `protobuf:"bytes,2,opt,name=StorageClass,proto3,oneof" json:"StorageClass,omitempty"` + Enabled *bool `protobuf:"varint,1,opt,name=enabled,proto3,oneof" json:"enabled,omitempty"` + StorageClass *string `protobuf:"bytes,2,opt,name=storageClass,proto3,oneof" json:"storageClass,omitempty"` } func (x *DataPersistence) Reset() { @@ -242,8 +242,8 @@ type CPUResource struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Request string `protobuf:"bytes,1,opt,name=Request,proto3" json:"Request,omitempty"` - Limit string `protobuf:"bytes,2,opt,name=Limit,proto3" json:"Limit,omitempty"` + Request string `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + Limit string `protobuf:"bytes,2,opt,name=limit,proto3" json:"limit,omitempty"` } func (x *CPUResource) Reset() { @@ -416,9 +416,9 @@ type DashboardsDetails struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Enabled *bool `protobuf:"varint,1,opt,name=Enabled,proto3,oneof" json:"Enabled,omitempty"` - Replicas *int32 `protobuf:"varint,2,opt,name=Replicas,proto3,oneof" json:"Replicas,omitempty"` - Resources *ResourceRequirements `protobuf:"bytes,3,opt,name=Resources,proto3" json:"Resources,omitempty"` + Enabled *bool `protobuf:"varint,1,opt,name=enabled,proto3,oneof" json:"enabled,omitempty"` + Replicas *int32 `protobuf:"varint,2,opt,name=replicas,proto3,oneof" json:"replicas,omitempty"` + Resources *ResourceRequirements `protobuf:"bytes,3,opt,name=resources,proto3" json:"resources,omitempty"` } func (x *DashboardsDetails) Reset() { @@ -479,7 +479,7 @@ type UpgradeAvailableResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UpgradePending bool `protobuf:"varint,1,opt,name=UpgradePending,proto3" json:"UpgradePending,omitempty"` + UpgradePending bool `protobuf:"varint,1,opt,name=upgradePending,proto3" json:"upgradePending,omitempty"` } func (x *UpgradeAvailableResponse) Reset() { @@ -526,7 +526,7 @@ type StorageClassResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - StorageClasses []string `protobuf:"bytes,1,rep,name=StorageClasses,proto3" json:"StorageClasses,omitempty"` + StorageClasses []string `protobuf:"bytes,1,rep,name=storageClasses,proto3" json:"storageClasses,omitempty"` } func (x *StorageClassResponse) Reset() { @@ -573,8 +573,8 @@ type ResourceRequirements struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Requests *ComputeResourceQuantities `protobuf:"bytes,1,opt,name=Requests,proto3" json:"Requests,omitempty"` - Limits *ComputeResourceQuantities `protobuf:"bytes,2,opt,name=Limits,proto3" json:"Limits,omitempty"` + Requests *ComputeResourceQuantities `protobuf:"bytes,1,opt,name=requests,proto3" json:"requests,omitempty"` + Limits *ComputeResourceQuantities `protobuf:"bytes,2,opt,name=limits,proto3" json:"limits,omitempty"` } func (x *ResourceRequirements) Reset() { @@ -628,8 +628,8 @@ type ComputeResourceQuantities struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - CPU string `protobuf:"bytes,1,opt,name=CPU,proto3" json:"CPU,omitempty"` - Memory string `protobuf:"bytes,2,opt,name=Memory,proto3" json:"Memory,omitempty"` + Cpu string `protobuf:"bytes,1,opt,name=cpu,proto3" json:"cpu,omitempty"` + Memory string `protobuf:"bytes,2,opt,name=memory,proto3" json:"memory,omitempty"` } func (x *ComputeResourceQuantities) Reset() { @@ -664,9 +664,9 @@ func (*ComputeResourceQuantities) Descriptor() ([]byte, []int) { return file_github_com_rancher_opni_plugins_logging_pkg_apis_loggingadmin_loggingadmin_proto_rawDescGZIP(), []int{9} } -func (x *ComputeResourceQuantities) GetCPU() string { +func (x *ComputeResourceQuantities) GetCpu() string { if x != nil { - return x.CPU + return x.Cpu } return "" } @@ -745,7 +745,7 @@ type DataDetails struct { EnableAntiAffinity *bool `protobuf:"varint,5,opt,name=enableAntiAffinity,proto3,oneof" json:"enableAntiAffinity,omitempty"` NodeSelector map[string]string `protobuf:"bytes,6,rep,name=nodeSelector,proto3" json:"nodeSelector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Tolerations []*v1.Toleration `protobuf:"bytes,7,rep,name=tolerations,proto3" json:"tolerations,omitempty"` - Persistence *DataPersistence `protobuf:"bytes,8,opt,name=Persistence,proto3,oneof" json:"Persistence,omitempty"` + Persistence *DataPersistence `protobuf:"bytes,8,opt,name=persistence,proto3,oneof" json:"persistence,omitempty"` } func (x *DataDetails) Reset() { @@ -931,7 +931,7 @@ type ControlplaneDetails struct { Replicas *int32 `protobuf:"varint,1,opt,name=replicas,proto3,oneof" json:"replicas,omitempty"` NodeSelector map[string]string `protobuf:"bytes,2,rep,name=nodeSelector,proto3" json:"nodeSelector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Tolerations []*v1.Toleration `protobuf:"bytes,3,rep,name=tolerations,proto3" json:"tolerations,omitempty"` - Persistence *DataPersistence `protobuf:"bytes,4,opt,name=Persistence,proto3,oneof" json:"Persistence,omitempty"` + Persistence *DataPersistence `protobuf:"bytes,4,opt,name=persistence,proto3,oneof" json:"persistence,omitempty"` } func (x *ControlplaneDetails) Reset() { @@ -1044,29 +1044,29 @@ var file_github_com_rancher_opni_plugins_logging_pkg_apis_loggingadmin_loggingad 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x48, 0x01, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x88, 0x01, 0x01, - 0x12, 0x44, 0x0a, 0x0a, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x18, 0x05, + 0x12, 0x44, 0x0a, 0x0a, 0x64, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x44, 0x65, - 0x74, 0x61, 0x69, 0x6c, 0x73, 0x48, 0x02, 0x52, 0x0a, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, - 0x72, 0x64, 0x73, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x48, 0x02, 0x52, 0x0a, 0x64, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, + 0x72, 0x64, 0x73, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, - 0x0d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, + 0x0d, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x69, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x70, 0x6c, 0x61, - 0x6e, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x44, 0x61, 0x73, 0x68, - 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x6e, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x64, 0x61, 0x73, 0x68, + 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x76, 0x0a, 0x0f, 0x44, 0x61, 0x74, 0x61, - 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x45, + 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0c, 0x53, 0x74, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x27, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x01, 0x52, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, - 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, - 0x0f, 0x0a, 0x0d, 0x5f, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x48, 0x01, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, + 0x0f, 0x0a, 0x0d, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x3d, 0x0a, 0x0b, 0x43, 0x50, 0x55, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, + 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x82, 0x05, 0x0a, 0x15, 0x4f, 0x70, 0x65, 0x6e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4e, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, @@ -1108,39 +1108,39 @@ var file_github_com_rancher_opni_plugins_logging_pkg_apis_loggingadmin_loggingad 0x13, 0x5f, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6e, 0x74, 0x69, 0x41, 0x66, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xae, 0x01, 0x0a, 0x11, 0x44, 0x61, 0x73, 0x68, 0x62, 0x6f, 0x61, - 0x72, 0x64, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x52, 0x65, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x08, 0x52, - 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x88, 0x01, 0x01, 0x12, 0x40, 0x0a, 0x09, 0x52, 0x65, + 0x72, 0x64, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x72, 0x65, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x08, 0x72, + 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x88, 0x01, 0x01, 0x12, 0x40, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x52, 0x09, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x42, 0x0a, 0x0a, 0x08, - 0x5f, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x52, 0x65, 0x70, + 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x42, 0x0a, 0x0a, 0x08, + 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x22, 0x42, 0x0a, 0x18, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x50, 0x65, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x55, 0x70, 0x67, 0x72, 0x61, + 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x50, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x3e, 0x0a, 0x14, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, - 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, + 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x22, 0x9c, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x43, 0x0a, 0x08, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, + 0x74, 0x73, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x08, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x06, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x72, 0x63, 0x65, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x08, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x3f, 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, - 0x52, 0x06, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x45, 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x70, + 0x52, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x22, 0x45, 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x51, 0x75, 0x61, 0x6e, 0x74, - 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x43, 0x50, 0x55, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x43, 0x50, 0x55, 0x12, 0x16, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x6f, 0x72, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x22, + 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x22, 0x42, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, @@ -1169,10 +1169,10 @@ var file_github_com_rancher_opni_plugins_logging_pkg_apis_loggingadmin_loggingad 0x0b, 0x32, 0x1e, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6c, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x6f, 0x6c, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x44, - 0x0a, 0x0b, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, + 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, - 0x63, 0x65, 0x48, 0x03, 0x52, 0x0b, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, + 0x63, 0x65, 0x48, 0x03, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x88, 0x01, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, @@ -1180,7 +1180,7 @@ var file_github_com_rancher_opni_plugins_logging_pkg_apis_loggingadmin_loggingad 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x63, 0x70, 0x75, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6e, - 0x74, 0x69, 0x41, 0x66, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x50, + 0x74, 0x69, 0x41, 0x66, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x79, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xd6, 0x03, 0x0a, 0x0d, 0x49, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x1f, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, @@ -1224,17 +1224,17 @@ var file_github_com_rancher_opni_plugins_logging_pkg_apis_loggingadmin_loggingad 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x69, 0x6f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6c, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x6f, 0x6c, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x44, 0x0a, 0x0b, 0x50, 0x65, 0x72, 0x73, 0x69, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x44, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x2e, 0x44, 0x61, 0x74, 0x61, - 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x01, 0x52, 0x0b, 0x50, + 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x01, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x88, 0x01, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x73, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, - 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x32, 0x81, 0x06, 0x0a, 0x0c, + 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x32, 0x81, 0x06, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x12, 0x69, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, @@ -1380,24 +1380,24 @@ var file_github_com_rancher_opni_plugins_logging_pkg_apis_loggingadmin_loggingad 11, // 2: loggingadmin.OpensearchClusterV2.dataNodes:type_name -> loggingadmin.DataDetails 12, // 3: loggingadmin.OpensearchClusterV2.ingestNodes:type_name -> loggingadmin.IngestDetails 13, // 4: loggingadmin.OpensearchClusterV2.controlplaneNodes:type_name -> loggingadmin.ControlplaneDetails - 5, // 5: loggingadmin.OpensearchClusterV2.Dashboards:type_name -> loggingadmin.DashboardsDetails + 5, // 5: loggingadmin.OpensearchClusterV2.dashboards:type_name -> loggingadmin.DashboardsDetails 3, // 6: loggingadmin.OpensearchNodeDetails.CPUResources:type_name -> loggingadmin.CPUResource 14, // 7: loggingadmin.OpensearchNodeDetails.NodeSelector:type_name -> loggingadmin.OpensearchNodeDetails.NodeSelectorEntry 18, // 8: loggingadmin.OpensearchNodeDetails.Tolerations:type_name -> k8s.io.api.core.v1.Toleration 2, // 9: loggingadmin.OpensearchNodeDetails.Persistence:type_name -> loggingadmin.DataPersistence - 8, // 10: loggingadmin.DashboardsDetails.Resources:type_name -> loggingadmin.ResourceRequirements - 9, // 11: loggingadmin.ResourceRequirements.Requests:type_name -> loggingadmin.ComputeResourceQuantities - 9, // 12: loggingadmin.ResourceRequirements.Limits:type_name -> loggingadmin.ComputeResourceQuantities + 8, // 10: loggingadmin.DashboardsDetails.resources:type_name -> loggingadmin.ResourceRequirements + 9, // 11: loggingadmin.ResourceRequirements.requests:type_name -> loggingadmin.ComputeResourceQuantities + 9, // 12: loggingadmin.ResourceRequirements.limits:type_name -> loggingadmin.ComputeResourceQuantities 3, // 13: loggingadmin.DataDetails.cpuResources:type_name -> loggingadmin.CPUResource 15, // 14: loggingadmin.DataDetails.nodeSelector:type_name -> loggingadmin.DataDetails.NodeSelectorEntry 18, // 15: loggingadmin.DataDetails.tolerations:type_name -> k8s.io.api.core.v1.Toleration - 2, // 16: loggingadmin.DataDetails.Persistence:type_name -> loggingadmin.DataPersistence + 2, // 16: loggingadmin.DataDetails.persistence:type_name -> loggingadmin.DataPersistence 3, // 17: loggingadmin.IngestDetails.cpuResources:type_name -> loggingadmin.CPUResource 16, // 18: loggingadmin.IngestDetails.nodeSelector:type_name -> loggingadmin.IngestDetails.NodeSelectorEntry 18, // 19: loggingadmin.IngestDetails.tolerations:type_name -> k8s.io.api.core.v1.Toleration 17, // 20: loggingadmin.ControlplaneDetails.nodeSelector:type_name -> loggingadmin.ControlplaneDetails.NodeSelectorEntry 18, // 21: loggingadmin.ControlplaneDetails.tolerations:type_name -> k8s.io.api.core.v1.Toleration - 2, // 22: loggingadmin.ControlplaneDetails.Persistence:type_name -> loggingadmin.DataPersistence + 2, // 22: loggingadmin.ControlplaneDetails.persistence:type_name -> loggingadmin.DataPersistence 19, // 23: loggingadmin.LoggingAdmin.GetOpensearchCluster:input_type -> google.protobuf.Empty 19, // 24: loggingadmin.LoggingAdmin.DeleteOpensearchCluster:input_type -> google.protobuf.Empty 0, // 25: loggingadmin.LoggingAdmin.CreateOrUpdateOpensearchCluster:input_type -> loggingadmin.OpensearchCluster diff --git a/plugins/logging/pkg/apis/loggingadmin/loggingadmin.proto b/plugins/logging/pkg/apis/loggingadmin/loggingadmin.proto index 6ba18c5440..2914e48d17 100644 --- a/plugins/logging/pkg/apis/loggingadmin/loggingadmin.proto +++ b/plugins/logging/pkg/apis/loggingadmin/loggingadmin.proto @@ -99,18 +99,18 @@ message OpensearchClusterV2 { DataDetails dataNodes = 2; optional IngestDetails ingestNodes = 3; optional ControlplaneDetails controlplaneNodes = 4; - optional DashboardsDetails Dashboards = 5; - optional string DataRetention = 6; + optional DashboardsDetails dashboards = 5; + optional string dataRetention = 6; } message DataPersistence { - optional bool Enabled = 1; - optional string StorageClass = 2; + optional bool enabled = 1; + optional string storageClass = 2; } message CPUResource { - string Request = 1; - string Limit = 2; + string request = 1; + string limit = 2; } message OpensearchNodeDetails { @@ -127,27 +127,27 @@ message OpensearchNodeDetails { } message DashboardsDetails { - optional bool Enabled = 1; - optional int32 Replicas = 2; - ResourceRequirements Resources = 3; + optional bool enabled = 1; + optional int32 replicas = 2; + ResourceRequirements resources = 3; } message UpgradeAvailableResponse { - bool UpgradePending = 1; + bool upgradePending = 1; } message StorageClassResponse { - repeated string StorageClasses = 1; + repeated string storageClasses = 1; } message ResourceRequirements { - ComputeResourceQuantities Requests = 1; - ComputeResourceQuantities Limits = 2; + ComputeResourceQuantities requests = 1; + ComputeResourceQuantities limits = 2; } message ComputeResourceQuantities { - string CPU = 1; - string Memory = 2; + string cpu = 1; + string memory = 2; } message StatusResponse { @@ -163,7 +163,7 @@ message DataDetails { optional bool enableAntiAffinity = 5; map nodeSelector = 6; repeated k8s.io.api.core.v1.Toleration tolerations = 7; - optional DataPersistence Persistence = 8; + optional DataPersistence persistence = 8; } message IngestDetails { @@ -179,5 +179,5 @@ message ControlplaneDetails { optional int32 replicas = 1; map nodeSelector = 2; repeated k8s.io.api.core.v1.Toleration tolerations = 3; - optional DataPersistence Persistence = 4; + optional DataPersistence persistence = 4; } \ No newline at end of file diff --git a/plugins/logging/pkg/errors/errors.go b/plugins/logging/pkg/errors/errors.go index 5442f5267e..ded4a32d91 100644 --- a/plugins/logging/pkg/errors/errors.go +++ b/plugins/logging/pkg/errors/errors.go @@ -68,6 +68,14 @@ func ErrMissingDataNode() error { return fmt.Errorf("request must contain data nodes: %w", ErrInvalidCluster) } +func ErrRequestGtLimits() error { + return fmt.Errorf("cpu requests must not be more than cpu limits: %w", ErrInvalidCluster) +} + +func ErrReplicasZero(nodeType string) error { + return fmt.Errorf("replicas for %s must be a positive nonzero integer: %w", nodeType, ErrInvalidCluster) +} + func ErrOpensearchRequestFailed(status string) error { return fmt.Errorf("%s: %w", status, ErrOpensearchResponse) } diff --git a/plugins/logging/pkg/gateway/admin.go b/plugins/logging/pkg/gateway/admin.go index 4770c462ab..1a67607fad 100644 --- a/plugins/logging/pkg/gateway/admin.go +++ b/plugins/logging/pkg/gateway/admin.go @@ -455,8 +455,8 @@ func (p *Plugin) convertProtobufToDashboards( return nil } list := corev1.ResourceList{} - if dashboard.Resources.Requests.CPU != "" { - list[corev1.ResourceCPU] = resource.MustParse(dashboard.Resources.Requests.CPU) + if dashboard.Resources.Requests.Cpu != "" { + list[corev1.ResourceCPU] = resource.MustParse(dashboard.Resources.Requests.Cpu) } if dashboard.Resources.Requests.Memory != "" { list[corev1.ResourceMemory] = resource.MustParse(dashboard.Resources.Requests.Memory) @@ -471,8 +471,8 @@ func (p *Plugin) convertProtobufToDashboards( return nil } list := corev1.ResourceList{} - if dashboard.Resources.Limits.CPU != "" { - list[corev1.ResourceCPU] = resource.MustParse(dashboard.Resources.Limits.CPU) + if dashboard.Resources.Limits.Cpu != "" { + list[corev1.ResourceCPU] = resource.MustParse(dashboard.Resources.Limits.Cpu) } if dashboard.Resources.Limits.Memory != "" { list[corev1.ResourceMemory] = resource.MustParse(dashboard.Resources.Limits.Memory) @@ -711,7 +711,7 @@ func convertDashboardsToProtobuf(dashboard opsterv1.DashboardsConfig) *loggingad resources := &loggingadmin.ResourceRequirements{} if dashboard.Resources.Requests != nil { resources.Requests = &loggingadmin.ComputeResourceQuantities{ - CPU: func() string { + Cpu: func() string { if dashboard.Resources.Requests.Cpu().IsZero() { return "" } @@ -727,7 +727,7 @@ func convertDashboardsToProtobuf(dashboard opsterv1.DashboardsConfig) *loggingad } if dashboard.Resources.Limits != nil { resources.Requests = &loggingadmin.ComputeResourceQuantities{ - CPU: func() string { + Cpu: func() string { if dashboard.Resources.Limits.Cpu().IsZero() { return "" } diff --git a/plugins/logging/pkg/gateway/admin_v2.go b/plugins/logging/pkg/gateway/admin_v2.go index 26c951258b..e315c28aea 100644 --- a/plugins/logging/pkg/gateway/admin_v2.go +++ b/plugins/logging/pkg/gateway/admin_v2.go @@ -166,6 +166,7 @@ func (m *LoggingManagerV2) CreateOrUpdateOpensearchCluster(ctx context.Context, if cluster.GetDataNodes() == nil { return &emptypb.Empty{}, errors.ErrMissingDataNode() } + k8sOpensearchCluster := &loggingv1beta1.OpniOpensearch{} go m.opensearchManager.SetClient(m.setOpensearchClient) @@ -234,7 +235,7 @@ func (m *LoggingManagerV2) CreateOrUpdateOpensearchCluster(ctx context.Context, return nil, err } - go m.opensearchManager.CreateInitialAdmin(password) + go m.opensearchManager.CreateInitialAdmin(password, m.opensearchClusterReady) return &emptypb.Empty{}, nil } @@ -565,6 +566,11 @@ func (m *LoggingManagerV2) generateNodePools(cluster *loggingadmin.OpensearchClu return } + if lo.FromPtrOr(cluster.DataNodes.Replicas, 1) < 1 { + retErr = errors.ErrReplicasZero("data") + return + } + initialPool := opsterv1.NodePool{ Component: "data", Replicas: lo.FromPtrOr(cluster.DataNodes.Replicas, 1), @@ -583,6 +589,12 @@ func (m *LoggingManagerV2) generateNodePools(cluster *loggingadmin.OpensearchClu return nil }(), Persistence: convertPersistence(cluster.GetDataNodes().GetPersistence()), + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, } var extraControlPlanePool, splitPool bool @@ -594,7 +606,7 @@ func (m *LoggingManagerV2) generateNodePools(cluster *loggingadmin.OpensearchClu } if cluster.GetControlplaneNodes() == nil { roles = append(roles, "master") - if lo.FromPtrOr(cluster.DataNodes.Replicas, 1)%2 == 0 { + if lo.FromPtrOr(cluster.DataNodes.Replicas, 1)%2 == 0 || lo.FromPtrOr(cluster.DataNodes.Replicas, 1) < 3 { extraControlPlanePool = true } if lo.FromPtrOr(cluster.DataNodes.Replicas, 1) > 5 { @@ -616,7 +628,14 @@ func (m *LoggingManagerV2) generateNodePools(cluster *loggingadmin.OpensearchClu } if extraControlPlanePool { - resources, jvm, err := generateK8sResources("512Mi", &loggingadmin.CPUResource{ + _, jvm, err := generateK8sResources("512Mi", &loggingadmin.CPUResource{ + Request: "100m", + }) + if err != nil { + retErr = err + return + } + resources, _, err := generateK8sResources("640Mi", &loggingadmin.CPUResource{ Request: "100m", }) if err != nil { @@ -626,8 +645,8 @@ func (m *LoggingManagerV2) generateNodePools(cluster *loggingadmin.OpensearchClu cpPool := opsterv1.NodePool{ Component: "quorum", Replicas: func() int32 { - if lo.FromPtrOr(cluster.DataNodes.Replicas, 1) == 1 { - return 2 + if lo.FromPtrOr(cluster.DataNodes.Replicas, 1) < 3 { + return 3 - lo.FromPtrOr(cluster.DataNodes.Replicas, 1) } return 1 }(), @@ -648,6 +667,16 @@ func (m *LoggingManagerV2) generateNodePools(cluster *loggingadmin.OpensearchClu } return nil }(), + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + { + Name: "DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI", + Value: "true", + }, + }, } pools = append(pools, cpPool) } @@ -695,20 +724,26 @@ func generateK8sResources(memoryLimit string, cpu *loggingadmin.CPUResource) (co } if cpu != nil { + var request, limit resource.Quantity if cpu.Request != "" { - request, err := resource.ParseQuantity(cpu.Request) + request, err = resource.ParseQuantity(cpu.Request) if err != nil { return corev1.ResourceRequirements{}, "", err } resources.Requests[corev1.ResourceCPU] = request } if cpu.Limit != "" { - limit, err := resource.ParseQuantity(cpu.Limit) + limit, err = resource.ParseQuantity(cpu.Limit) if err != nil { return corev1.ResourceRequirements{}, "", err } resources.Limits[corev1.ResourceCPU] = limit } + if cpu.Request != "" && cpu.Limit != "" { + if request.Cmp(limit) > 0 { + return corev1.ResourceRequirements{}, "", errors.ErrRequestGtLimits() + } + } } jvm := fmt.Sprintf("-Xmx%d -Xms%d", jvmVal, jvmVal) return resources, jvm, nil @@ -774,6 +809,10 @@ func (m *LoggingManagerV2) convertIngestDetails(details *loggingadmin.IngestDeta return opsterv1.NodePool{}, err } + if lo.FromPtrOr(details.Replicas, 1) < 1 { + return opsterv1.NodePool{}, errors.ErrReplicasZero("ingest") + } + return opsterv1.NodePool{ Component: "ingest", Roles: []string{ @@ -799,11 +838,30 @@ func (m *LoggingManagerV2) convertIngestDetails(details *loggingadmin.IngestDeta EmptyDir: &corev1.EmptyDirVolumeSource{}, }, }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, }, nil } func (m *LoggingManagerV2) convertControlplaneDetails(details *loggingadmin.ControlplaneDetails) (opsterv1.NodePool, error) { - resources, jvm, err := generateK8sResources("512Mi", &loggingadmin.CPUResource{ + _, jvm, err := generateK8sResources("512Mi", &loggingadmin.CPUResource{ + Request: "100m", + }) + if err != nil { + return opsterv1.NodePool{}, err + } + + if lo.FromPtrOr(details.Replicas, 1) < 1 { + return opsterv1.NodePool{}, errors.ErrReplicasZero("controlplane") + } + + // Give the controlplane nodes slightly more memory that double the jvm + // testing has shown the GC can spike at lower memory levels + resources, _, err := generateK8sResources("640Mi", &loggingadmin.CPUResource{ Request: "100m", }) if err != nil { @@ -826,6 +884,16 @@ func (m *LoggingManagerV2) convertControlplaneDetails(details *loggingadmin.Cont Tolerations: convertTolerations(details.Tolerations), Affinity: m.generateAntiAffinity("controlplane"), Persistence: convertPersistence(details.Persistence), + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + { + Name: "DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI", + Value: "true", + }, + }, }, nil } @@ -838,6 +906,42 @@ func (m *LoggingManagerV2) validDurationString(duration string) bool { return match } +func (m *LoggingManagerV2) opensearchClusterReady() bool { + ctx := context.TODO() + expBackoff := backoff.Exponential( + backoff.WithMaxRetries(0), + backoff.WithMinInterval(5*time.Second), + backoff.WithMaxInterval(1*time.Minute), + backoff.WithMultiplier(1.1), + ) + b := expBackoff.Start(ctx) + + cluster := &opsterv1.OpenSearchCluster{} + +FETCH: + for { + select { + case <-b.Done(): + m.logger.Warn("plugin context cancelled before Opensearch object created") + return true + case <-b.Next(): + err := m.k8sClient.Get(ctx, types.NamespacedName{ + Name: m.opensearchCluster.Name, + Namespace: m.storageNamespace, + }, cluster) + if err != nil { + m.logger.Error("failed to fetch opensearch cluster, can't check readiness") + return true + } + if !cluster.Status.Initialized { + continue + } + break FETCH + } + } + return false +} + func (m *LoggingManagerV2) setOpensearchClient() *opensearch.Client { ctx := context.TODO() expBackoff := backoff.Exponential( @@ -869,10 +973,6 @@ FETCH: m.logger.Errorf("failed to check k8s object: %v", err) continue } - if !cluster.Status.Initialized { - m.logger.Info("waiting for cluster to be initialized") - continue - } break FETCH } } @@ -927,7 +1027,7 @@ func (m *LoggingManagerV2) convertProtobufToDashboards( cluster *loggingv1beta1.OpniOpensearch, ) opsterv1.DashboardsConfig { var osVersion string - version := "0.6.3" + version := "0.8.0-rc1" if cluster == nil { osVersion = opensearchVersion } else { @@ -944,7 +1044,7 @@ func (m *LoggingManagerV2) convertProtobufToDashboards( } if version == "unversioned" { - version = "0.6.3" + version = "0.8.0-rc1" } if m.versionOverride != "" { @@ -967,8 +1067,8 @@ func (m *LoggingManagerV2) convertProtobufToDashboards( return nil } list := corev1.ResourceList{} - if dashboard.Resources.Requests.CPU != "" { - list[corev1.ResourceCPU] = resource.MustParse(dashboard.Resources.Requests.CPU) + if dashboard.Resources.Requests.Cpu != "" { + list[corev1.ResourceCPU] = resource.MustParse(dashboard.Resources.Requests.Cpu) } if dashboard.Resources.Requests.Memory != "" { list[corev1.ResourceMemory] = resource.MustParse(dashboard.Resources.Requests.Memory) @@ -983,8 +1083,8 @@ func (m *LoggingManagerV2) convertProtobufToDashboards( return nil } list := corev1.ResourceList{} - if dashboard.Resources.Limits.CPU != "" { - list[corev1.ResourceCPU] = resource.MustParse(dashboard.Resources.Limits.CPU) + if dashboard.Resources.Limits.Cpu != "" { + list[corev1.ResourceCPU] = resource.MustParse(dashboard.Resources.Limits.Cpu) } if dashboard.Resources.Limits.Memory != "" { list[corev1.ResourceMemory] = resource.MustParse(dashboard.Resources.Limits.Memory) diff --git a/plugins/logging/pkg/gateway/admin_v2_test.go b/plugins/logging/pkg/gateway/admin_v2_test.go index a52228ac19..bbb4be15ef 100644 --- a/plugins/logging/pkg/gateway/admin_v2_test.go +++ b/plugins/logging/pkg/gateway/admin_v2_test.go @@ -174,6 +174,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { Labels: map[string]string{ LabelOpniNodeGroup: "data", }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(len(object.Spec.NodePools)).To(Equal(1)) }) @@ -246,6 +252,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { }, }, }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(len(object.Spec.NodePools)).To(Equal(1)) }) @@ -307,6 +319,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { EmptyDir: &corev1.EmptyDirVolumeSource{}, }, }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(len(object.Spec.NodePools)).To(Equal(1)) }) @@ -374,6 +392,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { }, }, }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) }) Specify("cleanup", func() { @@ -432,6 +456,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { Labels: map[string]string{ LabelOpniNodeGroup: "data", }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(len(object.Spec.NodePools)).To(Equal(1)) }) @@ -487,6 +517,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { Labels: map[string]string{ LabelOpniNodeGroup: "data", }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(object.Spec.NodePools[1]).To(Equal(opsterv1.NodePool{ Component: "quorum", @@ -498,16 +534,26 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { }, Resources: corev1.ResourceRequirements{ Limits: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("512Mi"), + corev1.ResourceMemory: resource.MustParse("640Mi"), }, Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("512Mi"), + corev1.ResourceMemory: resource.MustParse("640Mi"), corev1.ResourceCPU: resource.MustParse("100m"), }, }, Labels: map[string]string{ LabelOpniNodeGroup: "data", }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + { + Name: "DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI", + Value: "true", + }, + }, })) Expect(len(object.Spec.NodePools)).To(Equal(2)) }) @@ -562,6 +608,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { Labels: map[string]string{ LabelOpniNodeGroup: "data", }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(object.Spec.NodePools[1]).To(Equal(opsterv1.NodePool{ Component: "datax", @@ -583,6 +635,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { Labels: map[string]string{ LabelOpniNodeGroup: "data", }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(len(object.Spec.NodePools)).To(Equal(2)) }) @@ -639,6 +697,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { Labels: map[string]string{ LabelOpniNodeGroup: "data", }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(object.Spec.NodePools[1]).To(Equal(opsterv1.NodePool{ Component: "ingest", @@ -664,6 +728,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { EmptyDir: &corev1.EmptyDirVolumeSource{}, }, }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(len(object.Spec.NodePools)).To(Equal(2)) }) @@ -719,6 +789,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { Labels: map[string]string{ LabelOpniNodeGroup: "data", }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(object.Spec.NodePools[1]).To(Equal(opsterv1.NodePool{ Component: "controlplane", @@ -730,10 +806,10 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { }, Resources: corev1.ResourceRequirements{ Limits: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("512Mi"), + corev1.ResourceMemory: resource.MustParse("640Mi"), }, Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("512Mi"), + corev1.ResourceMemory: resource.MustParse("640Mi"), corev1.ResourceCPU: resource.MustParse("100m"), }, }, @@ -758,6 +834,16 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { }, }, }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + { + Name: "DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI", + Value: "true", + }, + }, })) Expect(len(object.Spec.NodePools)).To(Equal(2)) }) @@ -817,6 +903,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { Labels: map[string]string{ LabelOpniNodeGroup: "data", }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(object.Spec.NodePools[1]).To(Equal(opsterv1.NodePool{ Component: "controlplane", @@ -828,10 +920,10 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { }, Resources: corev1.ResourceRequirements{ Limits: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("512Mi"), + corev1.ResourceMemory: resource.MustParse("640Mi"), }, Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("512Mi"), + corev1.ResourceMemory: resource.MustParse("640Mi"), corev1.ResourceCPU: resource.MustParse("100m"), }, }, @@ -866,6 +958,16 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { }, }, }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + { + Name: "DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI", + Value: "true", + }, + }, })) Expect(len(object.Spec.NodePools)).To(Equal(2)) }) @@ -935,6 +1037,12 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { }, }, }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + }, })) Expect(len(object.Spec.NodePools)).To(Equal(1)) }) @@ -983,10 +1091,10 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { }, Resources: corev1.ResourceRequirements{ Limits: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("512Mi"), + corev1.ResourceMemory: resource.MustParse("640Mi"), }, Requests: corev1.ResourceList{ - corev1.ResourceMemory: resource.MustParse("512Mi"), + corev1.ResourceMemory: resource.MustParse("640Mi"), corev1.ResourceCPU: resource.MustParse("100m"), }, }, @@ -1021,6 +1129,16 @@ var _ = Describe("Opensearch Admin V2", Ordered, Label("unit"), func() { }, }, }, + Env: []corev1.EnvVar{ + { + Name: "DISABLE_INSTALL_DEMO_CONFIG", + Value: "true", + }, + { + Name: "DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI", + Value: "true", + }, + }, }) }, timeout, interval).Should(BeTrue()) Expect(object.Spec.Security).To(Equal(security)) diff --git a/plugins/logging/pkg/gateway/plugin.go b/plugins/logging/pkg/gateway/plugin.go index 5e75eb93c3..8758f99785 100644 --- a/plugins/logging/pkg/gateway/plugin.go +++ b/plugins/logging/pkg/gateway/plugin.go @@ -226,7 +226,9 @@ func Scheme(ctx context.Context) meta.Scheme { features.PopulateFeatures(ctx, restconfig) } - go p.opensearchManager.SetClient(p.setOpensearchClient) + loggingManager := p.NewLoggingManagerForPlugin() + + go p.opensearchManager.SetClient(loggingManager.setOpensearchClient) scheme.Add(system.SystemPluginID, system.NewPlugin(p)) scheme.Add(capability.CapabilityBackendPluginID, capability.NewPlugin(&p.logging)) @@ -237,7 +239,7 @@ func Scheme(ctx context.Context) meta.Scheme { managementext.ManagementAPIExtensionPluginID, managementext.NewPlugin( util.PackService(&loggingadmin.LoggingAdmin_ServiceDesc, p), - util.PackService(&loggingadmin.LoggingAdminV2_ServiceDesc, p.NewLoggingManagerForPlugin()), + util.PackService(&loggingadmin.LoggingAdminV2_ServiceDesc, loggingManager), ), ) } diff --git a/plugins/logging/pkg/opensearchdata/admin.go b/plugins/logging/pkg/opensearchdata/admin.go index 0493e1e0ad..bbbfd0b29d 100644 --- a/plugins/logging/pkg/opensearchdata/admin.go +++ b/plugins/logging/pkg/opensearchdata/admin.go @@ -10,8 +10,18 @@ import ( opensearchtypes "github.com/rancher/opni/pkg/opensearch/opensearch/types" ) -func (m *Manager) CreateInitialAdmin(password []byte) { +func (m *Manager) CreateInitialAdmin(password []byte, readyFunc ...ReadyFunc) { m.WaitForInit() + + for _, r := range readyFunc { + exitEarly := r() + if exitEarly { + m.logger.Warn("opensearch cluster is never able to receive queries") + return + } + + } + m.Lock() defer m.Unlock() diff --git a/plugins/logging/pkg/opensearchdata/delete.go b/plugins/logging/pkg/opensearchdata/delete.go index 82d128b81f..b66be1eb40 100644 --- a/plugins/logging/pkg/opensearchdata/delete.go +++ b/plugins/logging/pkg/opensearchdata/delete.go @@ -10,8 +10,18 @@ import ( "github.com/tidwall/sjson" ) -func (m *Manager) DoClusterDataDelete(ctx context.Context, id string) error { +func (m *Manager) DoClusterDataDelete(ctx context.Context, id string, readyFunc ...ReadyFunc) error { m.WaitForInit() + + for _, r := range readyFunc { + exitEarly := r() + if exitEarly { + m.logger.Warn("opensearch cluster is never able to receive queries") + return nil + } + + } + m.Lock() defer m.Unlock() @@ -67,8 +77,18 @@ func (m *Manager) DoClusterDataDelete(ctx context.Context, id string) error { return nil } -func (m *Manager) DeleteTaskStatus(ctx context.Context, id string) (DeleteStatus, error) { +func (m *Manager) DeleteTaskStatus(ctx context.Context, id string, readyFunc ...ReadyFunc) (DeleteStatus, error) { m.WaitForInit() + + for _, r := range readyFunc { + exitEarly := r() + if exitEarly { + m.logger.Warn("opensearch cluster is never able to receive queries") + return DeleteFinishedWithErrors, nil + } + + } + m.Lock() defer m.Unlock() diff --git a/plugins/logging/pkg/opensearchdata/opensearchdata.go b/plugins/logging/pkg/opensearchdata/opensearchdata.go index 68a8093366..a8e54011fb 100644 --- a/plugins/logging/pkg/opensearchdata/opensearchdata.go +++ b/plugins/logging/pkg/opensearchdata/opensearchdata.go @@ -29,6 +29,10 @@ const ( type ClusterStatus int +// Ready func should return true if there is a critical error +// That would stop the opensearch query from running. +type ReadyFunc func() bool + const ( ClusterStatusGreen = iota ClusterStatusYellow