Skip to content

Commit

Permalink
Merge pull request #29 from nginxinc/remove-dependency-on-dns
Browse files Browse the repository at this point in the history
Removed DNS dependency from NGINX controller
  • Loading branch information
pleshakov committed May 13, 2016
2 parents 0cff95b + 3416c1b commit 69024fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 1 addition & 11 deletions nginx-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,8 @@ func main() {
}
}

resolver := getKubeDNSIP(kubeClient)
ngxc, _ := nginx.NewNGINXController(resolver, "/etc/nginx/", local)
ngxc, _ := nginx.NewNGINXController("/etc/nginx/", local)
ngxc.Start()
lbc, _ := controller.NewLoadBalancerController(kubeClient, 30*time.Second, *watchNamespace, ngxc)
lbc.Run()
}

func getKubeDNSIP(kubeClient *client.Client) string {
svcClient := kubeClient.Services("kube-system")
svc, err := svcClient.Get("kube-dns")
if err != nil {
glog.Fatalf("Failed to get kube-dns service, err: %v", err)
}
return svc.Spec.ClusterIP
}
4 changes: 1 addition & 3 deletions nginx-controller/nginx/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

// NGINXController Updates NGINX configuration, starts and reloads NGINX
type NGINXController struct {
resolver string
nginxConfdPath string
nginxCertsPath string
local bool
Expand Down Expand Up @@ -62,9 +61,8 @@ func NewUpstreamWithDefaultServer(name string) Upstream {
}

// NewNGINXController creates a NGINX controller
func NewNGINXController(resolver string, nginxConfPath string, local bool) (*NGINXController, error) {
func NewNGINXController(nginxConfPath string, local bool) (*NGINXController, error) {
ngxc := NGINXController{
resolver: resolver,
nginxConfdPath: path.Join(nginxConfPath, "conf.d"),
nginxCertsPath: path.Join(nginxConfPath, "ssl"),
local: local,
Expand Down

0 comments on commit 69024fd

Please sign in to comment.