-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathtypes.js
More file actions
434 lines (382 loc) · 17.1 KB
/
types.js
File metadata and controls
434 lines (382 loc) · 17.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
// --------------------------------------
// 1. Provided by Steve and always potentially available
// --------------------------------------
// Steve-specific virtual types
// Base: /v1
export const STEVE = {
PREFERENCE: 'userpreference',
SCHEMA_DEFINITION: 'schemaDefinition'
};
// Old APIs via Norman
// Base: /v3
export const NORMAN = {
APP: 'app',
AUTH_CONFIG: 'authconfig',
CLUSTER: 'cluster',
CLUSTER_TOKEN: 'clusterregistrationtoken',
CLUSTER_ROLE_TEMPLATE_BINDING: 'clusterroletemplatebinding',
CLOUD_CREDENTIAL: 'cloudcredential',
FLEET_WORKSPACES: 'fleetworkspace',
GLOBAL_ROLE: 'globalRole',
GLOBAL_ROLE_BINDING: 'globalRoleBinding',
NODE_POOL: 'nodePool',
// Note - This allows access to node resources, not schema's or custom components (both are accessed via 'type' which clashes with kube node)
NODE: 'node',
PRINCIPAL: 'principal',
PROJECT: 'project',
PROJECT_ROLE_TEMPLATE_BINDING: 'projectroletemplatebinding',
SETTING: 'setting',
SPOOFED: { GROUP_PRINCIPAL: 'group.principal' },
ROLE_TEMPLATE: 'roleTemplate',
TOKEN: 'token',
USER: 'user',
KONTAINER_DRIVER: 'kontainerDriver',
NODE_DRIVER: 'nodeDriver'
};
// Public (via Norman)
// Base: /v3-public
export const PUBLIC = { AUTH_PROVIDER: 'authprovider' };
// Common native k8s types (via Steve)
// Base: /k8s/clusters/<id>/v1/
export const API_GROUP = 'apiGroups';
export const API_SERVICE = 'apiregistration.k8s.io.apiservice';
export const CONFIG_MAP = 'configmap';
export const COUNT = 'count';
export const EVENT = 'event';
export const ENDPOINTS = 'endpoints';
export const HPA = 'autoscaling.horizontalpodautoscaler';
export const INGRESS = 'networking.k8s.io.ingress';
export const INGRESS_CLASS = 'networking.k8s.io.ingressclass';
export const LIMIT_RANGE = 'limitrange';
export const NAMESPACE = 'namespace';
export const NODE = 'node';
export const NETWORK_POLICY = 'networking.k8s.io.networkpolicy';
export const POD = 'pod';
export const POD_DISRUPTION_BUDGET = 'policy.poddisruptionbudget';
export const PV = 'persistentvolume';
export const PVC = 'persistentvolumeclaim';
export const RESOURCE_QUOTA = 'resourcequota';
export const AUDIT_POLICY = 'auditlog.cattle.io.auditpolicy';
export const SCHEMA = 'schema';
export const SERVICE = 'service';
export const SECRET = 'secret';
export const SERVICE_ACCOUNT = 'serviceaccount';
export const STORAGE_CLASS = 'storage.k8s.io.storageclass';
export const CSI_DRIVER = 'storage.k8s.io.csidriver';
export const OBJECT_META = 'io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta';
export const NETWORK_ATTACHMENT = 'k8s.cni.cncf.io.networkattachmentdefinition';
export const USER = 'user';
export const GROUP = 'group';
export const RBAC = {
ROLE: 'rbac.authorization.k8s.io.role',
CLUSTER_ROLE: 'rbac.authorization.k8s.io.clusterrole',
ROLE_BINDING: 'rbac.authorization.k8s.io.rolebinding',
CLUSTER_ROLE_BINDING: 'rbac.authorization.k8s.io.clusterrolebinding',
};
export const WORKLOAD = 'workload';
export const WORKLOAD_DASHBOARD = 'workload-dashboard';
/**
* Rancher Workload types
*
* The types that are aggregated into a "workload"
*/
export const WORKLOAD_TYPES = {
DEPLOYMENT: 'apps.deployment',
CRON_JOB: 'batch.cronjob',
DAEMON_SET: 'apps.daemonset',
JOB: 'batch.job',
STATEFUL_SET: 'apps.statefulset',
REPLICA_SET: 'apps.replicaset',
REPLICATION_CONTROLLER: 'replicationcontroller',
};
/**
* Kube Workload Kinds
*/
export const WORKLOAD_KINDS = {
DEPLOYMENT: 'Deployment',
CRON_JOB: 'CronJob',
DAEMON_SET: 'DaemonSet',
JOB: 'Job',
STATEFUL_SET: 'StatefulSet',
REPLICA_SET: 'ReplicaSet',
REPLICATION_CONTROLLER: 'ReplicationController',
};
/**
* Map Rancher Workload types to Kube Workload Kinds
*/
export const WORKLOAD_TYPE_TO_KIND_MAPPING = {
// Each deployment creates a replicaset and the metrics are published for a replicaset.
[WORKLOAD_TYPES.DEPLOYMENT]: WORKLOAD_KINDS.DEPLOYMENT,
[WORKLOAD_TYPES.CRON_JOB]: WORKLOAD_KINDS.CRON_JOB,
[WORKLOAD_TYPES.DAEMON_SET]: WORKLOAD_KINDS.DAEMON_SET,
[WORKLOAD_TYPES.JOB]: WORKLOAD_KINDS.JOB,
[WORKLOAD_TYPES.STATEFUL_SET]: WORKLOAD_KINDS.STATEFUL_SET,
[WORKLOAD_TYPES.REPLICA_SET]: WORKLOAD_KINDS.REPLICA_SET,
[WORKLOAD_TYPES.REPLICATION_CONTROLLER]: WORKLOAD_KINDS.REPLICATION_CONTROLLER,
};
/**
* Map Kube Workload Kinds types to Rancher Workload
*/
export const WORKLOAD_KIND_TO_TYPE_MAPPING = {
[WORKLOAD_KINDS.DEPLOYMENT]: WORKLOAD_TYPES.DEPLOYMENT,
[WORKLOAD_KINDS.CRON_JOB]: WORKLOAD_TYPES.CRON_JOB,
[WORKLOAD_KINDS.DAEMON_SET]: WORKLOAD_TYPES.DAEMON_SET,
[WORKLOAD_KINDS.JOB]: WORKLOAD_TYPES.JOB,
[WORKLOAD_KINDS.STATEFUL_SET]: WORKLOAD_TYPES.STATEFUL_SET,
[WORKLOAD_KINDS.REPLICA_SET]: WORKLOAD_TYPES.REPLICA_SET,
[WORKLOAD_KINDS.REPLICATION_CONTROLLER]: WORKLOAD_TYPES.REPLICATION_CONTROLLER,
};
export const METRICS_SUPPORTED_KINDS = [
WORKLOAD_TYPES.DAEMON_SET,
WORKLOAD_TYPES.REPLICA_SET,
WORKLOAD_TYPES.STATEFUL_SET,
WORKLOAD_TYPES.DEPLOYMENT
];
const {
DAEMON_SET, CRON_JOB, JOB, ...scalableWorkloads
} = WORKLOAD_TYPES;
export const SCALABLE_WORKLOAD_TYPES = scalableWorkloads;
export const LIST_WORKLOAD_TYPES = {
...WORKLOAD_TYPES,
POD
};
export const METRIC = {
NODE: 'metrics.k8s.io.nodemetrics',
POD: 'metrics.k8s.io.podmetrics',
};
export const CATALOG = {
CLUSTER_REPO: 'catalog.cattle.io.clusterrepo',
OPERATION: 'catalog.cattle.io.operation',
APP: 'catalog.cattle.io.app',
REPO: 'catalog.cattle.io.repo',
};
// Charts/Apps
export const CATALOG_SORT_OPTIONS = {
RECOMMENDED: 'recommended',
LAST_UPDATED_DESC: 'lastupdatedDescending',
ALPHABETICAL_ASC: 'alphaAscending',
ALPHABETICAL_DESC: 'alphaDescending'
};
// UI Plugin type
export const UI_PLUGIN = 'catalog.cattle.io.uiplugin';
export const HELM = { PROJECTHELMCHART: 'helm.cattle.io.projecthelmchart' };
export const MONITORING = {
ALERTMANAGER: 'monitoring.coreos.com.alertmanager',
ALERTMANAGERCONFIG: 'monitoring.coreos.com.alertmanagerconfig',
PODMONITOR: 'monitoring.coreos.com.podmonitor',
PROMETHEUS: 'monitoring.coreos.com.prometheus',
PROMETHEUSRULE: 'monitoring.coreos.com.prometheusrule',
SERVICEMONITOR: 'monitoring.coreos.com.servicemonitor',
THANOSRULER: 'monitoring.coreos.com.thanosruler',
SPOOFED: {
RECEIVER: 'monitoring.coreos.com.receiver',
RECEIVER_SPEC: 'monitoring.coreos.com.receiver.spec',
RECEIVER_EMAIL: 'monitoring.coreos.com.receiver.email',
RECEIVER_SLACK: 'monitoring.coreos.com.receiver.slack',
RECEIVER_WEBHOOK: 'monitoring.coreos.com.receiver.webhook',
RECEIVER_PAGERDUTY: 'monitoring.coreos.com.receiver.pagerduty',
RECEIVER_OPSGENIE: 'monitoring.coreos.com.receiver.opsgenie',
RECEIVER_HTTP_CONFIG: 'monitoring.coreos.com.receiver.httpconfig',
RESPONDER: 'monitoring.coreos.com.receiver.responder',
ROUTE: 'monitoring.coreos.com.route',
ROUTE_SPEC: 'monitoring.coreos.com.route.spec',
}
};
export const LONGHORN = {
ENGINES: 'longhorn.io.engine',
ENGINE_IMAGES: 'longhorn.io.engineimage',
NODES: 'longhorn.io.node',
REPLICAS: 'longhorn.io.replica',
SETTINGS: 'longhorn.io.setting',
VOLUMES: 'longhorn.io.volume',
};
export const LONGHORN_DRIVER = 'driver.longhorn.io';
export const LONGHORN_VERSION_V1 = 'LonghornV1';
export const LONGHORN_VERSION_V2 = 'LonghornV2';
export const SNAPSHOT = 'rke.cattle.io.etcdsnapshot';
// --------------------------------------
// 2. Only if Rancher is installed
// --------------------------------------
// Rancher Management API (via Steve)
// Base: /v1
export const MANAGEMENT = {
AUTH_CONFIG: 'management.cattle.io.authconfig',
CATALOG_TEMPLATE: 'management.cattle.io.catalogtemplate',
// CATALOG: 'management.cattle.io.catalog',
CLUSTER: 'management.cattle.io.cluster',
CLUSTER_ROLE_TEMPLATE_BINDING: 'management.cattle.io.clusterroletemplatebinding',
FEATURE: 'management.cattle.io.feature',
// GROUP: 'management.cattle.io.group',
KONTAINER_DRIVER: 'management.cattle.io.kontainerdriver',
MULTI_CLUSTER_APP: 'management.cattle.io.multiclusterapp',
NODE: 'management.cattle.io.node',
NODE_DRIVER: 'management.cattle.io.nodedriver',
NODE_POOL: 'management.cattle.io.nodepool',
NODE_TEMPLATE: 'management.cattle.io.nodetemplate',
PROJECT: 'management.cattle.io.project',
PROJECT_ROLE_TEMPLATE_BINDING: 'management.cattle.io.projectroletemplatebinding',
ROLE_TEMPLATE: 'management.cattle.io.roletemplate',
SETTING: 'management.cattle.io.setting',
USER: 'management.cattle.io.user',
TOKEN: 'management.cattle.io.token',
GLOBAL_ROLE: 'management.cattle.io.globalrole',
GLOBAL_ROLE_BINDING: 'management.cattle.io.globalrolebinding',
PSA: 'management.cattle.io.podsecurityadmissionconfigurationtemplate',
MANAGED_CHART: 'management.cattle.io.managedchart',
USER_NOTIFICATION: 'management.cattle.io.rancherusernotification',
GLOBAL_DNS_PROVIDER: 'management.cattle.io.globaldnsprovider',
RKE_TEMPLATE: 'management.cattle.io.clustertemplate',
RKE_TEMPLATE_REVISION: 'management.cattle.io.clustertemplaterevision',
CLUSTER_PROXY_CONFIG: 'management.cattle.io.clusterproxyconfig',
OIDC_CLIENT: 'management.cattle.io.oidcclient'
};
export const BRAND = {
SUSE: 'suse',
CSP: 'csp',
FEDERAL: 'federal',
RGS: 'rgs',
};
export const EXT = {
USER_ACTIVITY: 'ext.cattle.io.useractivity',
SELFUSER: 'ext.cattle.io.selfuser',
GROUP_MEMBERSHIP_REFRESH_REQUESTS: 'ext.cattle.io.groupmembershiprefreshrequest',
PASSWORD_CHANGE_REQUESTS: 'ext.cattle.io.passwordchangerequest',
KUBECONFIG: 'ext.cattle.io.kubeconfig',
};
export const CAPI = {
CAPI_CLUSTER: 'cluster.x-k8s.io.cluster',
MACHINE_DEPLOYMENT: 'cluster.x-k8s.io.machinedeployment',
MACHINE_SET: 'cluster.x-k8s.io.machineset',
MACHINE: 'cluster.x-k8s.io.machine',
RANCHER_CLUSTER: 'provisioning.cattle.io.cluster',
MACHINE_CONFIG_GROUP: 'rke-machine-config.cattle.io',
};
// --------------------------------------
// 3. Optional add-on packages in a cluster
// --------------------------------------
// Base: /k8s/clusters/<id>/v1/
export const FLEET = {
APPLICATION: 'fleet.cattle.io.application',
BUNDLE: 'fleet.cattle.io.bundle',
BUNDLE_DEPLOYMENT: 'fleet.cattle.io.bundledeployment',
CLUSTER: 'fleet.cattle.io.cluster',
CLUSTER_GROUP: 'fleet.cattle.io.clustergroup',
DASHBOARD: 'fleet.cattle.io.dashboard',
GIT_REPO: 'fleet.cattle.io.gitrepo',
HELM_OP: 'fleet.cattle.io.helmop',
WORKSPACE: 'management.cattle.io.fleetworkspace',
TOKEN: 'fleet.cattle.io.clusterregistrationtoken',
BUNDLE_NAMESPACE_MAPPING: 'fleet.cattle.io.bundlenamespacemapping',
GIT_REPO_RESTRICTION: 'fleet.cattle.io.gitreporestriction'
};
export const GATEKEEPER = {
CONSTRAINT_TEMPLATE: 'templates.gatekeeper.sh.constrainttemplate',
SPOOFED: { CONSTRAINT: 'constraints.gatekeeper.sh.constraint' }
};
export const ISTIO = {
VIRTUAL_SERVICE: 'networking.istio.io.virtualservice',
DESTINATION_RULE: 'networking.istio.io.destinationrule',
GATEWAY: 'networking.istio.io.gateway'
};
export const LOGGING = {
// LOGGING: 'logging.banzaicloud.io.logging',
CLUSTER_FLOW: 'logging.banzaicloud.io.clusterflow',
CLUSTER_OUTPUT: 'logging.banzaicloud.io.clusteroutput',
FLOW: 'logging.banzaicloud.io.flow',
OUTPUT: 'logging.banzaicloud.io.output',
SPOOFED: {
FILTERS: 'logging.banzaicloud.io.output.filters',
FILTER: 'logging.banzaicloud.io.output.filter',
CONCAT: 'logging.banzaicloud.io.output.filters.concat',
DEDOT: 'logging.banzaicloud.io.output.filters.dedot',
DETECTEXCEPTIONS: 'logging.banzaicloud.io.output.filters.detectExceptions',
GEOIP: 'logging.banzaicloud.io.output.filters.geoip',
GREP: 'logging.banzaicloud.io.output.filters.grep',
PARSER: 'logging.banzaicloud.io.output.filters.parser',
PROMETHEUS: 'logging.banzaicloud.io.output.filters.prometheus',
RECORD_MODIFIER: 'logging.banzaicloud.io.output.filters.record_modifier',
RECORD_TRANSFORMER: 'logging.banzaicloud.io.output.filters.record_transformer',
STDOUT: 'logging.banzaicloud.io.output.filters.stdout',
SUMOLOGIC: 'logging.banzaicloud.io.output.filters.sumologic',
TAG_NORMALISER: 'logging.banzaicloud.io.output.filters.tag_normaliser',
THROTTLE: 'logging.banzaicloud.io.output.filters.throttle',
RECORD: 'logging.banzaicloud.io.output.filters.record',
REGEXPSECTION: 'logging.banzaicloud.io.output.filters.regexpsection',
EXCLUDESECTION: 'logging.banzaicloud.io.output.filters.excludesection',
ORSECTION: 'logging.banzaicloud.io.output.filters.orsection',
ANDSECTION: 'logging.banzaicloud.io.output.filters.andsection',
PARSESECTION: 'logging.banzaicloud.io.output.filters.parsesection',
METRICSECTION: 'logging.banzaicloud.io.output.filters.metricsection',
REPLACE: 'logging.banzaicloud.io.output.filters.replace',
SINGLEPARSESECTION: 'logging.banzaicloud.io.output.filters.replace.singleparsesection'
}
};
export const BACKUP_RESTORE = {
RESOURCE_SET: 'resources.cattle.io.resourceset',
BACKUP: 'resources.cattle.io.backup',
RESTORE: 'resources.cattle.io.restore',
};
export const COMPLIANCE = {
CLUSTER_SCAN: 'compliance.cattle.io.clusterscan',
CLUSTER_SCAN_PROFILE: 'compliance.cattle.io.clusterscanprofile',
BENCHMARK: 'compliance.cattle.io.clusterscanbenchmark',
REPORT: 'compliance.cattle.io.clusterscanreport'
};
export const UI = { NAV_LINK: 'ui.cattle.io.navlink' };
export const VIRTUAL_TYPES = {
CLUSTER_MEMBERS: 'cluster-members',
PROJECT_NAMESPACES: 'projects-namespaces',
NAMESPACES: 'namespaces',
PROJECT_SECRETS: 'projectsecret',
JWT_AUTHENTICATION: 'jwt.authentication'
};
// harvester
export const HCI = {
CLUSTER: 'harvesterhci.io.management.cluster',
DASHBOARD: 'harvesterhci.io.dashboard',
IMAGE: 'harvesterhci.io.virtualmachineimage',
VGPU_DEVICE: 'devices.harvesterhci.io.vgpudevice',
SETTING: 'harvesterhci.io.setting',
RESOURCE_QUOTA: 'harvesterhci.io.resourcequota',
HARVESTER_CONFIG: 'rke-machine-config.cattle.io.harvesterconfig',
};
export const VIRTUAL_HARVESTER_PROVIDER = 'harvester';
export const ADDRESSES = {
HOSTNAME: 'Hostname',
INTERNAL_IP: 'InternalIP',
EXTERNAL_IP: 'ExternalIP'
};
export const DEFAULT_WORKSPACE = 'fleet-default';
export const AUTH_TYPE = {
_NONE: '_none',
_BASIC: '_basic',
_SSH: '_ssh',
_S3: '_S3',
_RKE: '_RKE',
_IMAGE_PULL_SECRET: '_IPS',
};
export const LOCAL_CLUSTER = 'local';
export const CLUSTER_REPO_TYPES = {
HELM_URL: 'helm-url',
GIT_REPO: 'git-repo',
OCI_URL: 'oci-url',
SUSE_APP_COLLECTION: 'suse-application-collection'
};
/**
* The `generateName` prefix used when creating authentication secrets
* for SUSE App Collection repositories.
*/
export const CLUSTER_REPO_APPCO_AUTH_GENERATE_NAME = 'clusterrepo-appco-auth-';
/**
* The `generateName` prefix used when creating authentication secrets
* for standard repositories.
*/
export const CLUSTER_REPO_AUTH_GENERATE_NAME = 'clusterrepo-auth-';
export const ZERO_TIME = '0001-01-01T00:00:00Z';
export const DEFAULT_GRAFANA_STORAGE_SIZE = '10Gi';
export const DEPRECATED = 'Deprecated';
export const EXPERIMENTAL = 'Experimental';
export const AUTOSCALER_CONFIG_MAP_ID = 'kube-system/cluster-autoscaler-status';
export const HOSTED_PROVIDER = 'hostedprovider';
// Named saved counts
export const SAVED_COUNTS = { K8S_CLUSTERS: 'k8sClusters' };