forked from DataDog/agent-payload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
agent.proto
1539 lines (1336 loc) · 41.7 KB
/
agent.proto
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
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
syntax = "proto3";
option go_package = "github.com/DataDog/agent-payload/v5/process";
package datadog.process_agent;
//
// Message Types
//
// ContainerHostType is a enum that represents the type of host detected for container collection.
// Sometimes containers are running on host-less environment, we'll need additional information to identify them
// This will help with the host resolution when we resolve container payloads
enum ContainerHostType {
notSpecified = 0;
fargateECS = 1;
fargateEKS = 2;
}
message ResCollector {
// Header must exist at position 1 for compatibility
// with older version of the Agent. We should be able
// to drop this at some point.
message Header {
int32 type = 4;
}
Header header = 1;
string message = 2;
CollectorStatus status = 3;
}
message CollectorProc {
string hostName = 2;
string networkId = 11;
repeated Process processes = 3;
Host host = 4;
SystemInfo info = 5;
int32 groupId = 6;
int32 groupSize = 7;
reserved 8, 9; // Old, optional metadata fields
repeated Container containers = 10;
ContainerHostType containerHostType = 12;
}
message CollectorProcDiscovery {
string hostName = 1;
int32 groupId = 2;
int32 groupSize = 3;
repeated ProcessDiscovery processDiscoveries = 4;
Host host = 5;
}
message CollectorConnections {
reserved 1, 4, 13, 32, 33;
// Please update when adding fields
// next identifier: 40
string hostName = 2;
string networkId = 12;
int64 hostId = 9; // Post-resolution field.
repeated Connection connections = 3;
// Message batching metadata
int32 groupId = 5;
int32 groupSize = 6;
// Mapping of hostId to Host. Each `connection` has a hostId field which can be mapped here.
// This should also include an entry for the host on which these connections were gathered.
map<int64, Host> resolvedHosts = 7; // Post-resolution field
// Mapping of resourceID to metadata. For containers, each `connection` has a containerId field which can be mapped here.
map<string, ResourceMetadata> resolvedResources = 8; // Post-resolution field
// Mapping of processes running in each container
map<int32, string> containerForPid = 10;
bytes encodedTags = 11;
ContainerHostType containerHostType = 15;
// For now, we'll keep emitting telemetry from agents < 7.35
CollectorConnectionsTelemetry connTelemetry = 16;
map<string,int64> connTelemetryMap = 39;
// OS Telemetry
string architecture = 17;
string kernelVersion = 18;
string platform = 19;
string platformVersion = 20;
map<string, RuntimeCompilationTelemetry> compilationTelemetryByAsset = 21;
repeated Route routes = 31;
repeated RouteMetadata routeMetadata = 34;
AgentConfiguration agentConfiguration = 35;
/////////////////
// V1 encodings
// encoded dns is a map of (string) ip-> list of domains (DNSEntry)
bytes encodedDNS = 14;
// All queried DNS domains for which we have collected stats
repeated string domains = 30;
//////////////////
// V2 encodings
// all domain strings are now indexes into a single array of strings
// hostname query information. Encoded via V2DNSEncoder.EncodeDomainDatabase
// is a single buffer; varint number of strings, followed by each string.
bytes encodedDomainDatabase = 36;
// new representation of encoded DNS. This is a map of the string representation
// of the IP --> DNSDatabaseEntry message. (was encodedDNS). Encoded
// via V2DNSEncoder.EncodeMapped. Full buffer description provided there.
bytes encodedDnsLookups = 37;
}
message CollectorRealTime {
string hostName = 2;
repeated ProcessStat stats = 3;
// Post-resolved fields
int64 hostId = 4;
int32 orgId = 5;
int32 groupId = 6;
int32 groupSize = 7;
int32 numCpus = 8;
int64 totalMemory = 9;
repeated ContainerStat containerStats = 10;
ContainerHostType containerHostType = 11;
}
message CollectorContainer {
string hostName = 1;
string networkId = 11;
SystemInfo info = 2;
repeated Container containers = 3;
int32 groupId = 4;
int32 groupSize = 5;
reserved 6, 7; // Old, optional metadata fields
// Post-resolved fields
Host host = 8;
ContainerHostType containerHostType = 9;
}
message CollectorContainerRealTime {
string hostName = 1;
repeated ContainerStat stats = 2;
// Used for normalization at host-level.
int32 numCpus = 3;
int64 totalMemory = 4;
// Post-resolved fields
int64 hostId = 5;
int32 groupId = 6;
int32 groupSize = 7;
ContainerHostType containerHostType = 8;
}
message CollectorReqStatus {
string hostName = 2;
}
message CollectorPod {
string hostName = 1;
string clusterName = 2;
string clusterId = 3;
int32 groupId = 4;
int32 groupSize = 5;
repeated Pod pods = 6;
Host host = 7; // Post-resolved field
repeated string tags = 8;
}
message CollectorReplicaSet {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated ReplicaSet replicaSets = 5;
repeated string tags = 6;
}
message CollectorDeployment {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated Deployment deployments = 5;
repeated string tags = 6;
}
message CollectorService {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated Service services = 5;
repeated string tags = 6;
}
message CollectorNode {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated Node nodes = 5;
repeated string tags = 6;
map<string, Host> hostAliasMapping = 7;
}
message CollectorCluster {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
Cluster cluster = 5;
repeated string tags = 6;
}
message CollectorManifest {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated Manifest manifests = 5;
}
message CollectorJob {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated Job jobs = 5;
repeated string tags = 6;
}
message CollectorCronJob {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated CronJob cronJobs = 5;
repeated string tags = 6;
}
message CollectorDaemonSet {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated DaemonSet daemonSets = 5;
repeated string tags = 6;
}
message CollectorStatefulSet {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated StatefulSet statefulSets = 5;
repeated string tags = 6;
}
message CollectorPersistentVolume {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated PersistentVolume persistentVolumes = 5;
repeated string tags = 6;
}
message CollectorPersistentVolumeClaim {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated PersistentVolumeClaim persistentVolumeClaims = 5;
repeated string tags = 6;
}
message CollectorRole {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated Role roles = 5;
repeated string tags = 6;
}
message CollectorRoleBinding {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated RoleBinding roleBindings = 5;
repeated string tags = 6;
}
message CollectorClusterRole {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated ClusterRole clusterRoles = 5;
repeated string tags = 6;
}
message CollectorClusterRoleBinding {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated ClusterRoleBinding clusterRoleBindings = 5;
repeated string tags = 6;
}
message CollectorServiceAccount {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated ServiceAccount serviceAccounts = 5;
repeated string tags = 6;
}
message CollectorIngress {
string clusterName = 1;
string clusterId = 2;
int32 groupId = 3;
int32 groupSize = 4;
repeated Ingress ingresses = 5;
repeated string tags = 6;
}
//
// Models
//
message CollectorStatus {
int32 activeClients = 1;
int32 interval = 2;
}
message Process {
reserved 6;
uint32 key = 1;
int32 pid = 2;
int32 nsPid = 20;
Host host = 3;
Command command = 4;
ProcessUser user = 5;
MemoryStat memory = 7;
CPUStat cpu = 8;
int64 createTime = 9;
Container container = 10; // DEPRECATED - left in place to support previous versions
int32 openFdCount = 11;
ProcessState state = 12;
IOStat ioStat = 13;
string containerId = 14;
uint32 containerKey = 15;
uint64 voluntaryCtxSwitches = 16;
uint64 involuntaryCtxSwitches = 17;
bytes byteKey = 18;
bytes containerByteKey = 19;
ProcessNetworks networks = 21;
}
message ProcessDiscovery {
int32 pid = 1;
int32 nsPid = 2;
Host host = 3;
Command command = 4;
ProcessUser user = 5;
int64 createTime = 6;
bytes byteKey = 7;
}
message Command {
repeated string args = 1;
string cwd = 3;
string root = 4;
bool onDisk = 5;
int32 ppid = 6;
int32 pgroup = 7;
string exe = 8;
}
message ProcessUser {
string name = 1;
int32 uid = 2;
int32 gid = 3;
int32 euid = 4;
int32 egid = 5;
int32 suid = 6;
int32 sgid = 7;
}
// ProcessNetworks is a structure that holds network related metrics for processes
message ProcessNetworks {
float connectionRate = 1;
float bytesRate = 2;
}
// status section in https://docs.docker.com/engine/api/v1.29/#tag/Container
enum ContainerState {
unknown = 0;
created = 1;
restarting = 2;
running = 3;
paused = 4;
exited = 5;
dead = 6;
}
// https://blog.couchbase.com/docker-health-check-keeping-containers-healthy/
// health can be: starting, healthy, unhealthy
enum ContainerHealth {
unknownHealth = 0;
starting = 1;
healthy = 2;
unhealthy = 3;
}
// ContainerAddr records the IPs, Ports and Protocols for each container
message ContainerAddr {
string ip = 1;
int32 port = 2;
ConnectionType protocol = 3;
}
message Container {
reserved 7;
string type = 1;
string id = 2;
string name = 3; // DEPRECATED - left in place to support previous versions
string image = 4; // DEPRECATED - left in place to support previous versions
float cpuLimit = 5;
uint64 memoryLimit = 6;
ContainerState state = 8;
ContainerHealth health = 9;
int64 created = 10;
float rbps = 11;
float wbps = 12;
uint32 key = 13; // Unique key for a container resolved on backend.
float netRcvdPs = 14;
float netSentPs = 15;
float netRcvdBps = 16;
float netSentBps = 17;
float userPct = 18;
float systemPct = 19;
float totalPct = 20;
uint64 memRss = 21;
uint64 memCache = 22;
Host host = 23; // Used post-resolution
int64 started = 24;
bytes byteKey = 25;
repeated string tags = 26;
repeated ContainerAddr addresses = 27;
uint64 threadCount = 28;
uint64 threadLimit = 29;
}
// Process state codes in http://wiki.preshweb.co.uk/doku.php?id=linux:psflags
enum ProcessState {
U = 0; // unknown state
D = 1;
R = 2;
S = 3;
T = 4;
W = 5;
X = 6;
Z = 7;
}
// ProcessStat is used for real-time process messages. It should only contain
// data that can change for a running process (and relevant information to
// generate a key). We will send a lot of these in the real-time messages so
// it's critical to keep this small.
message ProcessStat {
int32 pid = 1;
// In milliseconds
int64 createTime = 2;
MemoryStat memory = 3;
CPUStat cpu = 4;
int32 nice = 5;
int32 threads = 7;
int32 openFdCount = 8;
uint32 key = 9;
// we need container id because we need to do the scoring by container
string containerId = 10;
ContainerState containerState = 11; // DEPRECATED
ProcessState processState = 12;
IOStat ioStat = 19;
ProcessNetworks networks = 28;
// DEPRECATED: All container-level stats (except ID) have moved into ContainerStat.
// These will be removed in the future.
// These stats are from the container level but are stored per-process
// because we don't send a container primitive yet.
ContainerHealth containerHealth = 15;
float containerRbps = 16;
float containerWbps = 17;
uint32 containerKey = 18;
float containerNetRcvdPs = 20;
float containerNetSentPs = 21;
float containerNetRcvdBps = 22;
float containerNetSentBps = 23;
uint64 voluntaryCtxSwitches = 24;
uint64 involuntaryCtxSwitches = 25;
bytes byteKey = 26;
bytes containerByteKey = 27;
}
// ProcStatsWithPerm is holding attributes for processes that requires extra permission to collect.
// It is used to pass data between system-probe and process-agent
message ProcStatsWithPerm {
int32 openFDCount = 1;
int64 readCount = 2;
int64 writeCount = 3;
int64 readBytes = 4;
int64 writeBytes = 5;
}
// ProcStatsWithPermByPID stores ProcStatsWithPerm in a map with key as PIDs
message ProcStatsWithPermByPID {
map<int32, ProcStatsWithPerm> statsByPID = 1;
}
// ContainerStat is used for real-time container messages. It should only contain
// data that can change for a running container (and relevant information to
// generate a key). We will send a lot of these in the real-time messages so
// it's critical to keep this small (basically no strings except ID)
message ContainerStat {
string id = 1;
float userPct = 2;
float systemPct = 3;
float totalPct = 4;
float cpuLimit = 5;
uint64 memRss = 6;
uint64 memCache = 7;
uint64 memLimit = 8;
float rbps = 9;
float wbps = 10;
float netRcvdPs = 11;
float netSentPs = 12;
float netRcvdBps = 13;
float netSentBps = 14;
ContainerState state = 15;
ContainerHealth health = 16;
// Post-resolved fields
uint32 key = 17;
int64 started = 18;
bytes byteKey = 19;
uint64 threadCount = 20;
uint64 threadLimit = 21;
}
// ResourceMetadata only holds enough information to identify a resource in connection data
message ResourceMetadata {
string id = 1;
uint32 key = 2;
bytes byteKey = 3;
repeated string tags = 4;
int32 tagIndex = 5;
int64 tagsModified = 6;
}
message SystemInfo {
reserved 4;
string uuid = 1;
OSInfo os = 2;
repeated CPUInfo cpus = 3;
int64 totalMemory = 5;
}
message OSInfo {
string name = 1;
string platform = 2;
string family = 3;
string version = 4;
string kernelVersion = 5;
}
message IOStat {
float readRate = 1;
float writeRate = 2;
float readBytesRate = 3;
float writeBytesRate = 4;
}
enum ConnectionType {
tcp = 0;
udp = 1;
}
enum ConnectionFamily {
v4 = 0;
v6 = 1;
}
enum ConnectionDirection {
unspecified = 0;
incoming = 1;
outgoing = 2;
local = 3;
none = 4;
}
enum EphemeralPortState {
ephemeralUnspecified = 0;
ephemeralTrue = 1;
ephemeralFalse = 2;
}
message Connection {
reserved 2, 3, 4, 7, 8, 9, 13, 14, 15, 35;
// Please update when adding fields
// next identifier: 44
int32 pid = 1;
Addr laddr = 5; // Local address
Addr raddr = 6; // Remote address
ConnectionFamily family = 10;
ConnectionType type = 11;
int64 pidCreateTime = 12;
EphemeralPortState isLocalPortEphemeral = 41;
// Relative counters since last check
uint64 lastBytesSent = 16;
uint64 lastBytesReceived = 17;
uint32 lastRetransmits = 18;
ConnectionDirection direction = 19;
uint64 lastPacketsSent = 38;
uint64 lastPacketsReceived = 39;
// Network namespace
uint32 netNS = 20;
// NetworkID of the remote address (post-resolution field)
string remoteNetworkId = 32;
// the conntrack entry associated with the connection. May be null on systems which don't support querying conntrack.
IPTranslation ipTranslation = 21;
// TCP-specific metrics
uint32 rtt = 22;
uint32 rttVar = 23;
// Indicates that this connection begins and ends on the same host
bool intraHost = 24;
// DNS-specific metrics
uint32 dnsSuccessfulResponses = 25;
uint32 dnsFailedResponses = 26;
uint32 dnsTimeouts = 27;
uint64 dnsSuccessLatencySum = 28;
uint64 dnsFailureLatencySum = 29;
map<uint32, uint32> dnsCountByRcode = 33;
// TCP state transition counters relative to last check
uint32 lastTcpEstablished = 30;
uint32 lastTcpClosed = 31;
// dns stats based on domain queried, the key corresponds to an index into the `domains` field
// dnsStatsByDomain is deprecated field, left in for handling old agent versions
map<int32, DNSStats> dnsStatsByDomain = 34;
// dnsStatsByDomainByQueryType is new field
map<int32, DNSStatsByQueryType> dnsStatsByDomainByQueryType = 42;
// int32 index into map is the offset into the CollectorConnections.encodedDomainDatabase
map<int32, DNSStatsByQueryType> dnsStatsByDomainOffsetByQueryType = 43;
int32 routeIdx = 36;
// the index of the resolved target of the route (post-resolution field)
int32 routeTargetIdx = 40;
// serialized HTTPAggregations object summarizing all http transactions recorded for this connection, organized by request path
bytes httpAggregations = 37;
}
message Connections {
repeated Connection conns = 1;
map<string, DNSEntry> dns = 2;
// For now, we'll keep emitting telemetry from agents < 7.35
ConnectionsTelemetry connTelemetry = 3;
repeated string domains = 4;
repeated Route routes = 5;
map<string, RuntimeCompilationTelemetry> compilationTelemetryByAsset = 6;
AgentConfiguration agentConfiguration = 7;
map<string, int64> connTelemetryMap = 9;
}
message Addr {
reserved 1, 4;
string ip = 2;
int32 port = 3;
string containerId = 5; // post-resolution field
int64 hostId = 6; // post-resolution field
}
message Route {
Subnet subnet = 1;
}
message Subnet {
string alias = 1;
}
message IPTranslation {
string replSrcIP = 1;
string replDstIP = 2;
int32 replSrcPort = 3;
int32 replDstPort = 4;
}
message MemoryStat {
uint64 rss = 1;
uint64 vms = 2;
uint64 swap = 3;
uint64 shared = 4;
uint64 text = 5;
uint64 lib = 6;
uint64 data = 7;
uint64 dirty = 8;
}
message CPUStat {
string lastCpu = 1;
float totalPct = 2;
float userPct = 3;
float systemPct = 4;
int32 numThreads = 5;
repeated SingleCPUStat cpus = 6;
int32 nice = 7;
int64 userTime = 8;
int64 systemTime = 9;
}
message SingleCPUStat {
string name = 1;
float totalPct = 2;
}
message CPUInfo {
int32 number = 1;
string vendor = 2;
string family = 3;
string model = 4;
string physicalId = 5;
string coreId = 6;
int32 cores = 7;
int64 mhz = 8;
int32 cacheSize = 9;
}
// Host is used in backend post-resolution
message Host {
reserved 4, 5;
int64 id = 1;
int32 orgId = 2;
string name = 3;
repeated string allTags = 6;
int32 numCpus = 7;
int64 totalMemory = 8;
int32 tagIndex = 9;
int64 tagsModified = 10;
}
message DNSEntry {
repeated string names = 1;
}
message Cluster {
int32 nodeCount = 1;
map<string, int32> kubeletVersions = 2;
map<string, int32> apiServerVersions = 3;
// sum of all nodes capacities and allocatables.
// Using smallest possible quantity levels.
// For memory it is bytes, for CPU it is millicore.
uint32 podCapacity = 4;
uint32 podAllocatable = 5;
uint64 memoryAllocatable = 6;
uint64 memoryCapacity = 7;
uint64 cpuAllocatable = 8;
uint64 cpuCapacity = 9;
string resourceVersion = 10;
int64 creationTimestamp = 11;
repeated string tags = 12;
}
// reference https://github.com/kubernetes/apimachinery/blob/2373d029717c4d169463414a6127cd1d0d12680e/pkg/apis/meta/v1/generated.proto#L521
message Metadata {
string name = 1;
string namespace = 2;
string uid = 3;
int64 creationTimestamp = 4;
int64 deletionTimestamp = 5;
repeated string labels = 6;
repeated string annotations = 7;
repeated OwnerReference ownerReferences = 8;
string resourceVersion = 9;
repeated string finalizers = 10;
}
message OwnerReference {
string name = 1;
string uid = 2;
string kind = 3;
}
// reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/pkg/apis/core/types.go#L4317
message ObjectReference {
string kind = 1;
string namespace = 2;
string name = 3;
string uid = 4;
string apiVersion = 5;
string resourceVersion = 6;
string fieldPath = 7;
}
// reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L4571
message ServicePort {
string name = 1;
string protocol = 2;
int32 port = 3;
string targetPort = 4; // int or str
int32 nodePort = 5;
}
// reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L4756
message ServiceSessionAffinityConfig {
int32 clientIPTimeoutSeconds = 1;
}
// reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L2107
message Node {
Metadata metadata = 1;
// spec reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L2312
string podCIDR = 2;
repeated string podCIDRs = 3;
bool unschedulable = 4;
repeated Taint taints = 5;
NodeStatus status = 6;
bytes yaml = 7;
// we parse it from the labels. Similar to upstream https://github.com/kubernetes/kubernetes/blob/1e12d92a5179dbfeb455c79dbf9120c8536e5f9c/pkg/printers/internalversion/printers.go#L1487
repeated string roles = 8;
repeated string tags = 9;
string providerID = 10;
Host host = 11; // Used post-resolution
}
// reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L2348
message NodeStatus {
// Key/Value of a resource type and a corresponding quantity as an int64.
map<string, int64> capacity = 1;
// Key/Value of a resource type and a corresponding quantity as an int64.
map<string, int64> allocatable = 2;
// https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L2127
// these are valid types https://github.com/kubernetes/api/blob/master/core/v1/types.go#L4739-L4753
map<string,string> nodeAddresses = 3;
// node status displayed by "kubectl get node"
// mostly based on NodeCondition
// and https://github.com/kubernetes/kubernetes/blob/1e12d92a5179dbfeb455c79dbf9120c8536e5f9c/pkg/printers/internalversion/printers.go#L1410
string status = 4;
string kubeletVersion = 5;
repeated NodeCondition conditions = 6;
repeated ContainerImage images = 7;
// node system info reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L2411
string kubeProxyVersion = 8;
string operatingSystem = 9;
string architecture = 10;
string kernelVersion = 11;
string osImage = 12;
string containerRuntimeVersion = 13;
}
// reference: https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L2158
message NodeCondition {
string type = 1;
string status = 2;
int64 lastTransitionTime = 3;
string reason = 4;
string message = 5;
}
// reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L777
message ContainerImage {
repeated string names = 1;
int64 sizeBytes = 2;
}
// reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L4849
message Taint {
string key = 1;
string value = 2;
string effect = 3;
int64 timeAdded = 4;
}
// reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L4620
message ServiceSpec {
repeated ServicePort ports = 1;
repeated LabelSelectorRequirement selectors = 2;
string clusterIP = 3;
string type = 4;
repeated string externalIPs = 5;
string sessionAffinity = 6;
string loadBalancerIP = 7;
repeated string loadBalancerSourceRanges = 8;
string externalName = 9;
string externalTrafficPolicy = 10;
int32 healthCheckNodePort = 11;
bool publishNotReadyAddresses = 12;
ServiceSessionAffinityConfig sessionAffinityConfig = 13;
string ipFamily = 14;
}
// reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/core/v1/generated.proto#L4748
message ServiceStatus {
repeated string loadBalancerIngress = 17;
}
// reference https://github.com/kubernetes/kubernetes/blob/release-1.19/staging/src/k8s.io/api/core/v1/generated.proto
message Service {
Metadata metadata = 1;
ServiceSpec spec = 2;
ServiceStatus status = 3;
bytes yaml = 4;
repeated string tags = 5;
}
// reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/apps/v1/generated.proto#L221
message Deployment {
Metadata metadata = 1;
// spec
int32 replicasDesired = 2;
string deploymentStrategy = 3;
string maxUnavailable = 4; // int or str
string maxSurge = 5; // int or str
bool paused = 6;
repeated LabelSelectorRequirement selectors = 7;
// status
int32 replicas = 8;
int32 updatedReplicas = 9;
int32 readyReplicas = 10;
int32 availableReplicas = 11;
int32 unavailableReplicas = 12;
string conditionMessage = 13;
repeated ResourceRequirements resourceRequirements = 16;
bytes yaml = 14;
repeated string tags = 15;
}
// reference https://github.com/kubernetes/kubernetes/blob/cb19b56831d54d1d31249949318ef0b07bf00df9/staging/src/k8s.io/api/apps/v1/generated.proto#L366
message ReplicaSet {
Metadata metadata = 1;
// spec
int32 replicasDesired = 2;
repeated LabelSelectorRequirement selectors = 3;
// status
int32 replicas = 4;
int32 fullyLabeledReplicas = 5;
int32 readyReplicas = 6;
int32 availableReplicas = 7;
repeated ResourceRequirements resourceRequirements = 10;
bytes yaml = 8;
repeated string tags = 9;
}
message LabelSelectorRequirement {
string key = 1;
// Valid operators are In, NotIn, Exists and DoesNotExist.
string operator = 2;