Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit f3126af

Browse files
feat: add SoleTenantConfig API (#369)
* docs: Operation.Type is now documented in detail docs: Operation.self_link and Operation.target_link given examples feat: Cluster resizes will now have their own operation type (RESIZE_CLUSTER) instead of reusing REPAIR_CLUSTER; they will start using this in the near future PiperOrigin-RevId: 526970355 Source-Link: googleapis/googleapis@83fd1f9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5a191c3aa2c526a59eea597c7ddda79481b8e858 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWExOTFjM2FhMmM1MjZhNTllZWE1OTdjN2RkZGE3OTQ4MWI4ZTg1OCJ9 docs: Operation.Type is now documented in detail docs: Operation.self_link and Operation.target_link given examples feat: Cluster resizes will now have their own operation type (RESIZE_CLUSTER) instead of reusing REPAIR_CLUSTER; they will start using this in the near future PiperOrigin-RevId: 526025502 Source-Link: googleapis/googleapis@4273180 Source-Link: https://github.com/googleapis/googleapis-gen/commit/772e2cd48f561e1f0a4d172e9f9285ad9e1c1210 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzcyZTJjZDQ4ZjU2MWUxZjBhNGQxNzJlOWY5Mjg1YWQ5ZTFjMTIxMCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: support fleet registration via cluster update PiperOrigin-RevId: 529131876 Source-Link: googleapis/googleapis@d175293 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b680d48a0f6762d94e0e14ebffb7868e6c59335b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjY4MGQ0OGEwZjY3NjJkOTRlMGUxNGViZmZiNzg2OGU2YzU5MzM1YiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add a new feature for fleet registration via cluster update in v1alpha1, v1beta1, v1 PiperOrigin-RevId: 529516002 Source-Link: googleapis/googleapis@5ce0665 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5122c363014832df2113f474f56137b4bc0b3ca3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTEyMmMzNjMwMTQ4MzJkZjIxMTNmNDc0ZjU2MTM3YjRiYzBiM2NhMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: clarified release channel defaulting behavior for create cluster requests when release channel is unspecified If release channel is left unspecified on cluster creation and a version is specified, the cluster is now enrolled in the most mature release channel where the version is available (first checking STABLE, then REGULAR, and finally RAPID) instead of being enrolled in STATIC. This only affects clusters with node auto upgrades enabled and no explicit node version specified. To ensure new clusters are enrolled in static, explicitly specify that the cluster should not be enrolled in a channel. PiperOrigin-RevId: 532773421 Source-Link: googleapis/googleapis@633d3c1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f779f562476199d1f02156ac28f97ec9e37067eb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjc3OWY1NjI0NzYxOTlkMWYwMjE1NmFjMjhmOTdlYzllMzcwNjdlYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: clarified release channel defaulting behavior for create cluster requests when release channel is unspecified If release channel is left unspecified on cluster creation and a version is specified, the cluster is now enrolled in the most mature release channel where the version is available (first checking STABLE, then REGULAR, and finally RAPID) instead of being enrolled in STATIC. This only affects clusters with node auto upgrades enabled and no explicit node version specified. To ensure new clusters are enrolled in static, explicitly specify that the cluster should not be enrolled in a channel. PiperOrigin-RevId: 532773462 Source-Link: googleapis/googleapis@aeae5ea Source-Link: https://github.com/googleapis/googleapis-gen/commit/d4d433d4eaa8b4d780f83062bf1a81d04646ea41 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDRkNDMzZDRlYWE4YjRkNzgwZjgzMDYyYmYxYTgxZDA0NjQ2ZWE0MSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add SoleTenantConfig API PiperOrigin-RevId: 536516473 Source-Link: googleapis/googleapis@0fb1181 Source-Link: https://github.com/googleapis/googleapis-gen/commit/3d69310994242d5bdb9d345f4d894d45b7262f9d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiM2Q2OTMxMDk5NDI0MmQ1YmRiOWQzNDVmNGQ4OTRkNDViNzI2MmY5ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add SoleTenantConfig API PiperOrigin-RevId: 536569254 Source-Link: googleapis/googleapis@3cc45f0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ed8d7546cd177053d5312d0e40f7f506352ba805 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ4ZDc1NDZjZDE3NzA1M2Q1MzEyZDBlNDBmN2Y1MDYzNTJiYTgwNSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 31d7cb9 commit f3126af

File tree

9 files changed

+450
-56
lines changed

9 files changed

+450
-56
lines changed

google/cloud/container/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
SetNodePoolSizeRequest,
157157
ShieldedInstanceConfig,
158158
ShieldedNodes,
159+
SoleTenantConfig,
159160
StackType,
160161
StartIPRotationRequest,
161162
StatusCondition,
@@ -305,6 +306,7 @@
305306
"SetNodePoolSizeRequest",
306307
"ShieldedInstanceConfig",
307308
"ShieldedNodes",
309+
"SoleTenantConfig",
308310
"StartIPRotationRequest",
309311
"StatusCondition",
310312
"TimeWindow",

google/cloud/container_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@
151151
SetNodePoolSizeRequest,
152152
ShieldedInstanceConfig,
153153
ShieldedNodes,
154+
SoleTenantConfig,
154155
StackType,
155156
StartIPRotationRequest,
156157
StatusCondition,
@@ -304,6 +305,7 @@
304305
"SetNodePoolSizeRequest",
305306
"ShieldedInstanceConfig",
306307
"ShieldedNodes",
308+
"SoleTenantConfig",
307309
"StackType",
308310
"StartIPRotationRequest",
309311
"StatusCondition",

google/cloud/container_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
SetNodePoolSizeRequest,
146146
ShieldedInstanceConfig,
147147
ShieldedNodes,
148+
SoleTenantConfig,
148149
StackType,
149150
StartIPRotationRequest,
150151
StatusCondition,
@@ -292,6 +293,7 @@
292293
"SetNodePoolSizeRequest",
293294
"ShieldedInstanceConfig",
294295
"ShieldedNodes",
296+
"SoleTenantConfig",
295297
"StartIPRotationRequest",
296298
"StatusCondition",
297299
"TimeWindow",

google/cloud/container_v1/types/cluster_service.py

Lines changed: 205 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"SandboxConfig",
4444
"GcfsConfig",
4545
"ReservationAffinity",
46+
"SoleTenantConfig",
4647
"NodeTaint",
4748
"NodeTaints",
4849
"NodeLabels",
@@ -656,6 +657,9 @@ class NodeConfig(proto.Message):
656657
Parameters for the node ephemeral storage
657658
using Local SSDs. If unspecified, ephemeral
658659
storage is backed by the boot disk.
660+
sole_tenant_config (google.cloud.container_v1.types.SoleTenantConfig):
661+
Parameters for node pools to be backed by
662+
shared sole tenant node groups.
659663
"""
660664

661665
machine_type: str = proto.Field(
@@ -811,6 +815,11 @@ class NodeConfig(proto.Message):
811815
number=41,
812816
message="EphemeralStorageLocalSsdConfig",
813817
)
818+
sole_tenant_config: "SoleTenantConfig" = proto.Field(
819+
proto.MESSAGE,
820+
number=42,
821+
message="SoleTenantConfig",
822+
)
814823

815824

816825
class AdvancedMachineFeatures(proto.Message):
@@ -1108,6 +1117,67 @@ class Type(proto.Enum):
11081117
)
11091118

11101119

1120+
class SoleTenantConfig(proto.Message):
1121+
r"""SoleTenantConfig contains the NodeAffinities to specify what
1122+
shared sole tenant node groups should back the node pool.
1123+
1124+
Attributes:
1125+
node_affinities (MutableSequence[google.cloud.container_v1.types.SoleTenantConfig.NodeAffinity]):
1126+
NodeAffinities used to match to a shared sole
1127+
tenant node group.
1128+
"""
1129+
1130+
class NodeAffinity(proto.Message):
1131+
r"""Specifies the NodeAffinity key, values, and affinity operator
1132+
according to `shared sole tenant node group
1133+
affinities <https://cloud.google.com/compute/docs/nodes/sole-tenant-nodes#node_affinity_and_anti-affinity>`__.
1134+
1135+
Attributes:
1136+
key (str):
1137+
Key for NodeAffinity.
1138+
operator (google.cloud.container_v1.types.SoleTenantConfig.NodeAffinity.Operator):
1139+
Operator for NodeAffinity.
1140+
values (MutableSequence[str]):
1141+
Values for NodeAffinity.
1142+
"""
1143+
1144+
class Operator(proto.Enum):
1145+
r"""Operator allows user to specify affinity or anti-affinity for
1146+
the given key values.
1147+
1148+
Values:
1149+
OPERATOR_UNSPECIFIED (0):
1150+
Invalid or unspecified affinity operator.
1151+
IN (1):
1152+
Affinity operator.
1153+
NOT_IN (2):
1154+
Anti-affinity operator.
1155+
"""
1156+
OPERATOR_UNSPECIFIED = 0
1157+
IN = 1
1158+
NOT_IN = 2
1159+
1160+
key: str = proto.Field(
1161+
proto.STRING,
1162+
number=1,
1163+
)
1164+
operator: "SoleTenantConfig.NodeAffinity.Operator" = proto.Field(
1165+
proto.ENUM,
1166+
number=2,
1167+
enum="SoleTenantConfig.NodeAffinity.Operator",
1168+
)
1169+
values: MutableSequence[str] = proto.RepeatedField(
1170+
proto.STRING,
1171+
number=3,
1172+
)
1173+
1174+
node_affinities: MutableSequence[NodeAffinity] = proto.RepeatedField(
1175+
proto.MESSAGE,
1176+
number=1,
1177+
message=NodeAffinity,
1178+
)
1179+
1180+
11111181
class NodeTaint(proto.Message):
11121182
r"""Kubernetes taint is composed of three fields: key, value, and
11131183
effect. Effect can only be one of three types: NoSchedule,
@@ -2287,7 +2357,15 @@ class Cluster(proto.Message):
22872357
shielded_nodes (google.cloud.container_v1.types.ShieldedNodes):
22882358
Shielded Nodes configuration.
22892359
release_channel (google.cloud.container_v1.types.ReleaseChannel):
2290-
Release channel configuration.
2360+
Release channel configuration. If left
2361+
unspecified on cluster creation and a version is
2362+
specified, the cluster is enrolled in the most
2363+
mature release channel where the version is
2364+
available (first checking STABLE, then REGULAR,
2365+
and finally RAPID). Otherwise, if no release
2366+
channel configuration and no version is
2367+
specified, the cluster is enrolled in the
2368+
REGULAR channel with its default version.
22912369
workload_identity_config (google.cloud.container_v1.types.WorkloadIdentityConfig):
22922370
Configuration for the use of Kubernetes
22932371
Service Accounts in GCP IAM policies.
@@ -2992,6 +3070,9 @@ class ClusterUpdate(proto.Message):
29923070
desired_node_pool_logging_config (google.cloud.container_v1.types.NodePoolLoggingConfig):
29933071
The desired node pool logging configuration
29943072
defaults for the cluster.
3073+
desired_fleet (google.cloud.container_v1.types.Fleet):
3074+
The desired fleet configuration for the
3075+
cluster.
29953076
desired_stack_type (google.cloud.container_v1.types.StackType):
29963077
The desired stack type of the cluster.
29973078
If a stack type is provided and does not match
@@ -3198,6 +3279,11 @@ class ClusterUpdate(proto.Message):
31983279
number=116,
31993280
message="NodePoolLoggingConfig",
32003281
)
3282+
desired_fleet: "Fleet" = proto.Field(
3283+
proto.MESSAGE,
3284+
number=117,
3285+
message="Fleet",
3286+
)
32013287
desired_stack_type: "StackType" = proto.Field(
32023288
proto.ENUM,
32033289
number=119,
@@ -3255,10 +3341,24 @@ class Operation(proto.Message):
32553341
textual description of the error. Deprecated.
32563342
Use the field error instead.
32573343
self_link (str):
3258-
Server-defined URL for the resource.
3344+
Server-defined URI for the operation. Example:
3345+
``https://container.googleapis.com/v1alpha1/projects/123/locations/us-central1/operations/operation-123``.
32593346
target_link (str):
3260-
Server-defined URL for the target of the
3261-
operation.
3347+
Server-defined URI for the target of the operation. The
3348+
format of this is a URI to the resource being modified (such
3349+
as a cluster, node pool, or node). For node pool repairs,
3350+
there may be multiple nodes being repaired, but only one
3351+
will be the target.
3352+
3353+
Examples:
3354+
3355+
-
3356+
3357+
``https://container.googleapis.com/v1/projects/123/locations/us-central1/clusters/my-cluster``
3358+
3359+
``https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np``
3360+
3361+
``https://container.googleapis.com/v1/projects/123/zones/us-central1-c/clusters/my-cluster/nodePools/my-np/node/my-node``
32623362
location (str):
32633363
[Output only] The name of the Google Compute Engine
32643364
`zone <https://cloud.google.com/compute/docs/regions-zones/regions-zones#available>`__
@@ -3310,43 +3410,120 @@ class Status(proto.Enum):
33103410
ABORTING = 4
33113411

33123412
class Type(proto.Enum):
3313-
r"""Operation type.
3413+
r"""Operation type categorizes the operation.
33143414
33153415
Values:
33163416
TYPE_UNSPECIFIED (0):
33173417
Not set.
33183418
CREATE_CLUSTER (1):
3319-
Cluster create.
3419+
The cluster is being created. The cluster should be assumed
3420+
to be unusable until the operation finishes.
3421+
3422+
In the event of the operation failing, the cluster will
3423+
enter the [ERROR state][Cluster.Status.ERROR] and eventually
3424+
be deleted.
33203425
DELETE_CLUSTER (2):
3321-
Cluster delete.
3426+
The cluster is being deleted. The cluster should be assumed
3427+
to be unusable as soon as this operation starts.
3428+
3429+
In the event of the operation failing, the cluster will
3430+
enter the [ERROR state][Cluster.Status.ERROR] and the
3431+
deletion will be automatically retried until completed.
33223432
UPGRADE_MASTER (3):
3323-
A master upgrade.
3433+
The [cluster
3434+
version][google.container.v1.ClusterUpdate.desired_master_version]
3435+
is being updated. Note that this includes "upgrades" to the
3436+
same version, which are simply a recreation. This also
3437+
includes
3438+
`auto-upgrades <https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#upgrading_automatically>`__.
3439+
For more details, see `documentation on cluster
3440+
upgrades <https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-upgrades#cluster_upgrades>`__.
33243441
UPGRADE_NODES (4):
3325-
A node upgrade.
3442+
A node pool is being updated. Despite calling this an
3443+
"upgrade", this includes most forms of updates to node
3444+
pools. This also includes
3445+
`auto-upgrades <https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-upgrades>`__.
3446+
3447+
This operation sets the
3448+
[progress][google.container.v1.Operation.progress] field and
3449+
may be
3450+
[canceled][google.container.v1.ClusterManager.CancelOperation].
3451+
3452+
The upgrade strategy depends on `node pool
3453+
configuration <https://cloud.google.com/kubernetes-engine/docs/concepts/node-pool-upgrade-strategies>`__.
3454+
The nodes are generally still usable during this operation.
33263455
REPAIR_CLUSTER (5):
3327-
Cluster repair.
3456+
A problem has been detected with the control plane and is
3457+
being repaired. This operation type is initiated by GKE. For
3458+
more details, see `documentation on
3459+
repairs <https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs>`__.
33283460
UPDATE_CLUSTER (6):
3329-
Cluster update.
3461+
The cluster is being updated. This is a broad category of
3462+
operations and includes operations that only change metadata
3463+
as well as those that must recreate the entire cluster. If
3464+
the control plane must be recreated, this will cause
3465+
temporary downtime for zonal clusters.
3466+
3467+
Some features require recreating the nodes as well. Those
3468+
will be recreated as separate operations and the update may
3469+
not be completely functional until the node pools
3470+
recreations finish. Node recreations will generally follow
3471+
`maintenance
3472+
policies <https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions>`__.
3473+
3474+
Some GKE-initiated operations use this type. This includes
3475+
certain types of auto-upgrades and incident mitigations.
33303476
CREATE_NODE_POOL (7):
3331-
Node pool create.
3477+
A node pool is being created. The node pool should be
3478+
assumed to be unusable until this operation finishes. In the
3479+
event of an error, the node pool may be partially created.
3480+
3481+
If enabled, `node
3482+
autoprovisioning <https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-provisioning>`__
3483+
may have automatically initiated such operations.
33323484
DELETE_NODE_POOL (8):
3333-
Node pool delete.
3485+
The node pool is being deleted. The node pool
3486+
should be assumed to be unusable as soon as this
3487+
operation starts.
33343488
SET_NODE_POOL_MANAGEMENT (9):
3335-
Set node pool management.
3489+
The node pool's
3490+
[manamagent][google.container.v1.NodePool.management] field
3491+
is being updated. These operations only update metadata and
3492+
may be concurrent with most other operations.
33363493
AUTO_REPAIR_NODES (10):
3337-
Automatic node pool repair.
3494+
A problem has been detected with nodes and `they are being
3495+
repaired <https://cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair>`__.
3496+
This operation type is initiated by GKE, typically
3497+
automatically. This operation may be concurrent with other
3498+
operations and there may be multiple repairs occurring on
3499+
the same node pool.
33383500
AUTO_UPGRADE_NODES (11):
3339-
Automatic node upgrade.
3501+
Unused. Automatic node upgrade uses
3502+
[UPGRADE_NODES][google.container.v1.Operation.Type.UPGRADE_NODES].
33403503
SET_LABELS (12):
3341-
Set labels.
3504+
Unused. Updating labels uses
3505+
[UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
33423506
SET_MASTER_AUTH (13):
3343-
Set/generate master auth materials
3507+
Unused. Updating master auth uses
3508+
[UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
33443509
SET_NODE_POOL_SIZE (14):
3345-
Set node pool size.
3510+
The node pool is being resized. With the
3511+
exception of resizing to or from size zero, the
3512+
node pool is generally usable during this
3513+
operation.
33463514
SET_NETWORK_POLICY (15):
3347-
Updates network policy for a cluster.
3515+
Unused. Updating network policy uses
3516+
[UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
33483517
SET_MAINTENANCE_POLICY (16):
3349-
Set the maintenance policy.
3518+
Unused. Updating maintenance policy uses
3519+
[UPDATE_CLUSTER][google.container.v1.Operation.Type.UPDATE_CLUSTER].
3520+
RESIZE_CLUSTER (18):
3521+
The control plane is being resized. This operation type is
3522+
initiated by GKE. These operations are often performed
3523+
preemptively to ensure that the control plane has sufficient
3524+
resources and is not typically an indication of issues. For
3525+
more details, see `documentation on
3526+
resizes <https://cloud.google.com/kubernetes-engine/docs/concepts/maintenance-windows-and-exclusions#repairs>`__.
33503527
"""
33513528
TYPE_UNSPECIFIED = 0
33523529
CREATE_CLUSTER = 1
@@ -3365,6 +3542,7 @@ class Type(proto.Enum):
33653542
SET_NODE_POOL_SIZE = 14
33663543
SET_NETWORK_POLICY = 15
33673544
SET_MAINTENANCE_POLICY = 16
3545+
RESIZE_CLUSTER = 18
33683546

33693547
name: str = proto.Field(
33703548
proto.STRING,
@@ -7220,12 +7398,12 @@ class DatabaseEncryption(proto.Message):
72207398
r"""Configuration of etcd encryption.
72217399
72227400
Attributes:
7223-
state (google.cloud.container_v1.types.DatabaseEncryption.State):
7224-
Denotes the state of etcd encryption.
72257401
key_name (str):
72267402
Name of CloudKMS key to use for the
72277403
encryption of secrets in etcd. Ex.
72287404
projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key
7405+
state (google.cloud.container_v1.types.DatabaseEncryption.State):
7406+
The desired state of etcd encryption.
72297407
"""
72307408

72317409
class State(proto.Enum):
@@ -7245,15 +7423,15 @@ class State(proto.Enum):
72457423
ENCRYPTED = 1
72467424
DECRYPTED = 2
72477425

7426+
key_name: str = proto.Field(
7427+
proto.STRING,
7428+
number=1,
7429+
)
72487430
state: State = proto.Field(
72497431
proto.ENUM,
72507432
number=2,
72517433
enum=State,
72527434
)
7253-
key_name: str = proto.Field(
7254-
proto.STRING,
7255-
number=1,
7256-
)
72577435

72587436

72597437
class ListUsableSubnetworksRequest(proto.Message):

0 commit comments

Comments
 (0)