Merge pull request #3505 from Shopify/watch-pod-lua
Update lua configuration_data when number of controller pod change
This commit is contained in:
commit
ee3a8fe581
10 changed files with 113 additions and 19 deletions
|
|
@ -754,6 +754,8 @@ func (n *NGINXController) IsDynamicConfigurationEnough(pcfg *ingress.Configurati
|
|||
|
||||
copyOfRunningConfig.Backends = []*ingress.Backend{}
|
||||
copyOfPcfg.Backends = []*ingress.Backend{}
|
||||
copyOfRunningConfig.ControllerPodsCount = 0
|
||||
copyOfPcfg.ControllerPodsCount = 0
|
||||
|
||||
if n.cfg.DynamicCertificatesEnabled {
|
||||
clearCertificates(©OfRunningConfig)
|
||||
|
|
@ -827,6 +829,14 @@ func configureDynamically(pcfg *ingress.Configuration, port int, isDynamicCertif
|
|||
return err
|
||||
}
|
||||
|
||||
url = fmt.Sprintf("http://localhost:%d/configuration/general", port)
|
||||
err = post(url, &ingress.GeneralConfig{
|
||||
ControllerPodsCount: pcfg.ControllerPodsCount,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if isDynamicCertificatesEnabled {
|
||||
err = configureCertificates(pcfg, port)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue