Remove node lister
This commit is contained in:
parent
5e05acd924
commit
3bbe2490b3
5 changed files with 8 additions and 20 deletions
|
@ -99,7 +99,7 @@ func parseFlags() (bool, *controller.Configuration, error) {
|
||||||
configmaps located in a different namespace than the specified in the flag --watch-namespace.`)
|
configmaps located in a different namespace than the specified in the flag --watch-namespace.`)
|
||||||
|
|
||||||
disableNodeList = flags.Bool("disable-node-list", false,
|
disableNodeList = flags.Bool("disable-node-list", false,
|
||||||
`Disable querying nodes. If --force-namespace-isolation is true, this should also be set.`)
|
`Disable querying nodes. If --force-namespace-isolation is true, this should also be set. (DEPRECATED)`)
|
||||||
|
|
||||||
updateStatusOnShutdown = flags.Bool("update-status-on-shutdown", true, `Indicates if the
|
updateStatusOnShutdown = flags.Bool("update-status-on-shutdown", true, `Indicates if the
|
||||||
ingress controller should update the Ingress status IP/hostname when the controller
|
ingress controller should update the Ingress status IP/hostname when the controller
|
||||||
|
@ -171,6 +171,11 @@ func parseFlags() (bool, *controller.Configuration, error) {
|
||||||
return false, nil, fmt.Errorf("Port %v is already in use. Please check the flag --ssl-passtrough-proxy-port", *sslProxyPort)
|
return false, nil, fmt.Errorf("Port %v is already in use. Please check the flag --ssl-passtrough-proxy-port", *sslProxyPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: remove disableNodeList flag
|
||||||
|
if *disableNodeList {
|
||||||
|
glog.Warningf("%s is DEPRECATED and will be removed in a future version.", disableNodeList)
|
||||||
|
}
|
||||||
|
|
||||||
config := &controller.Configuration{
|
config := &controller.Configuration{
|
||||||
APIServerHost: *apiserverHost,
|
APIServerHost: *apiserverHost,
|
||||||
KubeConfigFile: *kubeConfigFile,
|
KubeConfigFile: *kubeConfigFile,
|
||||||
|
@ -189,7 +194,6 @@ func parseFlags() (bool, *controller.Configuration, error) {
|
||||||
DefaultHealthzURL: *defHealthzURL,
|
DefaultHealthzURL: *defHealthzURL,
|
||||||
PublishService: *publishSvc,
|
PublishService: *publishSvc,
|
||||||
ForceNamespaceIsolation: *forceIsolation,
|
ForceNamespaceIsolation: *forceIsolation,
|
||||||
DisableNodeList: *disableNodeList,
|
|
||||||
UpdateStatusOnShutdown: *updateStatusOnShutdown,
|
UpdateStatusOnShutdown: *updateStatusOnShutdown,
|
||||||
SortBackends: *sortBackends,
|
SortBackends: *sortBackends,
|
||||||
UseNodeInternalIP: *useNodeInternalIP,
|
UseNodeInternalIP: *useNodeInternalIP,
|
||||||
|
|
|
@ -77,7 +77,6 @@ type Configuration struct {
|
||||||
Namespace string
|
Namespace string
|
||||||
|
|
||||||
ForceNamespaceIsolation bool
|
ForceNamespaceIsolation bool
|
||||||
DisableNodeList bool
|
|
||||||
|
|
||||||
// optional
|
// optional
|
||||||
TCPConfigMapName string
|
TCPConfigMapName string
|
||||||
|
|
|
@ -27,7 +27,6 @@ import (
|
||||||
"k8s.io/apimachinery/pkg/fields"
|
"k8s.io/apimachinery/pkg/fields"
|
||||||
"k8s.io/apimachinery/pkg/util/runtime"
|
"k8s.io/apimachinery/pkg/util/runtime"
|
||||||
"k8s.io/client-go/tools/cache"
|
"k8s.io/client-go/tools/cache"
|
||||||
fcache "k8s.io/client-go/tools/cache/testing"
|
|
||||||
|
|
||||||
"k8s.io/ingress-nginx/pkg/ingress"
|
"k8s.io/ingress-nginx/pkg/ingress"
|
||||||
"k8s.io/ingress-nginx/pkg/ingress/annotations/class"
|
"k8s.io/ingress-nginx/pkg/ingress/annotations/class"
|
||||||
|
@ -38,7 +37,6 @@ type cacheController struct {
|
||||||
Ingress cache.Controller
|
Ingress cache.Controller
|
||||||
Endpoint cache.Controller
|
Endpoint cache.Controller
|
||||||
Service cache.Controller
|
Service cache.Controller
|
||||||
Node cache.Controller
|
|
||||||
Secret cache.Controller
|
Secret cache.Controller
|
||||||
Configmap cache.Controller
|
Configmap cache.Controller
|
||||||
}
|
}
|
||||||
|
@ -47,7 +45,6 @@ func (c *cacheController) Run(stopCh chan struct{}) {
|
||||||
go c.Ingress.Run(stopCh)
|
go c.Ingress.Run(stopCh)
|
||||||
go c.Endpoint.Run(stopCh)
|
go c.Endpoint.Run(stopCh)
|
||||||
go c.Service.Run(stopCh)
|
go c.Service.Run(stopCh)
|
||||||
go c.Node.Run(stopCh)
|
|
||||||
go c.Secret.Run(stopCh)
|
go c.Secret.Run(stopCh)
|
||||||
go c.Configmap.Run(stopCh)
|
go c.Configmap.Run(stopCh)
|
||||||
|
|
||||||
|
@ -56,7 +53,6 @@ func (c *cacheController) Run(stopCh chan struct{}) {
|
||||||
c.Ingress.HasSynced,
|
c.Ingress.HasSynced,
|
||||||
c.Endpoint.HasSynced,
|
c.Endpoint.HasSynced,
|
||||||
c.Service.HasSynced,
|
c.Service.HasSynced,
|
||||||
c.Node.HasSynced,
|
|
||||||
c.Secret.HasSynced,
|
c.Secret.HasSynced,
|
||||||
c.Configmap.HasSynced,
|
c.Configmap.HasSynced,
|
||||||
) {
|
) {
|
||||||
|
@ -64,7 +60,7 @@ func (c *cacheController) Run(stopCh chan struct{}) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *NGINXController) createListers(disableNodeLister bool, stopCh chan struct{}) *ingress.StoreLister {
|
func (n *NGINXController) createListers(stopCh chan struct{}) *ingress.StoreLister {
|
||||||
// from here to the end of the method all the code is just boilerplate
|
// from here to the end of the method all the code is just boilerplate
|
||||||
// required to watch Ingress, Secrets, ConfigMaps and Endoints.
|
// required to watch Ingress, Secrets, ConfigMaps and Endoints.
|
||||||
// This is used to detect new content, updates or removals and act accordingly
|
// This is used to detect new content, updates or removals and act accordingly
|
||||||
|
@ -223,16 +219,6 @@ func (n *NGINXController) createListers(disableNodeLister bool, stopCh chan stru
|
||||||
cache.NewListWatchFromClient(n.cfg.Client.CoreV1().RESTClient(), "services", n.cfg.Namespace, fields.Everything()),
|
cache.NewListWatchFromClient(n.cfg.Client.CoreV1().RESTClient(), "services", n.cfg.Namespace, fields.Everything()),
|
||||||
&apiv1.Service{}, n.cfg.ResyncPeriod, cache.ResourceEventHandlerFuncs{})
|
&apiv1.Service{}, n.cfg.ResyncPeriod, cache.ResourceEventHandlerFuncs{})
|
||||||
|
|
||||||
var nodeListerWatcher cache.ListerWatcher
|
|
||||||
if disableNodeLister {
|
|
||||||
nodeListerWatcher = fcache.NewFakeControllerSource()
|
|
||||||
} else {
|
|
||||||
nodeListerWatcher = cache.NewListWatchFromClient(n.cfg.Client.CoreV1().RESTClient(), "nodes", apiv1.NamespaceAll, fields.Everything())
|
|
||||||
}
|
|
||||||
lister.Node.Store, controller.Node = cache.NewInformer(
|
|
||||||
nodeListerWatcher,
|
|
||||||
&apiv1.Node{}, n.cfg.ResyncPeriod, cache.ResourceEventHandlerFuncs{})
|
|
||||||
|
|
||||||
controller.Run(n.stopCh)
|
controller.Run(n.stopCh)
|
||||||
|
|
||||||
return lister
|
return lister
|
||||||
|
|
|
@ -116,7 +116,7 @@ func NewNGINXController(config *Configuration) *NGINXController {
|
||||||
|
|
||||||
n.syncQueue = task.NewTaskQueue(n.syncIngress)
|
n.syncQueue = task.NewTaskQueue(n.syncIngress)
|
||||||
|
|
||||||
n.listers = n.createListers(config.DisableNodeList, n.stopCh)
|
n.listers = n.createListers(n.stopCh)
|
||||||
|
|
||||||
if config.UpdateStatus {
|
if config.UpdateStatus {
|
||||||
n.syncStatus = status.NewStatusSyncer(status.Config{
|
n.syncStatus = status.NewStatusSyncer(status.Config{
|
||||||
|
|
|
@ -49,7 +49,6 @@ var (
|
||||||
type StoreLister struct {
|
type StoreLister struct {
|
||||||
Ingress store.IngressLister
|
Ingress store.IngressLister
|
||||||
Service store.ServiceLister
|
Service store.ServiceLister
|
||||||
Node store.NodeLister
|
|
||||||
Endpoint store.EndpointLister
|
Endpoint store.EndpointLister
|
||||||
Secret store.SecretLister
|
Secret store.SecretLister
|
||||||
ConfigMap store.ConfigMapLister
|
ConfigMap store.ConfigMapLister
|
||||||
|
|
Loading…
Reference in a new issue