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
Copy file name to clipboardExpand all lines: cmd/gcp-controller-manager/main.go
+71-58Lines changed: 71 additions & 58 deletions
Original file line number
Diff line number
Diff line change
@@ -62,24 +62,26 @@ const (
62
62
)
63
63
64
64
var (
65
-
port=pflag.Int("port", 8089, "Port to serve status endpoints on (such as /healthz and /metrics).")
66
-
metricsPort=pflag.Int("metrics-port", 8089, "Deprecated. Port to expose Prometheus metrics on. If not set, uses the value of --port.")
67
-
kubeconfig=pflag.String("kubeconfig", "", "Path to kubeconfig file with authorization and master location information.")
68
-
clusterSigningGKEKubeconfig=pflag.String("cluster-signing-gke-kubeconfig", "", "If set, use the kubeconfig file to call GKE to sign cluster-scoped certificates instead of using a local private key.")
69
-
gceConfigPath=pflag.String("gce-config", "/etc/gce.conf", "Path to gce.conf.")
70
-
controllers=pflag.StringSlice("controllers", []string{"*"}, "Controllers to enable. Possible controllers are: "+strings.Join(loopNames(), ",")+".")
71
-
csrApproverVerifyClusterMembership=pflag.Bool("csr-validate-cluster-membership", true, "Validate that VMs requesting CSRs belong to current GKE cluster.")
csrApproverUseGCEInstanceListReferrers=pflag.Bool("csr-use-gce-instance-list-referrers", false, "If true use https://cloud.google.com/compute/docs/reference/rest/v1/instances/listReferrers to validate instance cluster membership.")
74
-
gceAPIEndpointOverride=pflag.String("gce-api-endpoint-override", "", "If set, talks to a different GCE API Endpoint. By default it talks to https://www.googleapis.com/compute/v1/projects/")
75
-
directPath=pflag.Bool("direct-path", false, "Enable Direct Path.")
76
-
authAuthorizeServiceAccountMappingURL=pflag.String("auth-authorize-service-account-mapping-url", "", "URL for reaching the Auth Service AuthorizeServiceAccountMapping API.")
77
-
authSyncNodeURL=pflag.String("auth-sync-node-url", "", "URL for reaching the Auth Service SyncNode API.")
78
-
hmsAuthorizeSAMappingURL=pflag.String("hms-authorize-sa-mapping-url", "", "URL for reaching the Hosted Master Service AuthorizeSAMapping API.")
79
-
hmsSyncNodeURL=pflag.String("hms-sync-node-url", "", "URL for reaching the Hosted Master Service SyncNode API.")
80
-
kubeletReadOnlyCSRApprover=pflag.Bool("kubelet-read-only-csr-approver", false, "Enable kubelet readonly csr approver or not")
81
-
autopilotEnabled=pflag.Bool("autopilot", false, "Is this a GKE Autopilot cluster.")
82
-
clearStalePodsOnNodeRegistration=pflag.Bool("clearStalePodsOnNodeRegistration", false, "If true, after node registration, delete pods bound to old node.")
65
+
port=pflag.Int("port", 8089, "Port to serve status endpoints on (such as /healthz and /metrics).")
66
+
metricsPort=pflag.Int("metrics-port", 8089, "Deprecated. Port to expose Prometheus metrics on. If not set, uses the value of --port.")
67
+
kubeconfig=pflag.String("kubeconfig", "", "Path to kubeconfig file with authorization and master location information.")
68
+
clusterSigningGKEKubeconfig=pflag.String("cluster-signing-gke-kubeconfig", "", "If set, use the kubeconfig file to call GKE to sign cluster-scoped certificates instead of using a local private key.")
69
+
gceConfigPath=pflag.String("gce-config", "/etc/gce.conf", "Path to gce.conf.")
70
+
controllers=pflag.StringSlice("controllers", []string{"*"}, "Controllers to enable. Possible controllers are: "+strings.Join(loopNames(), ",")+".")
71
+
csrApproverVerifyClusterMembership=pflag.Bool("csr-validate-cluster-membership", true, "Validate that VMs requesting CSRs belong to current GKE cluster.")
csrApproverUseGCEInstanceListReferrers=pflag.Bool("csr-use-gce-instance-list-referrers", false, "If true use https://cloud.google.com/compute/docs/reference/rest/v1/instances/listReferrers to validate instance cluster membership.")
74
+
csrApproverListReferrersInitialInterval=pflag.Duration("csr-gce-list-referrers-initial-interval", 5*time.Second, "Initial interval of the exponential back-off retries for calls to listReferrers, exponential factor is set to 1.5, defaults to 5s.")
75
+
csrApproverListReferrersRetryCount=pflag.Int("csr-gce-list-referrers-retry-count", 10, "Maximal number of retries in exponential back-off for calls to listReferrers, defaults to 10")
76
+
gceAPIEndpointOverride=pflag.String("gce-api-endpoint-override", "", "If set, talks to a different GCE API Endpoint. By default it talks to https://www.googleapis.com/compute/v1/projects/")
77
+
directPath=pflag.Bool("direct-path", false, "Enable Direct Path.")
78
+
authAuthorizeServiceAccountMappingURL=pflag.String("auth-authorize-service-account-mapping-url", "", "URL for reaching the Auth Service AuthorizeServiceAccountMapping API.")
79
+
authSyncNodeURL=pflag.String("auth-sync-node-url", "", "URL for reaching the Auth Service SyncNode API.")
80
+
hmsAuthorizeSAMappingURL=pflag.String("hms-authorize-sa-mapping-url", "", "URL for reaching the Hosted Master Service AuthorizeSAMapping API.")
81
+
hmsSyncNodeURL=pflag.String("hms-sync-node-url", "", "URL for reaching the Hosted Master Service SyncNode API.")
82
+
kubeletReadOnlyCSRApprover=pflag.Bool("kubelet-read-only-csr-approver", false, "Enable kubelet readonly csr approver or not")
83
+
autopilotEnabled=pflag.Bool("autopilot", false, "Is this a GKE Autopilot cluster.")
84
+
clearStalePodsOnNodeRegistration=pflag.Bool("clearStalePodsOnNodeRegistration", false, "If true, after node registration, delete pods bound to old node.")
klog.V(2).Infof("Determined cluster membership of instance %q using compute.InstancesService.ListReferrers after %v", instance.Name, time.Since(startTime))
731
+
} else {
732
+
klog.Warningf("Could not determine cluster membership of instance %q using compute.InstancesService.ListReferrers after %v; falling back to checking all instance groups", instance.Name, time.Since(startTime))
klog.Warningf("could not determine cluster membership of instance %q using compute.InstancesService.ListReferrers; falling back to checking all instance groups", instance.Name)
0 commit comments