This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
/
cluster_service.py
7268 lines (6509 loc) · 240 KB
/
cluster_service.py
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
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from typing import MutableMapping, MutableSequence
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
from google.protobuf import wrappers_pb2 # type: ignore
from google.rpc import code_pb2 # type: ignore
from google.rpc import status_pb2 # type: ignore
import proto # type: ignore
__protobuf__ = proto.module(
package="google.container.v1",
manifest={
"PrivateIPv6GoogleAccess",
"UpgradeResourceType",
"DatapathProvider",
"NodePoolUpdateStrategy",
"StackType",
"IPv6AccessType",
"LinuxNodeConfig",
"NodeKubeletConfig",
"NodeConfig",
"AdvancedMachineFeatures",
"NodeNetworkConfig",
"ShieldedInstanceConfig",
"SandboxConfig",
"GcfsConfig",
"ReservationAffinity",
"NodeTaint",
"NodeTaints",
"NodeLabels",
"ResourceLabels",
"NetworkTags",
"MasterAuth",
"ClientCertificateConfig",
"AddonsConfig",
"HttpLoadBalancing",
"HorizontalPodAutoscaling",
"KubernetesDashboard",
"NetworkPolicyConfig",
"DnsCacheConfig",
"PrivateClusterMasterGlobalAccessConfig",
"PrivateClusterConfig",
"AuthenticatorGroupsConfig",
"CloudRunConfig",
"ConfigConnectorConfig",
"GcePersistentDiskCsiDriverConfig",
"GcpFilestoreCsiDriverConfig",
"GkeBackupAgentConfig",
"MasterAuthorizedNetworksConfig",
"LegacyAbac",
"NetworkPolicy",
"BinaryAuthorization",
"IPAllocationPolicy",
"Cluster",
"NodePoolAutoConfig",
"NodePoolDefaults",
"NodeConfigDefaults",
"ClusterUpdate",
"Operation",
"OperationProgress",
"CreateClusterRequest",
"GetClusterRequest",
"UpdateClusterRequest",
"UpdateNodePoolRequest",
"SetNodePoolAutoscalingRequest",
"SetLoggingServiceRequest",
"SetMonitoringServiceRequest",
"SetAddonsConfigRequest",
"SetLocationsRequest",
"UpdateMasterRequest",
"SetMasterAuthRequest",
"DeleteClusterRequest",
"ListClustersRequest",
"ListClustersResponse",
"GetOperationRequest",
"ListOperationsRequest",
"CancelOperationRequest",
"ListOperationsResponse",
"GetServerConfigRequest",
"ServerConfig",
"CreateNodePoolRequest",
"DeleteNodePoolRequest",
"ListNodePoolsRequest",
"GetNodePoolRequest",
"BlueGreenSettings",
"NodePool",
"NodeManagement",
"AutoUpgradeOptions",
"MaintenancePolicy",
"MaintenanceWindow",
"TimeWindow",
"MaintenanceExclusionOptions",
"RecurringTimeWindow",
"DailyMaintenanceWindow",
"SetNodePoolManagementRequest",
"SetNodePoolSizeRequest",
"CompleteNodePoolUpgradeRequest",
"RollbackNodePoolUpgradeRequest",
"ListNodePoolsResponse",
"ClusterAutoscaling",
"AutoprovisioningNodePoolDefaults",
"ResourceLimit",
"NodePoolAutoscaling",
"SetLabelsRequest",
"SetLegacyAbacRequest",
"StartIPRotationRequest",
"CompleteIPRotationRequest",
"AcceleratorConfig",
"GPUSharingConfig",
"WorkloadMetadataConfig",
"SetNetworkPolicyRequest",
"SetMaintenancePolicyRequest",
"StatusCondition",
"NetworkConfig",
"GatewayAPIConfig",
"ServiceExternalIPsConfig",
"GetOpenIDConfigRequest",
"GetOpenIDConfigResponse",
"GetJSONWebKeysRequest",
"Jwk",
"GetJSONWebKeysResponse",
"ReleaseChannel",
"CostManagementConfig",
"IntraNodeVisibilityConfig",
"ILBSubsettingConfig",
"DNSConfig",
"MaxPodsConstraint",
"WorkloadIdentityConfig",
"IdentityServiceConfig",
"MeshCertificates",
"DatabaseEncryption",
"ListUsableSubnetworksRequest",
"ListUsableSubnetworksResponse",
"UsableSubnetworkSecondaryRange",
"UsableSubnetwork",
"ResourceUsageExportConfig",
"VerticalPodAutoscaling",
"DefaultSnatStatus",
"ShieldedNodes",
"VirtualNIC",
"FastSocket",
"NotificationConfig",
"ConfidentialNodes",
"UpgradeEvent",
"UpgradeAvailableEvent",
"SecurityBulletinEvent",
"Autopilot",
"LoggingConfig",
"LoggingComponentConfig",
"MonitoringConfig",
"NodePoolLoggingConfig",
"LoggingVariantConfig",
"MonitoringComponentConfig",
"ManagedPrometheusConfig",
},
)
class PrivateIPv6GoogleAccess(proto.Enum):
r"""PrivateIPv6GoogleAccess controls whether and how the pods can
communicate with Google Services through gRPC over IPv6.
"""
PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0
PRIVATE_IPV6_GOOGLE_ACCESS_DISABLED = 1
PRIVATE_IPV6_GOOGLE_ACCESS_TO_GOOGLE = 2
PRIVATE_IPV6_GOOGLE_ACCESS_BIDIRECTIONAL = 3
class UpgradeResourceType(proto.Enum):
r"""UpgradeResourceType is the resource type that is upgrading.
It is used in upgrade notifications.
"""
UPGRADE_RESOURCE_TYPE_UNSPECIFIED = 0
MASTER = 1
NODE_POOL = 2
class DatapathProvider(proto.Enum):
r"""The datapath provider selects the implementation of the
Kubernetes networking model for service resolution and network
policy enforcement.
"""
DATAPATH_PROVIDER_UNSPECIFIED = 0
LEGACY_DATAPATH = 1
ADVANCED_DATAPATH = 2
class NodePoolUpdateStrategy(proto.Enum):
r"""Strategy used for node pool update."""
NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0
BLUE_GREEN = 2
SURGE = 3
class StackType(proto.Enum):
r"""Possible values for IP stack type"""
STACK_TYPE_UNSPECIFIED = 0
IPV4 = 1
IPV4_IPV6 = 2
class IPv6AccessType(proto.Enum):
r"""Possible values for IPv6 access type"""
IPV6_ACCESS_TYPE_UNSPECIFIED = 0
INTERNAL = 1
EXTERNAL = 2
class LinuxNodeConfig(proto.Message):
r"""Parameters that can be configured on Linux nodes.
Attributes:
sysctls (MutableMapping[str, str]):
The Linux kernel parameters to be applied to the nodes and
all pods running on the nodes.
The following parameters are supported.
net.core.busy_poll net.core.busy_read
net.core.netdev_max_backlog net.core.rmem_max
net.core.wmem_default net.core.wmem_max net.core.optmem_max
net.core.somaxconn net.ipv4.tcp_rmem net.ipv4.tcp_wmem
net.ipv4.tcp_tw_reuse
cgroup_mode (google.cloud.container_v1.types.LinuxNodeConfig.CgroupMode):
cgroup_mode specifies the cgroup mode to be used on the
node.
"""
class CgroupMode(proto.Enum):
r"""Possible cgroup modes that can be used."""
CGROUP_MODE_UNSPECIFIED = 0
CGROUP_MODE_V1 = 1
CGROUP_MODE_V2 = 2
sysctls: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=1,
)
cgroup_mode: CgroupMode = proto.Field(
proto.ENUM,
number=2,
enum=CgroupMode,
)
class NodeKubeletConfig(proto.Message):
r"""Node kubelet configs.
Attributes:
cpu_manager_policy (str):
Control the CPU management policy on the node. See
https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/
The following values are allowed.
- "none": the default, which represents the existing
scheduling behavior.
- "static": allows pods with certain resource
characteristics to be granted increased CPU affinity and
exclusivity on the node. The default value is 'none' if
unspecified.
cpu_cfs_quota (google.protobuf.wrappers_pb2.BoolValue):
Enable CPU CFS quota enforcement for
containers that specify CPU limits.
This option is enabled by default which makes
kubelet use CFS quota
(https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt)
to enforce container CPU limits. Otherwise, CPU
limits will not be enforced at all.
Disable this option to mitigate CPU throttling
problems while still having your pods to be in
Guaranteed QoS class by specifying the CPU
limits.
The default value is 'true' if unspecified.
cpu_cfs_quota_period (str):
Set the CPU CFS quota period value 'cpu.cfs_period_us'.
The string must be a sequence of decimal numbers, each with
optional fraction and a unit suffix, such as "300ms". Valid
time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
The value must be a positive duration.
pod_pids_limit (int):
Set the Pod PID limits. See
https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits
Controls the maximum number of processes allowed
to run in a pod. The value must be greater than
or equal to 1024 and less than 4194304.
"""
cpu_manager_policy: str = proto.Field(
proto.STRING,
number=1,
)
cpu_cfs_quota: wrappers_pb2.BoolValue = proto.Field(
proto.MESSAGE,
number=2,
message=wrappers_pb2.BoolValue,
)
cpu_cfs_quota_period: str = proto.Field(
proto.STRING,
number=3,
)
pod_pids_limit: int = proto.Field(
proto.INT64,
number=4,
)
class NodeConfig(proto.Message):
r"""Parameters that describe the nodes in a cluster.
GKE Autopilot clusters do not recognize parameters in
``NodeConfig``. Use
[AutoprovisioningNodePoolDefaults][google.container.v1.AutoprovisioningNodePoolDefaults]
instead.
Attributes:
machine_type (str):
The name of a Google Compute Engine `machine
type <https://cloud.google.com/compute/docs/machine-types>`__
If unspecified, the default machine type is ``e2-medium``.
disk_size_gb (int):
Size of the disk attached to each node,
specified in GB. The smallest allowed disk size
is 10GB.
If unspecified, the default disk size is 100GB.
oauth_scopes (MutableSequence[str]):
The set of Google API scopes to be made available on all of
the node VMs under the "default" service account.
The following scopes are recommended, but not required, and
by default are not included:
- ``https://www.googleapis.com/auth/compute`` is required
for mounting persistent storage on your nodes.
- ``https://www.googleapis.com/auth/devstorage.read_only``
is required for communicating with **gcr.io** (the
`Google Container
Registry <https://cloud.google.com/container-registry/>`__).
If unspecified, no scopes are added, unless Cloud Logging or
Cloud Monitoring are enabled, in which case their required
scopes will be added.
service_account (str):
The Google Cloud Platform Service Account to
be used by the node VMs. Specify the email
address of the Service Account; otherwise, if no
Service Account is specified, the "default"
service account is used.
metadata (MutableMapping[str, str]):
The metadata key/value pairs assigned to instances in the
cluster.
Keys must conform to the regexp ``[a-zA-Z0-9-_]+`` and be
less than 128 bytes in length. These are reflected as part
of a URL in the metadata server. Additionally, to avoid
ambiguity, keys must not conflict with any other metadata
keys for the project or be one of the reserved keys:
- "cluster-location"
- "cluster-name"
- "cluster-uid"
- "configure-sh"
- "containerd-configure-sh"
- "enable-os-login"
- "gci-ensure-gke-docker"
- "gci-metrics-enabled"
- "gci-update-strategy"
- "instance-template"
- "kube-env"
- "startup-script"
- "user-data"
- "disable-address-manager"
- "windows-startup-script-ps1"
- "common-psm1"
- "k8s-node-setup-psm1"
- "install-ssh-psm1"
- "user-profile-psm1"
Values are free-form strings, and only have meaning as
interpreted by the image running in the instance. The only
restriction placed on them is that each value's size must be
less than or equal to 32 KB.
The total size of all keys and values must be less than 512
KB.
image_type (str):
The image type to use for this node. Note
that for a given image type, the latest version
of it will be used.
labels (MutableMapping[str, str]):
The map of Kubernetes labels (key/value
pairs) to be applied to each node. These will
added in addition to any default label(s) that
Kubernetes may apply to the node.
In case of conflict in label keys, the applied
set may differ depending on the Kubernetes
version -- it's best to assume the behavior is
undefined and conflicts should be avoided.
For more information, including usage and the
valid values, see:
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
local_ssd_count (int):
The number of local SSD disks to be attached
to the node.
The limit for this value is dependent upon the
maximum number of disks available on a machine
per zone. See:
https://cloud.google.com/compute/docs/disks/local-ssd
for more information.
tags (MutableSequence[str]):
The list of instance tags applied to all
nodes. Tags are used to identify valid sources
or targets for network firewalls and are
specified by the client during cluster or node
pool creation. Each tag within the list must
comply with RFC1035.
preemptible (bool):
Whether the nodes are created as preemptible
VM instances. See:
https://cloud.google.com/compute/docs/instances/preemptible
for more information about preemptible VM
instances.
accelerators (MutableSequence[google.cloud.container_v1.types.AcceleratorConfig]):
A list of hardware accelerators to be
attached to each node. See
https://cloud.google.com/compute/docs/gpus for
more information about support for GPUs.
disk_type (str):
Type of the disk attached to each node (e.g.
'pd-standard', 'pd-ssd' or 'pd-balanced')
If unspecified, the default disk type is
'pd-standard'
min_cpu_platform (str):
Minimum CPU platform to be used by this instance. The
instance may be scheduled on the specified or newer CPU
platform. Applicable values are the friendly names of CPU
platforms, such as ``minCpuPlatform: "Intel Haswell"`` or
``minCpuPlatform: "Intel Sandy Bridge"``. For more
information, read `how to specify min CPU
platform <https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform>`__
workload_metadata_config (google.cloud.container_v1.types.WorkloadMetadataConfig):
The workload metadata configuration for this
node.
taints (MutableSequence[google.cloud.container_v1.types.NodeTaint]):
List of kubernetes taints to be applied to
each node.
For more information, including usage and the
valid values, see:
https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
sandbox_config (google.cloud.container_v1.types.SandboxConfig):
Sandbox configuration for this node.
node_group (str):
Setting this field will assign instances of this pool to run
on the specified node group. This is useful for running
workloads on `sole tenant
nodes <https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes>`__.
reservation_affinity (google.cloud.container_v1.types.ReservationAffinity):
The optional reservation affinity. Setting this field will
apply the specified `Zonal Compute
Reservation <https://cloud.google.com/compute/docs/instances/reserving-zonal-resources>`__
to this node pool.
shielded_instance_config (google.cloud.container_v1.types.ShieldedInstanceConfig):
Shielded Instance options.
linux_node_config (google.cloud.container_v1.types.LinuxNodeConfig):
Parameters that can be configured on Linux
nodes.
kubelet_config (google.cloud.container_v1.types.NodeKubeletConfig):
Node kubelet configs.
boot_disk_kms_key (str):
The Customer Managed Encryption Key used to encrypt the boot
disk attached to each node in the node pool. This should be
of the form
projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME].
For more information about protecting resources with Cloud
KMS Keys please see:
https://cloud.google.com/compute/docs/disks/customer-managed-encryption
gcfs_config (google.cloud.container_v1.types.GcfsConfig):
Google Container File System (image
streaming) configs.
advanced_machine_features (google.cloud.container_v1.types.AdvancedMachineFeatures):
Advanced features for the Compute Engine VM.
gvnic (google.cloud.container_v1.types.VirtualNIC):
Enable or disable gvnic in the node pool.
spot (bool):
Spot flag for enabling Spot VM, which is a
rebrand of the existing preemptible flag.
confidential_nodes (google.cloud.container_v1.types.ConfidentialNodes):
Confidential nodes config.
All the nodes in the node pool will be
Confidential VM once enabled.
fast_socket (google.cloud.container_v1.types.FastSocket):
Enable or disable NCCL fast socket for the
node pool.
This field is a member of `oneof`_ ``_fast_socket``.
resource_labels (MutableMapping[str, str]):
The resource labels for the node pool to use
to annotate any related Google Compute Engine
resources.
logging_config (google.cloud.container_v1.types.NodePoolLoggingConfig):
Logging configuration.
"""
machine_type: str = proto.Field(
proto.STRING,
number=1,
)
disk_size_gb: int = proto.Field(
proto.INT32,
number=2,
)
oauth_scopes: MutableSequence[str] = proto.RepeatedField(
proto.STRING,
number=3,
)
service_account: str = proto.Field(
proto.STRING,
number=9,
)
metadata: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=4,
)
image_type: str = proto.Field(
proto.STRING,
number=5,
)
labels: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=6,
)
local_ssd_count: int = proto.Field(
proto.INT32,
number=7,
)
tags: MutableSequence[str] = proto.RepeatedField(
proto.STRING,
number=8,
)
preemptible: bool = proto.Field(
proto.BOOL,
number=10,
)
accelerators: MutableSequence["AcceleratorConfig"] = proto.RepeatedField(
proto.MESSAGE,
number=11,
message="AcceleratorConfig",
)
disk_type: str = proto.Field(
proto.STRING,
number=12,
)
min_cpu_platform: str = proto.Field(
proto.STRING,
number=13,
)
workload_metadata_config: "WorkloadMetadataConfig" = proto.Field(
proto.MESSAGE,
number=14,
message="WorkloadMetadataConfig",
)
taints: MutableSequence["NodeTaint"] = proto.RepeatedField(
proto.MESSAGE,
number=15,
message="NodeTaint",
)
sandbox_config: "SandboxConfig" = proto.Field(
proto.MESSAGE,
number=17,
message="SandboxConfig",
)
node_group: str = proto.Field(
proto.STRING,
number=18,
)
reservation_affinity: "ReservationAffinity" = proto.Field(
proto.MESSAGE,
number=19,
message="ReservationAffinity",
)
shielded_instance_config: "ShieldedInstanceConfig" = proto.Field(
proto.MESSAGE,
number=20,
message="ShieldedInstanceConfig",
)
linux_node_config: "LinuxNodeConfig" = proto.Field(
proto.MESSAGE,
number=21,
message="LinuxNodeConfig",
)
kubelet_config: "NodeKubeletConfig" = proto.Field(
proto.MESSAGE,
number=22,
message="NodeKubeletConfig",
)
boot_disk_kms_key: str = proto.Field(
proto.STRING,
number=23,
)
gcfs_config: "GcfsConfig" = proto.Field(
proto.MESSAGE,
number=25,
message="GcfsConfig",
)
advanced_machine_features: "AdvancedMachineFeatures" = proto.Field(
proto.MESSAGE,
number=26,
message="AdvancedMachineFeatures",
)
gvnic: "VirtualNIC" = proto.Field(
proto.MESSAGE,
number=29,
message="VirtualNIC",
)
spot: bool = proto.Field(
proto.BOOL,
number=32,
)
confidential_nodes: "ConfidentialNodes" = proto.Field(
proto.MESSAGE,
number=35,
message="ConfidentialNodes",
)
fast_socket: "FastSocket" = proto.Field(
proto.MESSAGE,
number=36,
optional=True,
message="FastSocket",
)
resource_labels: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=37,
)
logging_config: "NodePoolLoggingConfig" = proto.Field(
proto.MESSAGE,
number=38,
message="NodePoolLoggingConfig",
)
class AdvancedMachineFeatures(proto.Message):
r"""Specifies options for controlling advanced machine features.
Attributes:
threads_per_core (int):
The number of threads per physical core. To
disable simultaneous multithreading (SMT) set
this to 1. If unset, the maximum number of
threads supported per core by the underlying
processor is assumed.
This field is a member of `oneof`_ ``_threads_per_core``.
"""
threads_per_core: int = proto.Field(
proto.INT64,
number=1,
optional=True,
)
class NodeNetworkConfig(proto.Message):
r"""Parameters for node pool-level network config.
Attributes:
create_pod_range (bool):
Input only. Whether to create a new range for pod IPs in
this node pool. Defaults are provided for ``pod_range`` and
``pod_ipv4_cidr_block`` if they are not specified.
If neither ``create_pod_range`` or ``pod_range`` are
specified, the cluster-level default
(``ip_allocation_policy.cluster_ipv4_cidr_block``) is used.
Only applicable if ``ip_allocation_policy.use_ip_aliases``
is true.
This field cannot be changed after the node pool has been
created.
pod_range (str):
The ID of the secondary range for pod IPs. If
``create_pod_range`` is true, this ID is used for the new
range. If ``create_pod_range`` is false, uses an existing
secondary range with this ID.
Only applicable if ``ip_allocation_policy.use_ip_aliases``
is true.
This field cannot be changed after the node pool has been
created.
pod_ipv4_cidr_block (str):
The IP address range for pod IPs in this node pool.
Only applicable if ``create_pod_range`` is true.
Set to blank to have a range chosen with the default size.
Set to /netmask (e.g. ``/14``) to have a range chosen with a
specific netmask.
Set to a
`CIDR <https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing>`__
notation (e.g. ``10.96.0.0/14``) to pick a specific range to
use.
Only applicable if ``ip_allocation_policy.use_ip_aliases``
is true.
This field cannot be changed after the node pool has been
created.
enable_private_nodes (bool):
Whether nodes have internal IP addresses only. If
enable_private_nodes is not specified, then the value is
derived from
[cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes]
This field is a member of `oneof`_ ``_enable_private_nodes``.
network_performance_config (google.cloud.container_v1.types.NodeNetworkConfig.NetworkPerformanceConfig):
Network bandwidth tier configuration.
This field is a member of `oneof`_ ``_network_performance_config``.
"""
class NetworkPerformanceConfig(proto.Message):
r"""Configuration of all network bandwidth tiers
Attributes:
total_egress_bandwidth_tier (google.cloud.container_v1.types.NodeNetworkConfig.NetworkPerformanceConfig.Tier):
Specifies the total network bandwidth tier
for the NodePool.
This field is a member of `oneof`_ ``_total_egress_bandwidth_tier``.
"""
class Tier(proto.Enum):
r"""Node network tier"""
TIER_UNSPECIFIED = 0
TIER_1 = 1
total_egress_bandwidth_tier: "NodeNetworkConfig.NetworkPerformanceConfig.Tier" = proto.Field(
proto.ENUM,
number=1,
optional=True,
enum="NodeNetworkConfig.NetworkPerformanceConfig.Tier",
)
create_pod_range: bool = proto.Field(
proto.BOOL,
number=4,
)
pod_range: str = proto.Field(
proto.STRING,
number=5,
)
pod_ipv4_cidr_block: str = proto.Field(
proto.STRING,
number=6,
)
enable_private_nodes: bool = proto.Field(
proto.BOOL,
number=9,
optional=True,
)
network_performance_config: NetworkPerformanceConfig = proto.Field(
proto.MESSAGE,
number=11,
optional=True,
message=NetworkPerformanceConfig,
)
class ShieldedInstanceConfig(proto.Message):
r"""A set of Shielded Instance options.
Attributes:
enable_secure_boot (bool):
Defines whether the instance has Secure Boot
enabled.
Secure Boot helps ensure that the system only
runs authentic software by verifying the digital
signature of all boot components, and halting
the boot process if signature verification
fails.
enable_integrity_monitoring (bool):
Defines whether the instance has integrity
monitoring enabled.
Enables monitoring and attestation of the boot
integrity of the instance. The attestation is
performed against the integrity policy baseline.
This baseline is initially derived from the
implicitly trusted boot image when the instance
is created.
"""
enable_secure_boot: bool = proto.Field(
proto.BOOL,
number=1,
)
enable_integrity_monitoring: bool = proto.Field(
proto.BOOL,
number=2,
)
class SandboxConfig(proto.Message):
r"""SandboxConfig contains configurations of the sandbox to use
for the node.
Attributes:
type_ (google.cloud.container_v1.types.SandboxConfig.Type):
Type of the sandbox to use for the node.
"""
class Type(proto.Enum):
r"""Possible types of sandboxes."""
UNSPECIFIED = 0
GVISOR = 1
type_: Type = proto.Field(
proto.ENUM,
number=2,
enum=Type,
)
class GcfsConfig(proto.Message):
r"""GcfsConfig contains configurations of Google Container File
System (image streaming).
Attributes:
enabled (bool):
Whether to use GCFS.
"""
enabled: bool = proto.Field(
proto.BOOL,
number=1,
)
class ReservationAffinity(proto.Message):
r"""`ReservationAffinity <https://cloud.google.com/compute/docs/instances/reserving-zonal-resources>`__
is the configuration of desired reservation which instances could
take capacity from.
Attributes:
consume_reservation_type (google.cloud.container_v1.types.ReservationAffinity.Type):
Corresponds to the type of reservation
consumption.
key (str):
Corresponds to the label key of a reservation resource. To
target a SPECIFIC_RESERVATION by name, specify
"compute.googleapis.com/reservation-name" as the key and
specify the name of your reservation as its value.
values (MutableSequence[str]):
Corresponds to the label value(s) of
reservation resource(s).
"""
class Type(proto.Enum):
r"""Indicates whether to consume capacity from a reservation or
not.
"""
UNSPECIFIED = 0
NO_RESERVATION = 1
ANY_RESERVATION = 2
SPECIFIC_RESERVATION = 3
consume_reservation_type: Type = proto.Field(
proto.ENUM,
number=1,
enum=Type,
)
key: str = proto.Field(
proto.STRING,
number=2,
)
values: MutableSequence[str] = proto.RepeatedField(
proto.STRING,
number=3,
)
class NodeTaint(proto.Message):
r"""Kubernetes taint is comprised of three fields: key, value, and
effect. Effect can only be one of three types: NoSchedule,
PreferNoSchedule or NoExecute.
See
`here <https://kubernetes.io/docs/concepts/configuration/taint-and-toleration>`__
for more information, including usage and the valid values.
Attributes:
key (str):
Key for taint.
value (str):
Value for taint.
effect (google.cloud.container_v1.types.NodeTaint.Effect):
Effect for taint.
"""
class Effect(proto.Enum):
r"""Possible values for Effect in taint."""
EFFECT_UNSPECIFIED = 0
NO_SCHEDULE = 1
PREFER_NO_SCHEDULE = 2
NO_EXECUTE = 3
key: str = proto.Field(
proto.STRING,
number=1,
)
value: str = proto.Field(
proto.STRING,
number=2,
)
effect: Effect = proto.Field(
proto.ENUM,
number=3,
enum=Effect,
)
class NodeTaints(proto.Message):
r"""Collection of Kubernetes `node
taints <https://kubernetes.io/docs/concepts/configuration/taint-and-toleration>`__.
Attributes:
taints (MutableSequence[google.cloud.container_v1.types.NodeTaint]):
List of node taints.
"""
taints: MutableSequence["NodeTaint"] = proto.RepeatedField(
proto.MESSAGE,
number=1,
message="NodeTaint",
)
class NodeLabels(proto.Message):
r"""Collection of node-level `Kubernetes
labels <https://kubernetes.io/docs/concepts/overview/working-with-objects/labels>`__.
Attributes:
labels (MutableMapping[str, str]):
Map of node label keys and node label values.
"""
labels: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=1,
)
class ResourceLabels(proto.Message):
r"""Collection of `GCP
labels <https://cloud.google.com/resource-manager/docs/creating-managing-labels>`__.
Attributes:
labels (MutableMapping[str, str]):
Map of node label keys and node label values.
"""
labels: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=1,
)
class NetworkTags(proto.Message):
r"""Collection of Compute Engine network tags that can be applied
to a node's underlying VM instance.
Attributes:
tags (MutableSequence[str]):