nginx

package
v0.0.0-...-e27240b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2016 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NginxManager

type NginxManager struct {

	// path to the configuration file to be used by nginx
	ConfigFile string
	// contains filtered or unexported fields
}

NginxManager ...

func NewManager

func NewManager(kubeClient *client.Client, defaultSvc, customErrorSvc Service) *NginxManager

NewManager ...

func (*NginxManager) IsHealthy

func (ngx *NginxManager) IsHealthy() error

IsHealthy checks if nginx is running

func (*NginxManager) ReadConfig

func (ngx *NginxManager) ReadConfig(data string) (cfg *nginxConfiguration, err error)

ReadConfig obtains the configuration defined by the user or returns the default if it does not exists or if is not a well formed json object

func (*NginxManager) Reload

func (ngx *NginxManager) Reload(cfg *nginxConfiguration, servicesL4 []Service)

Reload the master process receives the signal to reload configuration, it checks the syntax validity of the new configuration file and tries to apply the configuration provided in it. If this is a success, the master process starts new worker processes and sends messages to old worker processes, requesting them to shut down. Otherwise, the master process rolls back the changes and continues to work with the old configuration. Old worker processes, receiving a command to shut down, stop accepting new connections and continue to service current requests until all such requests are serviced. After that, the old worker processes exit. http://nginx.org/en/docs/beginners_guide.html#control

func (*NginxManager) Start

func (ngx *NginxManager) Start()

Start starts a nginx (master process) and waits. If the process ends we need to kill the controller process and return the reason.

func (*NginxManager) SyncIngress

func (ngx *NginxManager) SyncIngress(ingList []interface{}) error

SyncIngress creates a GET request to nginx to indicate that is required to refresh the Ingress rules.

type Service

type Service struct {
	ServiceName string
	ServicePort string
	Namespace   string
	// ExposedPort port used by nginx to listen for the stream upstream
	ExposedPort string
}

Service service definition to use in nginx template

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL