You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// enableMultiProject is bound to a command-line flag. When true, it enables the
51
-
// projectFromNodeProviderID option of the GCE cloud provider, instructing it to
52
-
// use the project specified in the Node's providerID for GCE API calls.
53
-
//
54
-
// This flag should only be enabled when the Node's providerID can be fully
55
-
// trusted.
56
-
//
57
53
// Flag binding occurs in main()
58
54
varenableMultiProjectbool
59
55
@@ -72,6 +68,9 @@ var enableRBSDefaultForL4NetLB bool
72
68
// for L4 Load Balancers services
73
69
varenableL4LBAnnotationsbool
74
70
71
+
// enableProviderConfigController enables the gke-tenant-controller-manager.
72
+
varenableProviderConfigControllerbool
73
+
75
74
funcmain() {
76
75
rand.Seed(time.Now().UnixNano())
77
76
@@ -91,6 +90,7 @@ func main() {
91
90
cloudProviderFS.BoolVar(&enableDiscretePortForwarding, "enable-discrete-port-forwarding", false, "Enables forwarding of individual ports instead of port ranges for GCE external load balancers.")
92
91
cloudProviderFS.BoolVar(&enableRBSDefaultForL4NetLB, "enable-rbs-default-l4-netlb", false, "Enables RBS defaulting for GCE L4 NetLB")
93
92
cloudProviderFS.BoolVar(&enableL4LBAnnotations, "enable-l4-lb-annotations", false, "Enables Annotations for GCE L4 LB Services")
93
+
cloudProviderFS.BoolVar(&enableProviderConfigController, "enable-provider-config-controller", false, "Enables the GKE Tenant Controller Manager for Multi-Tenancy.")
// Fail-fast: If enableMultiProject is set, the cloud provider MUST
154
-
// be GCE. A non-GCE provider indicates a misconfiguration. Ideally,
155
-
// we never expect this to be executed.
156
-
klog.Fatalf("multi-project mode requires GCE cloud provider, but got %T", cloud)
167
+
klog.Fatalf("One or more GCE-specific flags (enable-multi-project, enable-discrete-port-forwarding, enable-rbs-default-l4-netlb, enable-l4-lb-annotations) were set, but cloud provider is %T, not GCE.", cloud)
157
168
}
158
-
gceCloud.SetProjectFromNodeProviderID(true)
159
-
}
160
169
161
-
ifenableDiscretePortForwarding {
162
-
gceCloud, ok:= (cloud).(*gce.Cloud)
163
-
if!ok {
164
-
// Fail-fast: If enableDiscretePortForwarding is set, the cloud
165
-
// provider MUST be GCE.
166
-
klog.Fatalf("enable-discrete-port-forwarding requires GCE cloud provider, but got %T", cloud)
0 commit comments