@@ -124,9 +124,15 @@ func newCertRotationController(
124
124
// This must be reverted before we ship
125
125
rotationDay = rotationDay / 60
126
126
127
- monthPeriod := rotationDay * 30
128
- yearPeriod := monthPeriod * 12
129
- tenMonthPeriod := monthPeriod * 10
127
+ // Some certificates should not be affected by development cycle rotation
128
+ devRotationExceptionDay := 24 * time .Hour
129
+
130
+ monthPeriod := 30 * rotationDay
131
+ devRotationExceptionMonth := 30 * devRotationExceptionDay
132
+ yearPeriod := 365 * rotationDay
133
+ devRotationExceptionYear := 365 * devRotationExceptionDay
134
+ tenMonthPeriod := 292 * rotationDay
135
+ devRotationExceptionTenMonth := 292 * devRotationExceptionDay
130
136
131
137
// Set custom rotation duration when FeatureShortCertRotation is enabled
132
138
featureGates , err := featureGateAccessor .CurrentFeatureGates ()
@@ -136,8 +142,11 @@ func newCertRotationController(
136
142
137
143
if featureGates .Enabled (features .FeatureShortCertRotation ) {
138
144
monthPeriod = 2 * time .Hour
145
+ devRotationExceptionMonth = monthPeriod
139
146
yearPeriod = 3 * time .Hour
147
+ devRotationExceptionYear = yearPeriod
140
148
tenMonthPeriod = 150 * time .Minute
149
+ devRotationExceptionTenMonth = tenMonthPeriod
141
150
}
142
151
klog .Infof ("Setting monthPeriod to %v, yearPeriod to %v, tenMonthPeriod to %v" , monthPeriod , yearPeriod , tenMonthPeriod )
143
152
@@ -206,10 +215,10 @@ func newCertRotationController(
206
215
AutoRegenerateAfterOfflineExpiry : "https://github.com/openshift/cluster-kube-apiserver-operator/pull/1631,'[sig-cli] Kubectl logs logs should be able to retrieve and filter logs [Conformance] [Suite:openshift/conformance/parallel/minimal] [Suite:k8s]'" ,
207
216
Description : "Signer for the kube-apiserver-to-kubelet-client so kubelets can recognize the kube-apiserver." ,
208
217
},
209
- Validity : monthPeriod * 2 , // this comes from the installer
218
+ Validity : devRotationExceptionYear , // this comes from the installer
210
219
// Refresh set to 80% of the validity.
211
220
// This range is consistent with most other signers defined in this pkg.
212
- Refresh : monthPeriod ,
221
+ Refresh : devRotationExceptionMonth ,
213
222
RefreshOnlyWhenExpired : refreshOnlyWhenExpired ,
214
223
Informer : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets (),
215
224
Lister : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets ().Lister (),
@@ -552,8 +561,8 @@ func newCertRotationController(
552
561
AutoRegenerateAfterOfflineExpiry : "https://github.com/openshift/cluster-kube-apiserver-operator/pull/1631,'operator conditions kube-apiserver'" ,
553
562
Description : "Signer for kube-controller-manager and kube-scheduler client certificates." ,
554
563
},
555
- Validity : 2 * monthPeriod ,
556
- Refresh : monthPeriod ,
564
+ Validity : 2 * devRotationExceptionMonth ,
565
+ Refresh : devRotationExceptionMonth ,
557
566
RefreshOnlyWhenExpired : refreshOnlyWhenExpired ,
558
567
Informer : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets (),
559
568
Lister : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets ().Lister (),
@@ -607,8 +616,8 @@ func newCertRotationController(
607
616
AutoRegenerateAfterOfflineExpiry : "https://github.com/openshift/cluster-kube-apiserver-operator/pull/1631,'operator conditions kube-apiserver'" ,
608
617
Description : "Signer for kube-controller-manager and kube-scheduler client certificates." ,
609
618
},
610
- Validity : 2 * monthPeriod ,
611
- Refresh : monthPeriod ,
619
+ Validity : 2 * devRotationExceptionMonth ,
620
+ Refresh : devRotationExceptionMonth ,
612
621
RefreshOnlyWhenExpired : refreshOnlyWhenExpired ,
613
622
Informer : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets (),
614
623
Lister : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets ().Lister (),
@@ -662,8 +671,8 @@ func newCertRotationController(
662
671
AutoRegenerateAfterOfflineExpiry : "https://github.com/openshift/cluster-kube-apiserver-operator/pull/1631,'operator conditions kube-apiserver'" ,
663
672
Description : "Signer for kube-controller-manager and kube-scheduler client certificates." ,
664
673
},
665
- Validity : 2 * monthPeriod ,
666
- Refresh : monthPeriod ,
674
+ Validity : 2 * devRotationExceptionMonth ,
675
+ Refresh : devRotationExceptionMonth ,
667
676
RefreshOnlyWhenExpired : refreshOnlyWhenExpired ,
668
677
Informer : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets (),
669
678
Lister : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets ().Lister (),
@@ -716,8 +725,8 @@ func newCertRotationController(
716
725
AutoRegenerateAfterOfflineExpiry : "https://github.com/openshift/cluster-kube-apiserver-operator/pull/1631,'operator conditions kube-apiserver'" ,
717
726
Description : "Signer for kube-controller-manager and kube-scheduler client certificates." ,
718
727
},
719
- Validity : 2 * monthPeriod ,
720
- Refresh : monthPeriod ,
728
+ Validity : 2 * devRotationExceptionMonth ,
729
+ Refresh : devRotationExceptionMonth ,
721
730
RefreshOnlyWhenExpired : refreshOnlyWhenExpired ,
722
731
Informer : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets (),
723
732
Lister : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets ().Lister (),
@@ -771,10 +780,10 @@ func newCertRotationController(
771
780
AutoRegenerateAfterOfflineExpiry : "https://github.com/openshift/cluster-kube-apiserver-operator/pull/1631,'operator conditions kube-apiserver'" ,
772
781
Description : "Signer for the per-master-debugging-client." ,
773
782
},
774
- Validity : yearPeriod ,
783
+ Validity : devRotationExceptionYear ,
775
784
// Refresh set to 80% of the validity.
776
785
// This range is consistent with most other signers defined in this pkg.
777
- Refresh : tenMonthPeriod ,
786
+ Refresh : devRotationExceptionTenMonth ,
778
787
RefreshOnlyWhenExpired : refreshOnlyWhenExpired ,
779
788
Informer : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets (),
780
789
Lister : kubeInformersForNamespaces .InformersFor (operatorclient .OperatorNamespace ).Core ().V1 ().Secrets ().Lister (),
@@ -805,7 +814,7 @@ func newCertRotationController(
805
814
// This needs to live longer then control plane certs so there is high chance that if a cluster breaks
806
815
// because of expired certs these are still valid to use for collecting data using localhost-recovery
807
816
// endpoint with long lived serving certs for localhost.
808
- Validity : 2 * yearPeriod ,
817
+ Validity : 2 * devRotationExceptionYear ,
809
818
// We rotate sooner so certs are always valid for 90 days (30 days more then kube-control-plane-signer)
810
819
Refresh : monthPeriod ,
811
820
RefreshOnlyWhenExpired : refreshOnlyWhenExpired ,
0 commit comments