// Package constants contains the strings used throughout the K8s ecosystem package constants import ( "errors" "fmt" ) // Domain is the base Domain used in all of our APIs, Labels, Annos, etc const Domain = "edge.ncr.com" // Tenant is the DNS compliant name for storing and referring to // tenants in labels or annotations const Tenant = "tenant." + Domain var ( // ErrNoFleetInfo occurs when an object doesn't have the expected // fleet metadata ErrNoFleetInfo = errors.New("required fleet metadata was not present") ) // Cluster is the DNS compliant name for storing and referring to the // Cluster's name in labels or annotations const Cluster = "cluster." + Domain // Fleet is the annotation for the name of the fleet the resource is tied to const Fleet = "fleet." + Domain // Region is the annotation for the region the resource is tied to const Region = "region." + Domain // Workload is the label that the workload resource is tied to const Workload = "workload." + Domain // ClusterURI is used to store and reference the GCP resource URI for a GKE // cluster const ClusterURI = Cluster + "/uri" // ClusterComponent is used to store information about what cluster component // (ACM, GKE connect, K8s Cfg Connector, etc) a given resource is used for const ClusterComponent = Cluster + "/component" // Platform const ( // Platform is the DNS compliant name for storing and referring to metadata about // the Edge platform itself. Presence of the label/annotation indicates that a // given Kubernetes resource is a part of the Edge platform, and not // - part of the Kubernetes core system (e.g., `kube-system`) // - part of a BYO customer workload // - part of a NCR business app (e.g., self-checkout) Platform = "platform." + Domain // PlatformComponent identifies a specific platform component by name. PlatformComponent = Platform + "/component" // PlatformOperationID identifies which end to end operation this resource is correlated with. PlatformOperationID = Platform + "/operationId" // ClusterEdgeIDLabel label key for cluster edge id ClusterEdgeIDLabel = "id.cluster.edge.ncr.com" ) // SDS Terminal labels used to identify components specific for terminals to configure const ( TerminalLabel = "terminal.ncr.com" ConfigTypeLabel = "configtype.ncr.com" ) // bsl const ( BSL = "bsl." + Domain Banner = BSL + "/banner" Organization = BSL + "/organization" EnterpriseUnit = BSL + "/eu" Site = BSL + "/site" ) // NamespaceSelectorType a set of permissible string values for a namespace selector type type NamespaceSelectorType string const ( PlatformNamespaceSelector = NamespaceSelectorType("edge-platform-ncr") NCRNamespaceSelector = NamespaceSelectorType("edge-ncr") TenantNamespaceSelector = NamespaceSelectorType("edge-tenant") HelmNamespaceSelector = NamespaceSelectorType("edge-helm") EdgeNamespaceSelector = NamespaceSelectorType("edge") MonitoringNamespace = "monitoring" ) func (nt NamespaceSelectorType) Valid() bool { for _, namespaceSelectorType := range []NamespaceSelectorType{EdgeNamespaceSelector, PlatformNamespaceSelector, NCRNamespaceSelector, TenantNamespaceSelector, HelmNamespaceSelector} { if string(nt) == string(namespaceSelectorType) { return true } } return false } const ( EdgeDockerSecret = "edge-docker-pull-secret" //nolint not credentials EdgeHelmSecret = "edge-helm-secret" TenantNameFormat = "tenant-%s" TenantStoreFormat = "tenant-%s-fleet-store" EdgeHelmURL = "https://ncrvoyix.jfrog.io/artifactory/retail-helm-dev/" ) const ( DefaultGCPRegion = "us-east1" DefaultGCPZone = "c" ) // gke cluster labels add on cluster in gcp const ( GKEFleet = "fleet" GKEBanner = "banner" GKEOrganization = "organization" GKECluster = "cluster-name" GKEClusterUUID = "cluster-uuid" ) // dsds k8s network service types const ( ServiceTypeClusterDNS = "cluster-dns-ip" ServiceTypePodNetworkCIDR = "pod-network-cidr" ServiceTypeServiceNetworkCIDR = "service-network-cidr" ServiceTypeEgressTunnelsCIDR = "egress-tunnels-cidr" ServiceTypeDNS = "dns" ServiceTypeNTP = "ntp" ServiceTypeVIP = "kube-vip" ) var ( ClusterNetworkServiceDefaults = map[string]string{ ServiceTypePodNetworkCIDR: "100.127.0.0/16", ServiceTypeClusterDNS: "10.96.0.10", ServiceTypeServiceNetworkCIDR: "10.96.0.0/16", ServiceTypeEgressTunnelsCIDR: "10.80.0.0/22", } DefaultClusterLocation = fmt.Sprintf("%s-%s", DefaultGCPRegion, DefaultGCPZone) ) // cluster network services that may not change after activation var ( FixedClusterServices = []string{ ServiceTypePodNetworkCIDR, ServiceTypeServiceNetworkCIDR, ServiceTypeEgressTunnelsCIDR, } )