From 9409e2af67904f6480a9d3787b72816018e5d72b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20=C3=98sthus?= Date: Tue, 5 May 2020 15:19:45 +0200 Subject: [PATCH] Added support for configuring disable-attach-detach-reconcile-sync in k-c-m config --- k8s/crds/kops.k8s.io_clusters.yaml | 5 +++++ pkg/apis/kops/componentconfig.go | 3 +++ pkg/apis/kops/v1alpha2/componentconfig.go | 3 +++ pkg/apis/kops/v1alpha2/zz_generated.conversion.go | 2 ++ pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go | 5 +++++ pkg/apis/kops/zz_generated.deepcopy.go | 5 +++++ 6 files changed, 23 insertions(+) diff --git a/k8s/crds/kops.k8s.io_clusters.yaml b/k8s/crds/kops.k8s.io_clusters.yaml index 001d8bbea869d..def579c4baa71 100644 --- a/k8s/crds/kops.k8s.io_clusters.yaml +++ b/k8s/crds/kops.k8s.io_clusters.yaml @@ -1395,6 +1395,11 @@ spec: items: type: string type: array + disableAttachDetachReconcileSync: + description: DisableAttachDetachReconcileSync disables the reconcile + sync loop in the attach-detach controller. This can cause volumes + to become mismatched with pods + type: boolean enableProfiling: description: EnableProfiling enables profiling via web interface host:port/debug/pprof/ diff --git a/pkg/apis/kops/componentconfig.go b/pkg/apis/kops/componentconfig.go index 941cb40a7e171..e37beb6d1907e 100644 --- a/pkg/apis/kops/componentconfig.go +++ b/pkg/apis/kops/componentconfig.go @@ -507,6 +507,9 @@ type KubeControllerManagerConfig struct { // AttachDetachReconcileSyncPeriod is the amount of time the reconciler sync states loop // wait between successive executions. Is set to 1 min by kops by default AttachDetachReconcileSyncPeriod *metav1.Duration `json:"attachDetachReconcileSyncPeriod,omitempty" flag:"attach-detach-reconcile-sync-period"` + // DisableAttachDetachReconcileSync disables the reconcile sync loop in the attach-detach controller. + // This can cause volumes to become mismatched with pods + DisableAttachDetachReconcileSync *bool `json:"disableAttachDetachReconcileSync,omitempty" flag:"disable-attach-detach-reconcile-sync"` // TerminatedPodGCThreshold is the number of terminated pods that can exist // before the terminated pod garbage collector starts deleting terminated pods. // If <= 0, the terminated pod garbage collector is disabled. diff --git a/pkg/apis/kops/v1alpha2/componentconfig.go b/pkg/apis/kops/v1alpha2/componentconfig.go index c6e2ebb5e03e4..1e5d6d09b6357 100644 --- a/pkg/apis/kops/v1alpha2/componentconfig.go +++ b/pkg/apis/kops/v1alpha2/componentconfig.go @@ -507,6 +507,9 @@ type KubeControllerManagerConfig struct { // ReconcilerSyncLoopPeriod is the amount of time the reconciler sync states loop // wait between successive executions. Is set to 1 min by kops by default AttachDetachReconcileSyncPeriod *metav1.Duration `json:"attachDetachReconcileSyncPeriod,omitempty" flag:"attach-detach-reconcile-sync-period"` + // DisableAttachDetachReconcileSync disables the reconcile sync loop in the attach-detach controller. + // This can cause volumes to become mismatched with pods + DisableAttachDetachReconcileSync *bool `json:"disableAttachDetachReconcileSync,omitempty" flag:"disable-attach-detach-reconcile-sync"` // TerminatedPodGCThreshold is the number of terminated pods that can exist // before the terminated pod garbage collector starts deleting terminated pods. // If <= 0, the terminated pod garbage collector is disabled. diff --git a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go index a8d99cc747aeb..10e926d506625 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go @@ -3922,6 +3922,7 @@ func autoConvert_v1alpha2_KubeControllerManagerConfig_To_kops_KubeControllerMana out.LeaderElection = nil } out.AttachDetachReconcileSyncPeriod = in.AttachDetachReconcileSyncPeriod + out.DisableAttachDetachReconcileSync = in.DisableAttachDetachReconcileSync out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold out.NodeMonitorPeriod = in.NodeMonitorPeriod out.NodeMonitorGracePeriod = in.NodeMonitorGracePeriod @@ -3981,6 +3982,7 @@ func autoConvert_kops_KubeControllerManagerConfig_To_v1alpha2_KubeControllerMana out.LeaderElection = nil } out.AttachDetachReconcileSyncPeriod = in.AttachDetachReconcileSyncPeriod + out.DisableAttachDetachReconcileSync = in.DisableAttachDetachReconcileSync out.TerminatedPodGCThreshold = in.TerminatedPodGCThreshold out.NodeMonitorPeriod = in.NodeMonitorPeriod out.NodeMonitorGracePeriod = in.NodeMonitorGracePeriod diff --git a/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go index aa784e9ebdcdf..a4ac90e223a19 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go @@ -2319,6 +2319,11 @@ func (in *KubeControllerManagerConfig) DeepCopyInto(out *KubeControllerManagerCo *out = new(v1.Duration) **out = **in } + if in.DisableAttachDetachReconcileSync != nil { + in, out := &in.DisableAttachDetachReconcileSync, &out.DisableAttachDetachReconcileSync + *out = new(bool) + **out = **in + } if in.TerminatedPodGCThreshold != nil { in, out := &in.TerminatedPodGCThreshold, &out.TerminatedPodGCThreshold *out = new(int32) diff --git a/pkg/apis/kops/zz_generated.deepcopy.go b/pkg/apis/kops/zz_generated.deepcopy.go index c23af358fb5f9..f4a2924af9c4e 100644 --- a/pkg/apis/kops/zz_generated.deepcopy.go +++ b/pkg/apis/kops/zz_generated.deepcopy.go @@ -2501,6 +2501,11 @@ func (in *KubeControllerManagerConfig) DeepCopyInto(out *KubeControllerManagerCo *out = new(v1.Duration) **out = **in } + if in.DisableAttachDetachReconcileSync != nil { + in, out := &in.DisableAttachDetachReconcileSync, &out.DisableAttachDetachReconcileSync + *out = new(bool) + **out = **in + } if in.TerminatedPodGCThreshold != nil { in, out := &in.TerminatedPodGCThreshold, &out.TerminatedPodGCThreshold *out = new(int32)