Remove dns from nginx. Use upstreams for default backend service

This commit is contained in:
Manuel de Brito Fontes 2016-03-19 17:17:58 -03:00
parent 9b142b56f8
commit 28f9cb0b2b
15 changed files with 173 additions and 225 deletions

View file

@ -212,9 +212,7 @@ type Service struct {
// NginxManager ...
type NginxManager struct {
defBackend Service
defCfg *nginxConfiguration
defError Service
defResolver string
// path to the configuration file to be used by nginx
@ -272,12 +270,10 @@ func newDefaultNginxCfg() *nginxConfiguration {
}
// NewManager ...
func NewManager(kubeClient *client.Client, defaultSvc, customErrorSvc Service) *NginxManager {
func NewManager(kubeClient *client.Client) *NginxManager {
ngx := &NginxManager{
ConfigFile: "/etc/nginx/nginx.conf",
defBackend: defaultSvc,
defCfg: newDefaultNginxCfg(),
defError: customErrorSvc,
defResolver: strings.Join(getDnsServers(), " "),
reloadLock: &sync.Mutex{},
}