Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

staticpod/installer: get rid of sleep in sync loop #1183

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/openshift/api v0.0.0-20210706092853-b63d499a70ce
github.com/openshift/build-machinery-go v0.0.0-20210423112049-9415d7ebd33e
github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142
github.com/openshift/library-go v0.0.0-20210720093535-f8ed43828870
github.com/openshift/library-go v0.0.0-20210723094744-7b9501f356ce
github.com/pkg/profile v1.5.0 // indirect
github.com/prometheus-operator/prometheus-operator/pkg/client v0.45.0
github.com/prometheus/client_golang v1.7.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142 h1:ZHRIMCFIJN1
github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142/go.mod h1:fjS8r9mqDVsPb5td3NehsNOAWa4uiFkYEfVZioQ2gH0=
github.com/openshift/kubernetes-apiserver v0.0.0-20210419140141-620426e63a99 h1:KrCYRAJcgZYzMCB1PjJHJMYPu/d+dEkelq5eYyi0fDw=
github.com/openshift/kubernetes-apiserver v0.0.0-20210419140141-620426e63a99/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg=
github.com/openshift/library-go v0.0.0-20210720093535-f8ed43828870 h1:xhtl3hJFfICWRPhLfu0xvX44rhR2Gf91LPRND2TdPPY=
github.com/openshift/library-go v0.0.0-20210720093535-f8ed43828870/go.mod h1:rln3LbFNOpENSvhmsfH7g/hqc58IF78+o96yAAp5mq0=
github.com/openshift/library-go v0.0.0-20210723094744-7b9501f356ce h1:39jq3DTPT3Uh8s8c9c23l25aKg1NL7xP2UAea2x5apQ=
github.com/openshift/library-go v0.0.0-20210723094744-7b9501f356ce/go.mod h1:rln3LbFNOpENSvhmsfH7g/hqc58IF78+o96yAAp5mq0=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
Expand Down
72 changes: 36 additions & 36 deletions pkg/operator/certrotationcontroller/certrotationcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func newCertRotationController(

certRotator := certrotation.NewCertRotationController(
"AggregatorProxyClientCert",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "aggregator-client-signer",
Validity: 30 * rotationDay,
Expand All @@ -141,15 +141,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.GlobalMachineSpecifiedConfigNamespace,
Name: "kube-apiserver-aggregator-client-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.GlobalMachineSpecifiedConfigNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.GlobalMachineSpecifiedConfigNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.TargetNamespace,
Name: "aggregator-client",
Validity: 30 * rotationDay,
Expand All @@ -170,7 +170,7 @@ func newCertRotationController(

certRotator = certrotation.NewCertRotationController(
"KubeAPIServerToKubeletClientCert",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "kube-apiserver-to-kubelet-signer",
Validity: 1 * 365 * defaultRotationDay, // this comes from the installer
Expand All @@ -181,15 +181,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.OperatorNamespace,
Name: "kube-apiserver-to-kubelet-client-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.TargetNamespace,
Name: "kubelet-client",
Validity: 30 * rotationDay,
Expand All @@ -210,7 +210,7 @@ func newCertRotationController(

certRotator = certrotation.NewCertRotationController(
"LocalhostServing",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "localhost-serving-signer",
Validity: 10 * 365 * defaultRotationDay, // this comes from the installer
Expand All @@ -221,15 +221,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.OperatorNamespace,
Name: "localhost-serving-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.TargetNamespace,
Name: "localhost-serving-cert-certkey",
Validity: 30 * rotationDay,
Expand All @@ -250,7 +250,7 @@ func newCertRotationController(

certRotator = certrotation.NewCertRotationController(
"ServiceNetworkServing",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "service-network-serving-signer",
Validity: 10 * 365 * defaultRotationDay, // this comes from the installer
Expand All @@ -261,15 +261,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.OperatorNamespace,
Name: "service-network-serving-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.TargetNamespace,
Name: "service-network-serving-certkey",
Validity: 30 * rotationDay,
Expand All @@ -291,7 +291,7 @@ func newCertRotationController(

certRotator = certrotation.NewCertRotationController(
"ExternalLoadBalancerServing",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "loadbalancer-serving-signer",
Validity: 10 * 365 * defaultRotationDay, // this comes from the installer
Expand All @@ -302,15 +302,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.OperatorNamespace,
Name: "loadbalancer-serving-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.TargetNamespace,
Name: "external-loadbalancer-serving-certkey",
Validity: 30 * rotationDay,
Expand All @@ -332,7 +332,7 @@ func newCertRotationController(

certRotator = certrotation.NewCertRotationController(
"InternalLoadBalancerServing",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "loadbalancer-serving-signer",
Validity: 10 * 365 * defaultRotationDay, // this comes from the installer
Expand All @@ -343,15 +343,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.OperatorNamespace,
Name: "loadbalancer-serving-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.TargetNamespace,
Name: "internal-loadbalancer-serving-certkey",
Validity: 30 * rotationDay,
Expand All @@ -373,7 +373,7 @@ func newCertRotationController(

certRotator = certrotation.NewCertRotationController(
"LocalhostRecoveryServing",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "localhost-recovery-serving-signer",
Validity: 10 * 365 * defaultRotationDay, // this comes from the installer
Expand All @@ -383,15 +383,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.OperatorNamespace,
Name: "localhost-recovery-serving-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.TargetNamespace,
Name: "localhost-recovery-serving-certkey",
Validity: 10 * 365 * defaultRotationDay,
Expand All @@ -411,7 +411,7 @@ func newCertRotationController(

certRotator = certrotation.NewCertRotationController(
"KubeControllerManagerClient",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "kube-control-plane-signer",
Validity: 60 * defaultRotationDay,
Expand All @@ -422,15 +422,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.OperatorNamespace,
Name: "kube-control-plane-signer-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.GlobalMachineSpecifiedConfigNamespace,
Name: "kube-controller-manager-client-cert-key",
Validity: 30 * rotationDay,
Expand All @@ -451,7 +451,7 @@ func newCertRotationController(

certRotator = certrotation.NewCertRotationController(
"KubeSchedulerClient",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "kube-control-plane-signer",
Validity: 60 * defaultRotationDay,
Expand All @@ -462,15 +462,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.OperatorNamespace,
Name: "kube-control-plane-signer-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.GlobalMachineSpecifiedConfigNamespace,
Name: "kube-scheduler-client-cert-key",
Validity: 30 * rotationDay,
Expand All @@ -491,7 +491,7 @@ func newCertRotationController(

certRotator = certrotation.NewCertRotationController(
"ControlPlaneNodeAdminClient",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "kube-control-plane-signer",
Validity: 60 * defaultRotationDay,
Expand All @@ -502,15 +502,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.OperatorNamespace,
Name: "kube-control-plane-signer-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.TargetNamespace,
Name: "control-plane-node-admin-client-cert-key",
Validity: 30 * rotationDay,
Expand All @@ -531,7 +531,7 @@ func newCertRotationController(

certRotator = certrotation.NewCertRotationController(
"CheckEndpointsClient",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "kube-control-plane-signer",
Validity: 60 * defaultRotationDay,
Expand All @@ -542,15 +542,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.OperatorNamespace,
Name: "kube-control-plane-signer-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.TargetNamespace,
Name: "check-endpoints-client-cert-key",
Validity: 30 * rotationDay,
Expand All @@ -571,7 +571,7 @@ func newCertRotationController(

certRotator = certrotation.NewCertRotationController(
"NodeSystemAdminClient",
certrotation.SigningRotation{
certrotation.RotatedSigningCASecret{
Namespace: operatorclient.OperatorNamespace,
Name: "node-system-admin-signer",
Validity: 1 * 365 * defaultRotationDay,
Expand All @@ -582,15 +582,15 @@ func newCertRotationController(
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.CABundleRotation{
certrotation.CABundleConfigMap{
Namespace: operatorclient.OperatorNamespace,
Name: "node-system-admin-ca",
Informer: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps(),
Lister: kubeInformersForNamespaces.InformersFor(operatorclient.OperatorNamespace).Core().V1().ConfigMaps().Lister(),
Client: kubeClient.CoreV1(),
EventRecorder: eventRecorder,
},
certrotation.TargetRotation{
certrotation.RotatedSelfSignedCertKeySecret{
Namespace: operatorclient.OperatorNamespace,
Name: "node-system-admin-client",
// This needs to live longer then control plane certs so there is high chance that if a cluster breaks
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.