Skip to content

Commit

Permalink
Merge pull request GoogleCloudPlatform#2485 from marko7460/update-con…
Browse files Browse the repository at this point in the history
…tainer-cluster-and-nodepool

Update ContainerCluster and ContainerNodePool CRDs
  • Loading branch information
google-oss-prow[bot] authored Aug 21, 2024
2 parents 7c14db8 + 35441cb commit e41e189
Show file tree
Hide file tree
Showing 16 changed files with 773 additions and 299 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1378,18 +1378,17 @@ spec:
type: string
type: array
taint:
description: Immutable. List of Kubernetes taints to be applied
to each node.
description: List of Kubernetes taints to be applied to each node.
items:
properties:
effect:
description: Immutable. Effect for taint.
description: Effect for taint.
type: string
key:
description: Immutable. Key for taint.
description: Key for taint.
type: string
value:
description: Immutable. Value for taint.
description: Value for taint.
type: string
required:
- effect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,18 +706,17 @@ spec:
type: string
type: array
taint:
description: Immutable. List of Kubernetes taints to be applied
to each node.
description: List of Kubernetes taints to be applied to each node.
items:
properties:
effect:
description: Immutable. Effect for taint.
description: Effect for taint.
type: string
key:
description: Immutable. Key for taint.
description: Key for taint.
type: string
value:
description: Immutable. Value for taint.
description: Value for taint.
type: string
required:
- effect
Expand Down
5 changes: 5 additions & 0 deletions mockgcp/mockcontainer/nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ func (s *ClusterManagerV1) UpdateNodePool(ctx context.Context, req *pb.UpdateNod
update := proto.Clone(req).(*pb.UpdateNodePoolRequest)
update.Name = ""

if update.Taints != nil {
obj.Config.Taints = update.GetTaints().Taints
update.Taints = nil
}

// TODO: Support more updates!

if !proto.Equal(update, &pb.UpdateNodePoolRequest{}) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ spec:
external: default
shieldedInstanceConfig:
enableIntegrityMonitoring: true
taint:
- effect: NO_SCHEDULE
key: newKey
value: newValue
nodeCount: 0
resourceID: nodepool-sample-${uniqueId}
upgradeSettings:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,17 @@ User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terr
"totalMinNodeCount": 0
},
"config": {
"oauthScopes": [
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/servicecontrol",
"https://www.googleapis.com/auth/trace.append"
"loggingConfig": {
"variantConfig": {
"variant": "DEFAULT"
}
},
"taints": [
{
"effect": "NO_SCHEDULE",
"key": "originalKey",
"value": "originalValue"
}
]
},
"name": "nodepool-sample-${uniqueId}",
Expand Down Expand Up @@ -429,6 +433,11 @@ X-Xss-Protection: 0
"diskSizeGb": 100,
"diskType": "pd-balanced",
"imageType": "COS_CONTAINERD",
"loggingConfig": {
"variantConfig": {
"variant": "DEFAULT"
}
},
"machineType": "e2-standard-4",
"metadata": {
"disable-legacy-endpoints": "true"
Expand All @@ -445,6 +454,13 @@ X-Xss-Protection: 0
"shieldedInstanceConfig": {
"enableIntegrityMonitoring": true
},
"taints": [
{
"effect": "NO_SCHEDULE",
"key": "originalKey",
"value": "originalValue"
}
],
"windowsNodeConfig": {}
},
"initialNodeCount": 1,
Expand Down Expand Up @@ -534,6 +550,69 @@ X-Xss-Protection: 0

---

PUT https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/cluster-sample-${uniqueId}/nodePools/nodepool-sample-${uniqueId}?alt=json&prettyPrint=false
Content-Type: application/json
User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager

{
"name": "nodepool-sample-${uniqueId}",
"taints": {
"taints": [
{
"effect": "NO_SCHEDULE",
"key": "newKey",
"value": "newValue"
}
]
}
}

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
"name": "${operationID}",
"selfLink": "https://container.googleapis.com/v1beta1/projects/${projectNumber}/locations/us-central1-a/operations/${operationID}",
"startTime": "2024-04-01T12:34:56.123456Z",
"status": "RUNNING",
"zone": "us-central1-a"
}

---

GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/operations/${operationID}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager

200 OK
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
"endTime": "2024-04-01T12:34:56.123456Z",
"name": "${operationID}",
"selfLink": "https://container.googleapis.com/v1beta1/projects/${projectNumber}/locations/us-central1-a/operations/${operationID}",
"startTime": "2024-04-01T12:34:56.123456Z",
"status": "DONE",
"zone": "us-central1-a"
}

---

GET https://container.googleapis.com/v1beta1/projects/${projectId}/locations/us-central1-a/clusters/cluster-sample-${uniqueId}?alt=json&prettyPrint=false
User-Agent: google-api-go-client/0.5 Terraform/ (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google-beta/kcc/controller-manager

Expand Down Expand Up @@ -720,6 +799,11 @@ X-Xss-Protection: 0
"diskSizeGb": 100,
"diskType": "pd-balanced",
"imageType": "COS_CONTAINERD",
"loggingConfig": {
"variantConfig": {
"variant": "DEFAULT"
}
},
"machineType": "e2-standard-4",
"metadata": {
"disable-legacy-endpoints": "true"
Expand All @@ -736,6 +820,13 @@ X-Xss-Protection: 0
"shieldedInstanceConfig": {
"enableIntegrityMonitoring": true
},
"taints": [
{
"effect": "NO_SCHEDULE",
"key": "newKey",
"value": "newValue"
}
],
"windowsNodeConfig": {}
},
"initialNodeCount": 1,
Expand Down
Loading

0 comments on commit e41e189

Please sign in to comment.