...
1
2 package constants
3
4 import (
5 "errors"
6 "fmt"
7 )
8
9
10 const Domain = "edge.ncr.com"
11
12
13
14 const Tenant = "tenant." + Domain
15
16 var (
17
18
19 ErrNoFleetInfo = errors.New("required fleet metadata was not present")
20 )
21
22
23
24 const Cluster = "cluster." + Domain
25
26
27 const Fleet = "fleet." + Domain
28
29
30 const Region = "region." + Domain
31
32
33 const Workload = "workload." + Domain
34
35
36
37 const ClusterURI = Cluster + "/uri"
38
39
40
41 const ClusterComponent = Cluster + "/component"
42
43
44 const (
45
46
47
48
49
50
51 Platform = "platform." + Domain
52
53 PlatformComponent = Platform + "/component"
54
55 PlatformOperationID = Platform + "/operationId"
56
57 ClusterEdgeIDLabel = "id.cluster.edge.ncr.com"
58 )
59
60
61 const (
62 TerminalLabel = "terminal.ncr.com"
63 ConfigTypeLabel = "configtype.ncr.com"
64 )
65
66
67 const (
68 BSL = "bsl." + Domain
69 Banner = BSL + "/banner"
70 Organization = BSL + "/organization"
71 EnterpriseUnit = BSL + "/eu"
72 Site = BSL + "/site"
73 )
74
75
76 type NamespaceSelectorType string
77
78 const (
79 PlatformNamespaceSelector = NamespaceSelectorType("edge-platform-ncr")
80 NCRNamespaceSelector = NamespaceSelectorType("edge-ncr")
81 TenantNamespaceSelector = NamespaceSelectorType("edge-tenant")
82 HelmNamespaceSelector = NamespaceSelectorType("edge-helm")
83 EdgeNamespaceSelector = NamespaceSelectorType("edge")
84 MonitoringNamespace = "monitoring"
85 )
86
87 func (nt NamespaceSelectorType) Valid() bool {
88 for _, namespaceSelectorType := range []NamespaceSelectorType{EdgeNamespaceSelector, PlatformNamespaceSelector, NCRNamespaceSelector, TenantNamespaceSelector, HelmNamespaceSelector} {
89 if string(nt) == string(namespaceSelectorType) {
90 return true
91 }
92 }
93 return false
94 }
95
96 const (
97 EdgeDockerSecret = "edge-docker-pull-secret"
98 EdgeHelmSecret = "edge-helm-secret"
99 TenantNameFormat = "tenant-%s"
100 TenantStoreFormat = "tenant-%s-fleet-store"
101 EdgeHelmURL = "https://ncrvoyix.jfrog.io/artifactory/retail-helm-dev/"
102 )
103
104 const (
105 DefaultGCPRegion = "us-east1"
106 DefaultGCPZone = "c"
107 )
108
109
110 const (
111 GKEFleet = "fleet"
112 GKEBanner = "banner"
113 GKEOrganization = "organization"
114 GKECluster = "cluster-name"
115 GKEClusterUUID = "cluster-uuid"
116 )
117
118
119 const (
120 ServiceTypeClusterDNS = "cluster-dns-ip"
121 ServiceTypePodNetworkCIDR = "pod-network-cidr"
122 ServiceTypeServiceNetworkCIDR = "service-network-cidr"
123 ServiceTypeEgressTunnelsCIDR = "egress-tunnels-cidr"
124 ServiceTypeDNS = "dns"
125 ServiceTypeNTP = "ntp"
126 ServiceTypeVIP = "kube-vip"
127 )
128
129 var (
130 ClusterNetworkServiceDefaults = map[string]string{
131 ServiceTypePodNetworkCIDR: "100.127.0.0/16",
132 ServiceTypeClusterDNS: "10.96.0.10",
133 ServiceTypeServiceNetworkCIDR: "10.96.0.0/16",
134 ServiceTypeEgressTunnelsCIDR: "10.80.0.0/22",
135 }
136 DefaultClusterLocation = fmt.Sprintf("%s-%s", DefaultGCPRegion, DefaultGCPZone)
137 )
138
139
140 var (
141 FixedClusterServices = []string{
142 ServiceTypePodNetworkCIDR,
143 ServiceTypeServiceNetworkCIDR,
144 ServiceTypeEgressTunnelsCIDR,
145 }
146 )
147
View as plain text