mirror of https://github.com/kubernetes/kops.git
Merge pull request #2225 from justinsb/use_kcm_serviceaccounts
Set --use-service-account-credentials for 1.6
This commit is contained in:
commit
f63c52c425
|
|
@ -112,8 +112,6 @@ func (b *KubeControllerManagerBuilder) buildPod() (*v1.Pod, error) {
|
|||
// Add kubeconfig flag
|
||||
flags += " --kubeconfig=" + "/var/lib/kube-controller-manager/kubeconfig"
|
||||
|
||||
// TODO: Set --use-service-account-credentials=true - unclear if we can/should set this without RBAC
|
||||
|
||||
redirectCommand := []string{
|
||||
"/bin/sh", "-c", "/usr/local/bin/kube-controller-manager " + flags + " 1>>/var/log/kube-controller-manager.log 2>&1",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -613,6 +613,9 @@ type KubeControllerManagerConfig struct {
|
|||
// before the terminated pod garbage collector starts deleting terminated pods.
|
||||
// If <= 0, the terminated pod garbage collector is disabled.
|
||||
TerminatedPodGCThreshold *int32 `json:"terminatedPodGCThreshold,omitempty" flag:"terminated-pod-gc-threshold"`
|
||||
|
||||
// UseServiceAccountCredentials controls whether we use individual service account credentials for each controller.
|
||||
UseServiceAccountCredentials *bool `json:"useServiceAccountCredentials,omitempty" flag:"use-service-account-credentials"`
|
||||
}
|
||||
|
||||
type KubeSchedulerConfig struct {
|
||||
|
|
|
|||
|
|
@ -592,6 +592,9 @@ type KubeControllerManagerConfig struct {
|
|||
// before the terminated pod garbage collector starts deleting terminated pods.
|
||||
// If <= 0, the terminated pod garbage collector is disabled.
|
||||
TerminatedPodGCThreshold *int32 `json:"terminatedPodGCThreshold,omitempty" flag:"terminated-pod-gc-threshold"`
|
||||
|
||||
// UseServiceAccountCredentials controls whether we use individual service account credentials for each controller.
|
||||
UseServiceAccountCredentials *bool `json:"useServiceAccountCredentials,omitempty" flag:"use-service-account-credentials"`
|
||||
}
|
||||
|
||||
type KubeSchedulerConfig struct {
|
||||
|
|
|
|||
|
|
@ -1161,6 +1161,7 @@ func autoConvert_v1alpha1_KubeControllerManagerConfig_To_kops_KubeControllerMana
|
|||
}
|
||||
out.AttachDetachReconcileSyncPeriod = in.AttachDetachReconcileSyncPeriod
|
||||
out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold
|
||||
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1191,6 +1192,7 @@ func autoConvert_kops_KubeControllerManagerConfig_To_v1alpha1_KubeControllerMana
|
|||
}
|
||||
out.AttachDetachReconcileSyncPeriod = in.AttachDetachReconcileSyncPeriod
|
||||
out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold
|
||||
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -263,6 +263,9 @@ type KubeControllerManagerConfig struct {
|
|||
// before the terminated pod garbage collector starts deleting terminated pods.
|
||||
// If <= 0, the terminated pod garbage collector is disabled.
|
||||
TerminatedPodGCThreshold *int32 `json:"terminatedPodGCThreshold,omitempty" flag:"terminated-pod-gc-threshold"`
|
||||
|
||||
// UseServiceAccountCredentials controls whether we use individual service account credentials for each controller.
|
||||
UseServiceAccountCredentials *bool `json:"useServiceAccountCredentials,omitempty" flag:"use-service-account-credentials"`
|
||||
}
|
||||
|
||||
type KubeSchedulerConfig struct {
|
||||
|
|
|
|||
|
|
@ -1259,6 +1259,7 @@ func autoConvert_v1alpha2_KubeControllerManagerConfig_To_kops_KubeControllerMana
|
|||
}
|
||||
out.AttachDetachReconcileSyncPeriod = in.AttachDetachReconcileSyncPeriod
|
||||
out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold
|
||||
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1289,6 +1290,7 @@ func autoConvert_kops_KubeControllerManagerConfig_To_v1alpha2_KubeControllerMana
|
|||
}
|
||||
out.AttachDetachReconcileSyncPeriod = in.AttachDetachReconcileSyncPeriod
|
||||
out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold
|
||||
out.UseServiceAccountCredentials = in.UseServiceAccountCredentials
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -145,5 +145,11 @@ func (b *KubeControllerManagerOptionsBuilder) BuildOptions(o interface{}) error
|
|||
return fmt.Errorf("no networking mode set")
|
||||
}
|
||||
|
||||
if kcm.UseServiceAccountCredentials == nil {
|
||||
if b.Context.IsKubernetesGTE("1.6") {
|
||||
kcm.UseServiceAccountCredentials = fi.Bool(true)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue