resources

package
v0.0.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2022 License: UPL-1.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	OpenSearchIngestCmdTmpl = `#!/usr/bin/env bash -e
	set -euo pipefail
    %s
	/usr/local/bin/docker-entrypoint.sh`
	OpenSearchDashboardCmdTmpl = `#!/usr/bin/env bash -e
    %s
	/usr/local/bin/opensearch-dashboards-docker`

	OSPluginsInstallTmpl = `
     set -euo pipefail
     # Install OS plugins that are not bundled with OS
     %s
    `
	OSPluginsInstallCmd = `
    /usr/share/opensearch/bin/opensearch-plugin install -b %s
	`
	OSDashboardPluginsInstallCmd = `
    /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install %s
	`
)

Variables

This section is empty.

Functions

func AuthProxyMetaName added in v0.0.26

func AuthProxyMetaName() string

AuthProxyMetaName returns Auth Proxy service name TESTING: should be passed in from hel chart as s

func AuthProxyPort added in v0.0.26

func AuthProxyPort() string

AuthProxyMetaName returns Auth Proxy service name

func ConvertToRegexp added in v0.0.29

func ConvertToRegexp(pattern string) string

convertToRegexp converts index pattern to a regular expression pattern.

func CopyImmutableEnvVars added in v0.0.29

func CopyImmutableEnvVars(expected, existing []corev1.Container, containerName string)

CopyImmutableEnvVars copies the initial master node environment variable from an existing container to an expected container cluster.initial_master_nodes shouldn't be changed after it's set.

func CreateContainerElement

func CreateContainerElement(vmoStorage *vmcontrollerv1.Storage,
	vmoResources *vmcontrollerv1.Resources, componentDetails config.ComponentDetails) corev1.Container

CreateContainerElement creates a generic container element for the given component of the given VMO object.

func CreateOidcProxy added in v0.0.26

CreateOidcProxy creates OpenID Connect (OIDC) proxy container and config Volume

func CreateOpenSearchContainerCMD added in v0.0.29

func CreateOpenSearchContainerCMD(javaOpts string, plugins []string) string

CreateOpenSearchContainerCMD creates the CMD for OpenSearch containers. The resulting CMD contains command to comment java heap settings in config/jvm/options if input javaOpts is non-empty OS plugins installation commands if OpenSearch plugins are provided and contains java min/max heap settings

func CreateZoneAntiAffinityElement

func CreateZoneAntiAffinityElement(vmoName string, component string) *corev1.Affinity

CreateZoneAntiAffinityElement return an Affinity resource for a given VMO instance and component

func DeepCopyMap added in v0.0.29

func DeepCopyMap(srcMap map[string]string) map[string]string

DeepCopyMap performs a deepcopy of a map

func GetCompLabel added in v0.0.29

func GetCompLabel(componentName string) string

GetCompLabel returns a component value for opensearch

func GetElasticsearchInitContainer

func GetElasticsearchInitContainer() *corev1.Container

GetElasticsearchInitContainer returns an Elasticsearch Init container object

func GetElasticsearchMasterInitContainer added in v0.0.25

func GetElasticsearchMasterInitContainer() *corev1.Container

GetElasticsearchMasterInitContainer return an Elasticsearch Init container for the master. This changes ownership of the ES directory permissions needed to access PV volume data. Also set the max map count.

func GetEnvVar added in v0.0.29

func GetEnvVar(container *corev1.Container, name string) *corev1.EnvVar

GetEnvVar retrieves a container EnvVar if it is present

func GetIngressRule added in v0.0.30

func GetIngressRule(ingressHost string) netv1.IngressRule

getIngressRule returns the ingressRule with the provided ingress host

func GetMetaLabels

GetMetaLabels returns k8s-app and vmo lables

func GetMetaName

func GetMetaName(vmoName string, componentName string) string

GetMetaName returns name

func GetNewRandomID added in v0.0.29

func GetNewRandomID(size int) (string, error)

GetNewRandomID generates a random alphanumeric string of the format [a-z0-9]{size}

func GetNextStringInSequence

func GetNextStringInSequence(name string) string

GetNextStringInSequence returns the next string in the incremental sequence given a string

func GetOSDashboardPluginList added in v0.0.30

func GetOSDashboardPluginList(vmo *vmcontrollerv1.VerrazzanoMonitoringInstance) []string

GetOSDashboardPluginList retrieves the list of plugins provided in the VMI CRD for OpenSearch dashboard. GIVEN VMI CRD RETURN the list of provided OSD plugins. If there is no plugin in VMI CRD, an empty list is returned.

func GetOSPluginsInstallTmpl added in v0.0.30

func GetOSPluginsInstallTmpl(plugins []string, osPluginInstallCmd string) string

GetOSPluginsInstallTmpl returns the OSPluginsInstallTmpl by updating it with the given plugins and plugins installation cmd.

func GetOpenSearchDashboardsHTTPEndpoint added in v0.0.29

func GetOpenSearchDashboardsHTTPEndpoint(vmo *vmcontrollerv1.VerrazzanoMonitoringInstance) string

func GetOpenSearchHTTPEndpoint added in v0.0.29

func GetOpenSearchHTTPEndpoint(vmo *vmcontrollerv1.VerrazzanoMonitoringInstance) string

func GetOpenSearchPluginList added in v0.0.30

func GetOpenSearchPluginList(vmo *vmcontrollerv1.VerrazzanoMonitoringInstance) []string

GetOpenSearchPluginList retrieves the list of plugins provided in the VMI CRD for OpenSearch. GIVEN VMI CRD RETURN the list of provided os plugins. If there is no plugins in VMI CRD, empty list is returned.

func GetOwnerLabels added in v0.0.29

func GetOwnerLabels(owner string) map[string]string

func GetOwnerReferences

GetOwnerReferences returns owner references

func GetReplicasForComponent

func GetReplicasForComponent(vmo *vmcontrollerv1.VerrazzanoMonitoringInstance, component *config.ComponentDetails) (replicas int32)

GetReplicasForComponent returns number of replicas for a given component

func GetServicePort

func GetServicePort(componentDetails config.ComponentDetails) corev1.ServicePort

GetServicePort returns service port

func GetSpecID

func GetSpecID(vmoName string, componentName string) map[string]string

GetSpecID returns app label

func GetStorageElementForComponent

func GetStorageElementForComponent(vmo *vmcontrollerv1.VerrazzanoMonitoringInstance, component *config.ComponentDetails) (storage *vmcontrollerv1.Storage)

GetStorageElementForComponent returns storage for a given component

func New64Val

func New64Val(value int64) *int64

New64Val return a pointer to an int64 given an int64 value

func NewVal

func NewVal(value int32) *int32

NewVal return a pointer to an int32 given an int32 value

func OidcProxyConfigName added in v0.0.26

func OidcProxyConfigName(vmo string, component string) string

OidcProxyConfigName returns OIDC Proxy ConfigMap name of the component. ex. vmi-system-es-ingest-oidc-config

func OidcProxyIngressHost added in v0.0.26

func OidcProxyIngressHost(vmo *vmcontrollerv1.VerrazzanoMonitoringInstance, component *config.ComponentDetails) string

OidcProxyIngressHost returns OIDC Proxy ingress host.

func OidcProxyMetaName added in v0.0.26

func OidcProxyMetaName(vmoName string, component string) string

OidcProxyMetaName returns OIDC Proxy meta name of the component. ex. vmi-system-es-ingest-oidc

func OidcProxyService added in v0.0.26

OidcProxyService creates OidcProxy Service

func SetEnvVar added in v0.0.29

func SetEnvVar(container *corev1.Container, envVar *corev1.EnvVar)

SetEnvVar sets a container EnvVar, overriding if it was laready present

func SliceContains

func SliceContains(slice []string, value string) bool

SliceContains returns whether or not the given slice contains the given string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL