Skip to content

Commit d630f9c

Browse files
committed
add missing rbac roles and don't run gkenetparamset controller
1 parent 52a47b0 commit d630f9c

File tree

29 files changed

+138
-38
lines changed

29 files changed

+138
-38
lines changed

pkg/model/components/gcpcloudcontrollermanager.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,14 @@ func (b *GCPCloudControllerManagerOptionsBuilder) BuildOptions(options interface
6161
}
6262

6363
if ccmConfig.Controllers == nil {
64-
var changes []string
65-
66-
// Don't run gkenetworkparamset controller, looks for some CRDs (GKENetworkParamSet and Network) which are only installed on GKE
67-
// However, the version we're current running doesn't support this controller anyway, so we need to introduce this later,
68-
// possibly based on the image version.
69-
// changes = append(ccmConfig.Controllers, "-gkenetworkparams")
64+
changes := []string{"*,-gkenetworkparamset"}
7065

7166
// Turn off some controllers if kops-controller is running them
7267
if clusterSpec.IsKopsControllerIPAM() {
73-
changes = append(ccmConfig.Controllers, "-nodeipam", "-route")
68+
changes = append(changes, "-nodeipam", "-route")
7469
}
7570

76-
if len(changes) != 0 {
77-
ccmConfig.Controllers = append([]string{"*"}, changes...)
78-
}
71+
ccmConfig.Controllers = changes
7972
}
8073

8174
if ccmConfig.Image == "" {

tests/integration/update_cluster/ha_gce/data/aws_s3_object_cluster-completed.spec_content

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ spec:
2020
cidrAllocatorType: CloudAllocator
2121
clusterCIDR: 100.96.0.0/11
2222
clusterName: ha-gce-example-com
23+
controllers:
24+
- '*,-gkenetworkparamset'
2325
image: registry.k8s.io/cloud-provider-gcp/cloud-controller-manager:v26.2.4
2426
leaderElection:
2527
leaderElect: true

tests/integration/update_cluster/ha_gce/data/aws_s3_object_ha-gce.example.com-addons-bootstrap_content

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ spec:
6262
version: 9.99.0
6363
- id: k8s-1.23
6464
manifest: gcp-cloud-controller.addons.k8s.io/k8s-1.23.yaml
65-
manifestHash: b9fd0b9dde71d34a4c73ebbff89ecfefd6286232846afcdd1a2d09491900d886
65+
manifestHash: dacbfa4c544a4b20b9354355f260c0513352d99830e549dcf78962e089d3bcd8
6666
name: gcp-cloud-controller.addons.k8s.io
6767
prune:
6868
kinds:

tests/integration/update_cluster/ha_gce/data/aws_s3_object_ha-gce.example.com-addons-gcp-cloud-controller.addons.k8s.io-k8s-1.23_content

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
- --cidr-allocator-type=CloudAllocator
3838
- --cluster-cidr=100.96.0.0/11
3939
- --cluster-name=ha-gce-example-com
40+
- --controllers=*,-gkenetworkparamset
4041
- --leader-elect=true
4142
- --v=2
4243
- --cloud-provider=gce
@@ -147,6 +148,13 @@ rules:
147148
- create
148149
- patch
149150
- update
151+
- apiGroups:
152+
- ""
153+
resources:
154+
- services/status
155+
verbs:
156+
- patch
157+
- update
150158
- apiGroups:
151159
- coordination.k8s.io
152160
resources:
@@ -252,6 +260,8 @@ rules:
252260
resources:
253261
- configmaps
254262
verbs:
263+
- create
264+
- patch
255265
- get
256266
- update
257267

@@ -350,8 +360,7 @@ roleRef:
350360
kind: ClusterRole
351361
name: system:cloud-controller-manager
352362
subjects:
353-
- apiGroup: ""
354-
kind: ServiceAccount
363+
- kind: ServiceAccount
355364
name: cloud-controller-manager
356365
namespace: kube-system
357366

tests/integration/update_cluster/many-addons-gce/data/aws_s3_object_cluster-completed.spec_content

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ spec:
2222
cidrAllocatorType: CloudAllocator
2323
clusterCIDR: 100.96.0.0/11
2424
clusterName: minimal-example-com
25+
controllers:
26+
- '*,-gkenetworkparamset'
2527
image: registry.k8s.io/cloud-provider-gcp/cloud-controller-manager:v26.2.4
2628
leaderElection:
2729
leaderElect: true

tests/integration/update_cluster/many-addons-gce/data/aws_s3_object_minimal.example.com-addons-bootstrap_content

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ spec:
133133
version: 9.99.0
134134
- id: k8s-1.23
135135
manifest: gcp-cloud-controller.addons.k8s.io/k8s-1.23.yaml
136-
manifestHash: e40e89303c4872972482abd7a438cec5b374ea8afb3e69d2230c7835b59c2d33
136+
manifestHash: 9e80ca766c56a45af5a93a49a067740cf9d35716b95d300ac6f4aa08384f3544
137137
name: gcp-cloud-controller.addons.k8s.io
138138
prune:
139139
kinds:

tests/integration/update_cluster/many-addons-gce/data/aws_s3_object_minimal.example.com-addons-gcp-cloud-controller.addons.k8s.io-k8s-1.23_content

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
- --cidr-allocator-type=CloudAllocator
3838
- --cluster-cidr=100.96.0.0/11
3939
- --cluster-name=minimal-example-com
40+
- --controllers=*,-gkenetworkparamset
4041
- --leader-elect=true
4142
- --v=2
4243
- --cloud-provider=gce
@@ -147,6 +148,13 @@ rules:
147148
- create
148149
- patch
149150
- update
151+
- apiGroups:
152+
- ""
153+
resources:
154+
- services/status
155+
verbs:
156+
- patch
157+
- update
150158
- apiGroups:
151159
- coordination.k8s.io
152160
resources:
@@ -252,6 +260,8 @@ rules:
252260
resources:
253261
- configmaps
254262
verbs:
263+
- create
264+
- patch
255265
- get
256266
- update
257267

@@ -350,8 +360,7 @@ roleRef:
350360
kind: ClusterRole
351361
name: system:cloud-controller-manager
352362
subjects:
353-
- apiGroup: ""
354-
kind: ServiceAccount
363+
- kind: ServiceAccount
355364
name: cloud-controller-manager
356365
namespace: kube-system
357366

tests/integration/update_cluster/minimal_gce/data/aws_s3_object_cluster-completed.spec_content

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ spec:
2020
cidrAllocatorType: CloudAllocator
2121
clusterCIDR: 100.96.0.0/11
2222
clusterName: minimal-gce-example-com
23+
controllers:
24+
- '*,-gkenetworkparamset'
2325
image: registry.k8s.io/cloud-provider-gcp/cloud-controller-manager:v26.2.4
2426
leaderElection:
2527
leaderElect: true

tests/integration/update_cluster/minimal_gce/data/aws_s3_object_minimal-gce.example.com-addons-bootstrap_content

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ spec:
6262
version: 9.99.0
6363
- id: k8s-1.23
6464
manifest: gcp-cloud-controller.addons.k8s.io/k8s-1.23.yaml
65-
manifestHash: 447139a03ae68fa785c155f0ec4bb0bc38cdb657fda9687039013d3e2353ab6d
65+
manifestHash: f6318f9f355302147958c18f744391cb59d0642d3002451b7ca84d1e1210f49a
6666
name: gcp-cloud-controller.addons.k8s.io
6767
prune:
6868
kinds:

tests/integration/update_cluster/minimal_gce/data/aws_s3_object_minimal-gce.example.com-addons-gcp-cloud-controller.addons.k8s.io-k8s-1.23_content

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
- --cidr-allocator-type=CloudAllocator
3838
- --cluster-cidr=100.96.0.0/11
3939
- --cluster-name=minimal-gce-example-com
40+
- --controllers=*,-gkenetworkparamset
4041
- --leader-elect=true
4142
- --v=2
4243
- --cloud-provider=gce
@@ -147,6 +148,13 @@ rules:
147148
- create
148149
- patch
149150
- update
151+
- apiGroups:
152+
- ""
153+
resources:
154+
- services/status
155+
verbs:
156+
- patch
157+
- update
150158
- apiGroups:
151159
- coordination.k8s.io
152160
resources:
@@ -252,6 +260,8 @@ rules:
252260
resources:
253261
- configmaps
254262
verbs:
263+
- create
264+
- patch
255265
- get
256266
- update
257267

@@ -350,8 +360,7 @@ roleRef:
350360
kind: ClusterRole
351361
name: system:cloud-controller-manager
352362
subjects:
353-
- apiGroup: ""
354-
kind: ServiceAccount
363+
- kind: ServiceAccount
355364
name: cloud-controller-manager
356365
namespace: kube-system
357366

tests/integration/update_cluster/minimal_gce_dns-none/data/aws_s3_object_cluster-completed.spec_content

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ spec:
2424
cidrAllocatorType: CloudAllocator
2525
clusterCIDR: 100.96.0.0/11
2626
clusterName: minimal-gce-example-com
27+
controllers:
28+
- '*,-gkenetworkparamset'
2729
image: registry.k8s.io/cloud-provider-gcp/cloud-controller-manager:v26.2.4
2830
leaderElection:
2931
leaderElect: true

tests/integration/update_cluster/minimal_gce_dns-none/data/aws_s3_object_minimal-gce.example.com-addons-bootstrap_content

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ spec:
5555
version: 9.99.0
5656
- id: k8s-1.23
5757
manifest: gcp-cloud-controller.addons.k8s.io/k8s-1.23.yaml
58-
manifestHash: 447139a03ae68fa785c155f0ec4bb0bc38cdb657fda9687039013d3e2353ab6d
58+
manifestHash: f6318f9f355302147958c18f744391cb59d0642d3002451b7ca84d1e1210f49a
5959
name: gcp-cloud-controller.addons.k8s.io
6060
prune:
6161
kinds:

tests/integration/update_cluster/minimal_gce_dns-none/data/aws_s3_object_minimal-gce.example.com-addons-gcp-cloud-controller.addons.k8s.io-k8s-1.23_content

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
- --cidr-allocator-type=CloudAllocator
3838
- --cluster-cidr=100.96.0.0/11
3939
- --cluster-name=minimal-gce-example-com
40+
- --controllers=*,-gkenetworkparamset
4041
- --leader-elect=true
4142
- --v=2
4243
- --cloud-provider=gce
@@ -147,6 +148,13 @@ rules:
147148
- create
148149
- patch
149150
- update
151+
- apiGroups:
152+
- ""
153+
resources:
154+
- services/status
155+
verbs:
156+
- patch
157+
- update
150158
- apiGroups:
151159
- coordination.k8s.io
152160
resources:
@@ -252,6 +260,8 @@ rules:
252260
resources:
253261
- configmaps
254262
verbs:
263+
- create
264+
- patch
255265
- get
256266
- update
257267

@@ -350,8 +360,7 @@ roleRef:
350360
kind: ClusterRole
351361
name: system:cloud-controller-manager
352362
subjects:
353-
- apiGroup: ""
354-
kind: ServiceAccount
363+
- kind: ServiceAccount
355364
name: cloud-controller-manager
356365
namespace: kube-system
357366

tests/integration/update_cluster/minimal_gce_ilb/data/aws_s3_object_cluster-completed.spec_content

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ spec:
2424
cidrAllocatorType: CloudAllocator
2525
clusterCIDR: 100.96.0.0/11
2626
clusterName: minimal-gce-ilb-example-com
27+
controllers:
28+
- '*,-gkenetworkparamset'
2729
image: registry.k8s.io/cloud-provider-gcp/cloud-controller-manager:v26.2.4
2830
leaderElection:
2931
leaderElect: true

tests/integration/update_cluster/minimal_gce_ilb/data/aws_s3_object_minimal-gce-ilb.example.com-addons-bootstrap_content

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ spec:
6262
version: 9.99.0
6363
- id: k8s-1.23
6464
manifest: gcp-cloud-controller.addons.k8s.io/k8s-1.23.yaml
65-
manifestHash: f3c98b2b2ad3b91f4b82a97af7d8d58411166ac29e8a04cb04905a81ffb16ad9
65+
manifestHash: e28ca21950fe4c0bdd94348e91a89594c68be7e95059dbdfb0a043e33abeb0fc
6666
name: gcp-cloud-controller.addons.k8s.io
6767
prune:
6868
kinds:

tests/integration/update_cluster/minimal_gce_ilb/data/aws_s3_object_minimal-gce-ilb.example.com-addons-gcp-cloud-controller.addons.k8s.io-k8s-1.23_content

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
- --cidr-allocator-type=CloudAllocator
3838
- --cluster-cidr=100.96.0.0/11
3939
- --cluster-name=minimal-gce-ilb-example-com
40+
- --controllers=*,-gkenetworkparamset
4041
- --leader-elect=true
4142
- --v=2
4243
- --cloud-provider=gce
@@ -147,6 +148,13 @@ rules:
147148
- create
148149
- patch
149150
- update
151+
- apiGroups:
152+
- ""
153+
resources:
154+
- services/status
155+
verbs:
156+
- patch
157+
- update
150158
- apiGroups:
151159
- coordination.k8s.io
152160
resources:
@@ -252,6 +260,8 @@ rules:
252260
resources:
253261
- configmaps
254262
verbs:
263+
- create
264+
- patch
255265
- get
256266
- update
257267

@@ -350,8 +360,7 @@ roleRef:
350360
kind: ClusterRole
351361
name: system:cloud-controller-manager
352362
subjects:
353-
- apiGroup: ""
354-
kind: ServiceAccount
363+
- kind: ServiceAccount
355364
name: cloud-controller-manager
356365
namespace: kube-system
357366

tests/integration/update_cluster/minimal_gce_ilb_longclustername/data/aws_s3_object_cluster-completed.spec_content

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ spec:
2424
cidrAllocatorType: CloudAllocator
2525
clusterCIDR: 100.96.0.0/11
2626
clusterName: minimal-gce-with-a-very-very-very-very-very-long-name-example-com
27+
controllers:
28+
- '*,-gkenetworkparamset'
2729
image: registry.k8s.io/cloud-provider-gcp/cloud-controller-manager:v26.2.4
2830
leaderElection:
2931
leaderElect: true

tests/integration/update_cluster/minimal_gce_ilb_longclustername/data/aws_s3_object_minimal-gce-with-a-very-very-very-very-very-long-name.example.com-addons-bootstrap_content

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ spec:
6262
version: 9.99.0
6363
- id: k8s-1.23
6464
manifest: gcp-cloud-controller.addons.k8s.io/k8s-1.23.yaml
65-
manifestHash: 04674610fafbf0bf7a284d39cd3bb8c5fc5e3ff1707c218cb235d60debaf536b
65+
manifestHash: 854e64edebc744f2d8e7ee5dff7342e3a7f5ba3dd385a2446a4c6e10fe9c23f3
6666
name: gcp-cloud-controller.addons.k8s.io
6767
prune:
6868
kinds:

tests/integration/update_cluster/minimal_gce_ilb_longclustername/data/aws_s3_object_minimal-gce-with-a-very-very-very-very-very-long-name.example.com-addons-gcp-cloud-controller.addons.k8s.io-k8s-1.23_content

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
- --cidr-allocator-type=CloudAllocator
3838
- --cluster-cidr=100.96.0.0/11
3939
- --cluster-name=minimal-gce-with-a-very-very-very-very-very-long-name-example-com
40+
- --controllers=*,-gkenetworkparamset
4041
- --leader-elect=true
4142
- --v=2
4243
- --cloud-provider=gce
@@ -147,6 +148,13 @@ rules:
147148
- create
148149
- patch
149150
- update
151+
- apiGroups:
152+
- ""
153+
resources:
154+
- services/status
155+
verbs:
156+
- patch
157+
- update
150158
- apiGroups:
151159
- coordination.k8s.io
152160
resources:
@@ -252,6 +260,8 @@ rules:
252260
resources:
253261
- configmaps
254262
verbs:
263+
- create
264+
- patch
255265
- get
256266
- update
257267

@@ -350,8 +360,7 @@ roleRef:
350360
kind: ClusterRole
351361
name: system:cloud-controller-manager
352362
subjects:
353-
- apiGroup: ""
354-
kind: ServiceAccount
363+
- kind: ServiceAccount
355364
name: cloud-controller-manager
356365
namespace: kube-system
357366

tests/integration/update_cluster/minimal_gce_longclustername/data/aws_s3_object_cluster-completed.spec_content

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ spec:
2020
cidrAllocatorType: CloudAllocator
2121
clusterCIDR: 100.96.0.0/11
2222
clusterName: minimal-gce-with-a-very-very-very-very-very-long-name-example-com
23+
controllers:
24+
- '*,-gkenetworkparamset'
2325
image: registry.k8s.io/cloud-provider-gcp/cloud-controller-manager:v26.2.4
2426
leaderElection:
2527
leaderElect: true

tests/integration/update_cluster/minimal_gce_longclustername/data/aws_s3_object_minimal-gce-with-a-very-very-very-very-very-long-name.example.com-addons-bootstrap_content

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ spec:
6262
version: 9.99.0
6363
- id: k8s-1.23
6464
manifest: gcp-cloud-controller.addons.k8s.io/k8s-1.23.yaml
65-
manifestHash: 04674610fafbf0bf7a284d39cd3bb8c5fc5e3ff1707c218cb235d60debaf536b
65+
manifestHash: 854e64edebc744f2d8e7ee5dff7342e3a7f5ba3dd385a2446a4c6e10fe9c23f3
6666
name: gcp-cloud-controller.addons.k8s.io
6767
prune:
6868
kinds:

0 commit comments

Comments
 (0)