Skip to content

Commit

Permalink
Add dashboard image in ElasticsearchVersion (#824)
Browse files Browse the repository at this point in the history
Co-authored-by: kamolhasan <kamol@appscode.com>
  • Loading branch information
raihankhan and kamolhasan committed Jan 21, 2022
1 parent 13b91fd commit e6e6d09
Show file tree
Hide file tree
Showing 36 changed files with 942 additions and 1,820 deletions.
15 changes: 15 additions & 0 deletions apis/catalog/v1alpha1/elasticsearch_version_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,18 @@ type ElasticsearchVersionSpec struct {
AuthPlugin ElasticsearchAuthPlugin `json:"authPlugin"`
// Database Image
DB ElasticsearchVersionDatabase `json:"db"`
// Dashboard Image
// +optional
Dashboard ElasticsearchDashboardVersionDatabase `json:"dashboard"`
// Exporter Image
Exporter ElasticsearchVersionExporter `json:"exporter"`
// Deprecated versions usable but regarded as obsolete and best avoided, typically due to having been superseded.
// +optional
Deprecated bool `json:"deprecated,omitempty"`
// Init container Image
InitContainer ElasticsearchVersionInitContainer `json:"initContainer"`
// Init container Image
DashboardInitContainer ElasticsearchVersionDashboardInitContainer `json:"dashboardInitContainer"`
// PSP names
PodSecurityPolicies ElasticsearchVersionPodSecurityPolicy `json:"podSecurityPolicies"`
// Stash defines backup and restore task definitions.
Expand All @@ -92,6 +97,11 @@ type ElasticsearchVersionInitContainer struct {
YQImage string `json:"yqImage"`
}

// ElasticsearchVersionDashboardInitContainer is the ElasticsearchDashboard Container initializer
type ElasticsearchVersionDashboardInitContainer struct {
YQImage string `json:"yqImage"`
}

// ElasticsearchVersionPodSecurityPolicy is the Elasticsearch pod security policies
type ElasticsearchVersionPodSecurityPolicy struct {
DatabasePolicyName string `json:"databasePolicyName"`
Expand All @@ -116,6 +126,11 @@ type ElasticsearchSecurityContext struct {
RunAsAnyNonRoot bool `json:"runAsAnyNonRoot,omitempty"`
}

// ElasticsearchDashboardVersionDatabase is the Elasticsearch Dashboard image
type ElasticsearchDashboardVersionDatabase struct {
Image string `json:"image"`
}

// +kubebuilder:validation:Enum=OpenDistro;SearchGuard;X-Pack;OpenSearch
type ElasticsearchAuthPlugin string

Expand Down
990 changes: 524 additions & 466 deletions apis/catalog/v1alpha1/openapi_generated.go

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions apis/catalog/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions apis/dashboard/v1alpha1/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
Copyright AppsCode Inc. and Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha1

import (
"time"

core "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
)

var (
DefaultResources = core.ResourceRequirements{
Requests: core.ResourceList{
core.ResourceCPU: resource.MustParse(".500"),
core.ResourceMemory: resource.MustParse("1024Mi"),
},
Limits: core.ResourceList{
core.ResourceMemory: resource.MustParse("1024Mi"),
},
}
)

const (
ES_USER_ENV = "ELASTICSEARCH_USERNAME"
ES_PASSWORD_ENV = "ELASTICSEARCH_PASSWORD"
CaCertKey = "ca.crt"
ComponentDashboard = "dashboard"
KibanaStatusEndpoint = "/api/status"
KibanaConfigFileName = "kibana.yml"
DefaultElasticsearchClientCertAlias = "archiver"
HealthCheckInterval = 10 * time.Second
GlobalHost = "0.0.0.0"
)

var (
ElasticsearchDashboardKibanaConfigDir = "/usr/share/kibana/config"
ElasticsearchDashboardPropagationPolicy = meta.DeletePropagationForeground
ElasticsearchDashboardDefaultPort = (int32)(5601)
ElasticsearchDashboardGracefulDeletionPeriod = (int64)(time.Duration(3 * time.Second))
)
Loading

0 comments on commit e6e6d09

Please sign in to comment.