constants

package
v0.0.0-...-23030c4 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CurrentVersion product version supported
	CurrentVersion = "7.12.1"
	// PriorVersion product version supported
	PriorVersion = "7.12.0"
)
View Source
const (
	// ProductName used for metering labels
	ProductName = "Red_Hat_Process_Automation"
	// LabelRHproductName used as metering label
	LabelRHproductName = "rht.prod_name"
	// LabelRHproductVersion used as metering label
	LabelRHproductVersion = "rht.prod_ver"
	// LabelRHcomponentName used as metering label
	LabelRHcomponentName = "rht.comp"
	// LabelRHcomponentVersion used as metering label
	LabelRHcomponentVersion = "rht.comp_ver"
	// LabelRHsubcomponentName used as metering label
	LabelRHsubcomponentName = "rht.subcomp"
	// LabelRHsubcomponentType used as metering label
	LabelRHsubcomponentType = "rht.subcomp_t"
	// LabelRHcompany used as metering label
	LabelRHcompany = "com.company"
	// RhpamPrefix RHPAM prefix
	RhpamPrefix = "rhpam"
	// RhdmPrefix RHDM prefix
	RhdmPrefix = "rhdm"
	// KieServerServicePrefix prefix to use for the servers
	KieServerServicePrefix = "kieserver"
	// ImageRegistry default registry
	ImageRegistry = "registry.redhat.io"
	// ImageRegistryStage default registry
	ImageRegistryStage = "registry.stage.redhat.io"
	// ImageRegistryBrew default registry
	ImageRegistryBrew = "registry-proxy.engineering.redhat.com"
	// ImageContextBrew default context
	ImageContextBrew = "rh-osbs"
	// ImageStreamNamespace default namespace for the ImageStreams
	ImageStreamNamespace = "openshift"
	// ConfigMapPrefix prefix to use for the configmaps
	ConfigMapPrefix = "kieconfigs"
	// KieServerCMLabel the label to modify when replicas is set to 0
	KieServerCMLabel = "services.server.kie.org/kie-server-state"
	// DefaultAdminUser default admin user
	DefaultAdminUser = "adminUser"
	// DefaultPassword default password to use for test environments
	DefaultPassword = "RedHat"
	// SSODefaultPrincipalAttribute default PrincipalAttribute to use for SSO integration
	SSODefaultPrincipalAttribute = "preferred_username"
	// NameSpaceEnv is an environment variable of the current namespace
	// set via downward api when the code is running via deployment
	NameSpaceEnv = "WATCH_NAMESPACE"
	// OpNameEnv is an environment variable of the operator name
	// set when the code is running via deployment
	OpNameEnv = "OPERATOR_NAME"
	// OpUIEnv is an environment variable indicating whether the UI should be deployed
	// Default behavior is to deploy the UI, unless this variable is provided with a false value
	OpUIEnv = "OPERATOR_UI"
	// TrialEnvSuffix is the suffix for trial environments
	TrialEnvSuffix = "trial"
	// DefaultKieDeployments default number of Kie Server deployments
	DefaultKieDeployments = 1
	// KeystoreSecret is the default format for keystore secret names
	KeystoreSecret = "%s-app-secret"
	// KeystoreVolumeSuffix Suffix for the keystore volumes and volumeMounts name
	KeystoreVolumeSuffix = "keystore-volume"
	// KeystoreAlias used when creating entry in Keystore
	KeystoreAlias = "jboss"
	// KeystoreName used when creating Secret
	KeystoreName = "keystore.jks"
	// TruststoreSecret is the default format for truststore secret names
	TruststoreSecret = "-truststore"
	// TruststoreName used when creating Secret
	TruststoreName = "truststore.jks"
	// TruststorePath used when mounting Secret
	TruststorePath = "/etc/openshift-truststore-volume"
	// TruststorePwd used when creating Secret
	TruststorePwd = "changeit"
	// CaBundleKey ...
	CaBundleKey = "ca-bundle.crt"
	// HttpProtocol ...
	HttpProtocol = "http"
	// HttpsProtocol ...
	HttpsProtocol = "https"
	// DatabaseVolumeSuffix Suffix to use for any database volume and volumeMounts
	DatabaseVolumeSuffix = "pvol"
	// DefaultDatabaseSize Default Database Persistence size
	DefaultDatabaseSize = "1Gi"
	// DefaultExtensionImageInstallDir Default Extension Install Dir for JDBC drivers
	DefaultExtensionImageInstallDir = "/extensions"
	// ConsoleLinkName is how the link will be titled in an installed CSV within the marketplace
	ConsoleLinkName = "Installer"
	// ConsoleDescription is how the link will be described in an installed CSV within the marketplace
	ConsoleDescription = "" /* 137-byte string literal not displayed */
	// GitHooksDefaultDir Default path where to mount the GitHooks volume
	GitHooksDefaultDir = "/opt/kie/data/git/hooks"
	// GitHooksVolume Name of the mounted volume name when GitHooks reference is set
	GitHooksVolume = "githooks-volume"
	// GitHooksSSHSecret Name of the mounted volume name when GitHooks SSH Secret reference is set
	GitHooksSSHSecret = "githooks-ssh-volume"
	// RoleMapperVolume Name of the mounted volume name when RoleMapper reference is set
	RoleMapperVolume = "rolemapper-volume"
	// RoleMapperDefaultDir Default path for the rolemapping properties file
	RoleMapperDefaultDir = "/opt/eap/standalone/configuration/rolemapping"
	// DefaultKieServerDatabaseName Default database name for Kie Server
	DefaultKieServerDatabaseName = "rhpam7"
	// DefaultKieServerDatabaseUsername Default database username for Kie Server
	DefaultKieServerDatabaseUsername = "rhpam"
	// DefaultProcessMigrationDatabaseType Default database type for Process Migration
	DefaultProcessMigrationDatabaseType = api.DatabaseH2
	// DefaultProcessMigrationDatabaseName Default database name for Process Migration
	DefaultProcessMigrationDatabaseName = "pimdb"
	// DefaultProcessMigrationDatabaseUsername Default database username for Process Migration
	DefaultProcessMigrationDatabaseUsername = "pim"
	// ProcessMigrationDefaultImageURL Process Migration Image
	ProcessMigrationDefaultImageURL = ImageRegistry + PamContext + "process-migration" + RhelVersion
	// ClusterLabel for Kube_ping
	ClusterLabel = "cluster"
	// ClusterLabelPrefix for Kube_ping
	ClusterLabelPrefix = "jgrp.k8s."
	// KubeNS Env name
	KubeNS         = "KUBERNETES_NAMESPACE"
	KubeLabels     = "KUBERNETES_LABELS"
	KafkaTopicsEnv = "KIE_SERVER_KAFKA_EXT_TOPICS"
	// ConsoleRouteEnv for backwards compatibility with Application Templates
	ConsoleRouteEnv = "BUSINESS_CENTRAL_HOSTNAME_HTTP"
	// ServersRouteEnv for backwards compatibility with Application Templates
	ServersRouteEnv = "KIE_SERVER_HOSTNAME_HTTP"
	// SmartRouterRouteEnv for backwards compatibility with Application Templates
	SmartRouterRouteEnv = "SMART_ROUTER_HOSTNAME_HTTP"
	// DashbuilderRouteEnv for backwards compatibility, similar to Console and Servers
	DashbuilderRouteEnv = "DASHBUILDER_HOSTNAME_HTTP"
	// ACFilters Default filters for CORS
	ACFilters = "AC_ALLOW_ORIGIN,AC_ALLOW_METHODS,AC_ALLOW_HEADERS,AC_ALLOW_CREDENTIALS,AC_MAX_AGE"

	DmKieImageVar          = relatedImageVar + "DM_KIESERVER_IMAGE_"
	DmDecisionCentralVar   = relatedImageVar + "DM_DC_IMAGE_"
	DmControllerVar        = relatedImageVar + "DM_CONTROLLER_IMAGE_"
	PamKieImageVar         = relatedImageVar + "PAM_KIESERVER_IMAGE_"
	PamControllerVar       = relatedImageVar + "PAM_CONTROLLER_IMAGE_"
	PamBusinessCentralVar  = relatedImageVar + "PAM_BC_IMAGE_"
	PamBCMonitoringVar     = relatedImageVar + "PAM_BC_MONITORING_IMAGE_"
	PamProcessMigrationVar = relatedImageVar + "PAM_PROCESS_MIGRATION_IMAGE_"
	PamDashbuilderVar      = relatedImageVar + "PAM_DASHBUILDER_IMAGE_"
	PamSmartRouterVar      = relatedImageVar + "PAM_SMARTROUTER_IMAGE_"

	OauthVar             = relatedImageVar + "OAUTH_PROXY_IMAGE_"
	Oauth4ImageURL       = ImageRegistry + "/openshift4/ose-oauth-proxy"
	Oauth4ImageLatestURL = Oauth4ImageURL + ":latest"
	OauthComponent       = "golang-github-openshift-oauth-proxy-container"

	PostgreSQLVar         = relatedImageVar + "POSTGRESQL_PROXY_IMAGE_"
	PostgreSQL10ImageURL  = ImageRegistry + "/rhscl/postgresql-10-rhel7:latest"
	PostgreSQL10Component = "rh-postgresql10-container"

	MySQLVar         = relatedImageVar + "MYSQL_PROXY_IMAGE_"
	MySQL57ImageURL  = ImageRegistry + "/rhscl/mysql-57-rhel7:latest"
	MySQL57Component = "rh-mysql57-container"
	MySQL80ImageURL  = ImageRegistry + "/rhscl/mysql-80-rhel7:latest"
	MySQL80Component = "rh-mysql80-container"

	OseCliVar        = relatedImageVar + "OSE_CLI_IMAGE_"
	OseCli4Component = "openshift-enterprise-cli-container"

	BrokerComponent = "amq-broker-openshift-container"
	BrokerVar       = relatedImageVar + "BROKER_IMAGE_"
	BrokerImage     = "amq-broker"
	BrokerImageURL  = ImageRegistry + "/amq7/" + BrokerImage + ":"

	Broker77ImageTag = "7.7"
	Broker78ImageTag = "7.8"
	Broker77ImageURL = BrokerImageURL + Broker77ImageTag
	Broker78ImageURL = BrokerImageURL + Broker78ImageTag

	DatagridVar         = relatedImageVar + "DATAGRID_IMAGE_"
	Datagrid73Image     = "datagrid73-openshift"
	Datagrid73Component = "jboss-datagrid-7-datagrid73-openshift-container"

	Datagrid8Image     = "datagrid-8-rhel8"
	Datagrid8Component = "datagrid-datagrid-8-rhel8-container"

	Datagrid73ImageTag16 = "1.6"
	Datagrid73ImageURL16 = ImageRegistry + "/jboss-datagrid-7/" + Datagrid73Image + ":" + Datagrid73ImageTag16

	Datagrid8ImageTag11 = "1.1"
	Datagrid8ImageURL11 = ImageRegistry + "/datagrid/" + Datagrid8Image + ":" + Datagrid8ImageTag11

	DmContext   = "/" + RhdmPrefix + "-7/" + RhdmPrefix + "-"
	PamContext  = "/" + RhpamPrefix + "-7/" + RhpamPrefix + "-"
	RhelVersion = "-rhel8"

	//Resources Limits and Requests
	ConsoleProdCPULimit         = "2"
	ConsoleProdMemLimit         = "2Gi"
	ConsoleAuthoringCPULimit    = "2"
	ConsoleAuthoringMemLimit    = "4Gi"
	ConsoleAuthoringCPURequests = "1500m"
	ConsoleAuthoringMemRequests = "3Gi"
	ConsoleProdCPURequests      = "1500m"
	ConsoleProdMemRequests      = "1536Mi"
	ConsolePvSize               = "1Gi"
	ConsoleProdPvSize           = "64Mi"
	DashbuilderCPULimit         = "1"
	DashbuilderCPURequests      = "750m"
	DashbuilderMemLimit         = "2Gi"
	DashbuilderMemRequests      = "1536Mi"
	ServersCPULimit             = "1"
	ServersMemLimit             = "2Gi"
	ServersCPURequests          = "750m"
	ServersMemRequests          = "1536Mi"
	ServersM2PvSize             = "1Gi"
	ServersKiePvSize            = "10Mi"
	SmartRouterCPULimit         = "500m"
	SmartRouterMemLimit         = "1Gi"
	SmartRouterCPURequests      = "250m"
	SmartRouterMemRequests      = "1Gi"
	ProcessMigrationCPULimit    = "500m"
	ProcessMigrationMemLimit    = "512Mi"
	ProcessMigrationCPURequests = "250m"
	ProcessMigrationMemRequests = "512Mi"

	//ImageNames for metering labels
	RhpamSmartRouterImageName = RhpamPrefix + "-smartrouter-" + RhelVersion
	RhpamControllerImageName  = RhpamPrefix + "-controller-" + RhelVersion
	RhdmSmartRouterImageName  = RhdmPrefix + "-smartrouter-" + RhelVersion
	RhdmControllerImageName   = RhdmPrefix + "-controller-" + RhelVersion

	RhdmDecisionCentral     = "decisioncentral"
	RhpamBusinessCentral    = "businesscentral"
	RhpamBusinessCentralMon = "businesscentral-monitoring"

	DashBuilder      = "dashbuilder"
	Smartrouter      = "smartrouter"
	ProcessMigration = "process-migration"
	Production       = "production"

	SUBCOMPONENT_TYPE_APP   = "application"
	SUBCOMPONENT_TYPE_INFRA = "infrastructure"

	DefaultDatagridUsername = "infinispan"
)

Variables

View Source
var ConsoleAuthoringLimits = map[string]string{
	"CPU": ConsoleAuthoringCPULimit,
	"MEM": ConsoleAuthoringMemLimit,
}

ConsoleAuthoringLimits Resource Limits for BC in Authoring Env

View Source
var ConsoleAuthoringRequests = map[string]string{
	"CPU": ConsoleAuthoringCPURequests,
	"MEM": ConsoleAuthoringMemRequests,
}

ConsoleAuthoringRequests defines requests in Authoring environment

View Source
var ConsoleProdLimits = map[string]string{
	"CPU": ConsoleProdCPULimit,
	"MEM": ConsoleProdMemLimit,
}

ConsoleProdLimits Console Resource Limits for BC Monitoring in Prod Env

View Source
var ConsoleProdRequests = map[string]string{
	"CPU": ConsoleProdCPURequests,
	"MEM": ConsoleProdMemRequests,
}

ConsoleProdRequests defines requests in Prod or Immutable environment

View Source
var DashbuilderLimits = map[string]string{
	"CPU": DashbuilderCPULimit,
	"MEM": DashbuilderMemLimit,
}

DashbuilderLimits Resource Limits for Dasubuilder

View Source
var DashbuilderRequests = map[string]string{
	"CPU": DashbuilderCPURequests,
	"MEM": DashbuilderMemRequests,
}

DashbuilderRequests defines requests Dasubuilder deployment

View Source
var DebugFalse = corev1.EnvVar{
	Name:  "DEBUG",
	Value: "false",
}

DebugFalse - used to disable debug logs in objects

View Source
var DebugTrue = corev1.EnvVar{
	Name:  "DEBUG",
	Value: "true",
}

DebugTrue - used to enable debug logs in objects

View Source
var EnvironmentConstants = map[api.EnvironmentType]*api.EnvironmentConstants{
	api.RhpamProduction:            {App: rhpamMonitorAppConstants, Replica: replicasRhpamProduction, Database: databaseRhpamProduction},
	api.RhpamProductionImmutable:   {App: rhpamMonitorAppConstants, Replica: replicasRhpamProductionImmutable, Database: databaseRhpamProductionImmutable},
	api.RhpamTrial:                 {App: rhpamAppConstants, Replica: replicasTrial, Database: databaseRhpamTrial},
	api.RhpamAuthoring:             {App: rhpamAppConstants, Replica: replicasTrial, Database: databaseRhpamAuthoring},
	api.RhpamAuthoringHA:           {App: rhpamAppConstants, Replica: replicasAuthoringHA, Database: databaseRhpamAuthoringHA},
	api.RhpamStandaloneDashbuilder: {App: rhpamDashbuilderConstants, Replica: replicasDashbuilder},
	api.RhdmTrial:                  {App: rhdmAppConstants, Replica: replicasTrial},
	api.RhdmAuthoring:              {App: rhdmAppConstants, Replica: replicasTrial},
	api.RhdmAuthoringHA:            {App: rhdmAppConstants, Replica: replicasAuthoringHA},
	api.RhdmProductionImmutable:    {App: rhdmAppConstants, Replica: replicasTrial},
}

EnvironmentConstants contains

View Source
var Images = []ImageEnv{
	{
		Var:       DmKieImageVar,
		Component: RhdmPrefix + "-7-kieserver-rhel8-container",
		Registry:  ImageRegistry,
		Context:   DmContext + "kieserver" + RhelVersion,
	},
	{
		Var:       DmControllerVar,
		Component: RhdmPrefix + "-7-controller-rhel8-container",
		Registry:  ImageRegistry,
		Context:   DmContext + "controller" + RhelVersion,
	},
	{
		Var:       DmDecisionCentralVar,
		Component: RhdmPrefix + "-7-decisioncentral-rhel8-container",
		Registry:  ImageRegistry,
		Context:   DmContext + "decisioncentral" + RhelVersion,
	},
	{
		Var:       PamKieImageVar,
		Component: RhpamPrefix + "-7-kieserver-rhel8-container",
		Registry:  ImageRegistry,
		Context:   PamContext + "kieserver" + RhelVersion,
	},
	{
		Var:       PamControllerVar,
		Component: RhpamPrefix + "-7-controller-rhel8-container",
		Registry:  ImageRegistry,
		Context:   PamContext + "controller" + RhelVersion,
	},
	{
		Var:       PamBusinessCentralVar,
		Component: RhpamPrefix + "-7-businesscentral-rhel8-container",
		Registry:  ImageRegistry,
		Context:   PamContext + "businesscentral" + RhelVersion,
	},
	{
		Var:       PamBCMonitoringVar,
		Component: RhpamPrefix + "-7-businesscentral-monitoring-rhel8-container",
		Registry:  ImageRegistry,
		Context:   PamContext + "businesscentral-monitoring" + RhelVersion,
	},
	{
		Var:       PamSmartRouterVar,
		Component: RhpamPrefix + "-7-smartrouter-rhel8-container",
		Registry:  ImageRegistry,
		Context:   PamContext + "smartrouter" + RhelVersion,
	},
	{
		Var:       PamProcessMigrationVar,
		Component: RhpamPrefix + "-7-process-migration-rhel8-container",
		Registry:  ImageRegistry,
		Context:   PamContext + "process-migration" + RhelVersion,
	},
	{
		Var:       PamDashbuilderVar,
		Component: RhpamPrefix + "-7-dashbuilder-rhel8-container",
		Registry:  ImageRegistry,
		Context:   PamContext + "dashbuilder" + RhelVersion,
	},
}
View Source
var Ocp4Versions = []string{"4.8", "4.7", "4.6"}

Ocp4Versions - OpenShift minor versions used for image curation

View Source
var OseCli4ImageURL = ImageRegistry + "/openshift4/ose-cli:" + highestOcpVersion(Ocp4Versions)
View Source
var ProcessMigrationLimits = map[string]string{
	"CPU": ProcessMigrationCPULimit,
	"MEM": ProcessMigrationMemLimit,
}

ProcessMigrationLimits defines resource limits for PIM

View Source
var ProcessMigrationRequests = map[string]string{
	"CPU": ProcessMigrationCPURequests,
	"MEM": ProcessMigrationMemRequests,
}

ProcessMigrationRequests defines the requests for PIM deployment

View Source
var ServerRequests = map[string]string{
	"CPU": ServersCPURequests,
	"MEM": ServersMemRequests,
}

ServerRequests defines the requests for kieserver deployment

View Source
var ServersLimits = map[string]string{
	"CPU": ServersCPULimit,
	"MEM": ServersMemLimit,
}

ServersLimits Resource Limits for KIE Servers

View Source
var SmartRouterLimits = map[string]string{
	"CPU": SmartRouterCPULimit,
	"MEM": SmartRouterMemLimit,
}

SmartRouterLimits defines resource limits for Smart Router

View Source
var SmartRouterRequests = map[string]string{
	"CPU": SmartRouterCPURequests,
	"MEM": SmartRouterMemRequests,
}

SmartRouterRequests defines the requests for smart router deployment

View Source
var SupportedVersions = []string{CurrentVersion, PriorVersion}

SupportedVersions - product versions this operator supports

TemplateConstants set of constant values to use in templates

View Source
var VersionConstants = map[string]*api.VersionConfigs{
	CurrentVersion: {
		APIVersion:          api.GroupVersion.Version,
		OseCliImageURL:      OseCli4ImageURL,
		OseCliComponent:     OseCli4Component,
		BrokerImage:         BrokerImage,
		BrokerImageTag:      Broker78ImageTag,
		BrokerImageURL:      Broker78ImageURL,
		DatagridImage:       Datagrid8Image,
		DatagridImageTag:    Datagrid8ImageTag11,
		DatagridImageURL:    Datagrid8ImageURL11,
		DatagridComponent:   Datagrid8Component,
		MySQLImageURL:       MySQL80ImageURL,
		MySQLComponent:      MySQL80Component,
		PostgreSQLImageURL:  PostgreSQL10ImageURL,
		PostgreSQLComponent: PostgreSQL10Component,
	},
	PriorVersion: {
		APIVersion:          api.GroupVersion.Version,
		OseCliImageURL:      OseCli4ImageURL,
		OseCliComponent:     OseCli4Component,
		BrokerImage:         BrokerImage,
		BrokerImageTag:      Broker78ImageTag,
		BrokerImageURL:      Broker78ImageURL,
		DatagridImage:       Datagrid73Image,
		DatagridImageTag:    Datagrid73ImageTag16,
		DatagridImageURL:    Datagrid73ImageURL16,
		DatagridComponent:   Datagrid73Component,
		MySQLImageURL:       MySQL80ImageURL,
		MySQLComponent:      MySQL80Component,
		PostgreSQLImageURL:  PostgreSQL10ImageURL,
		PostgreSQLComponent: PostgreSQL10Component,
	},
}

VersionConstants ...

Functions

This section is empty.

Types

type ImageEnv

type ImageEnv struct {
	Var       string
	Component string
	Registry  string
	Context   string
}

type ImageRef

type ImageRef struct {
	metav1.TypeMeta `json:",inline"`
	Spec            ImageRefSpec `json:"spec"`
}

type ImageRefSpec

type ImageRefSpec struct {
	Tags []ImageRefTag `json:"tags"`
}

type ImageRefTag

type ImageRefTag struct {
	Name string                  `json:"name"`
	From *corev1.ObjectReference `json:"from"`
}

Jump to

Keyboard shortcuts

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