Documentation ¶
Index ¶
- func ConfigMapAsString() string
- type IngressConfig
- type Location
- type LocationByPath
- type Manager
- func (nginx *Manager) AddOrUpdateCertAndKey(name string, cert string, key string) string
- func (ngx Manager) Check(_ *http.Request) error
- func (ngx *Manager) CheckAndReload(cfg nginxConfiguration, ingressCfg IngressConfig)
- func (nginx *Manager) CheckSSLCertificate(pemFileName string) ([]string, error)
- func (ngx Manager) Name() string
- func (ngx *Manager) ReadConfig(config *api.ConfigMap) nginxConfiguration
- func (nginx *Manager) SearchDHParamFile(baseDir string) string
- func (ngx *Manager) Start()
- type Server
- type ServerByName
- type Upstream
- type UpstreamByNameServers
- type UpstreamServer
- type UpstreamServerByAddrPort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigMapAsString ¶
func ConfigMapAsString() string
ConfigMapAsString returns a ConfigMap with the default NGINX configuration to be used a guide to provide a custom configuration
Types ¶
type IngressConfig ¶
IngressConfig describes an NGINX configuration
type LocationByPath ¶
type LocationByPath []*Location
LocationByPath sorts location by path
func (LocationByPath) Len ¶
func (c LocationByPath) Len() int
func (LocationByPath) Less ¶
func (c LocationByPath) Less(i, j int) bool
func (LocationByPath) Swap ¶
func (c LocationByPath) Swap(i, j int)
type Manager ¶
type Manager struct { ConfigFile string // contains filtered or unexported fields }
Manager ...
func (*Manager) AddOrUpdateCertAndKey ¶
AddOrUpdateCertAndKey creates a .pem file wth the cert and the key with the specified name
func (Manager) Check ¶
Check returns if the nginx healthz endpoint is returning ok (status code 200)
func (*Manager) CheckAndReload ¶
func (ngx *Manager) CheckAndReload(cfg nginxConfiguration, ingressCfg IngressConfig)
CheckAndReload verify if the nginx configuration changed and sends a 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 (*Manager) CheckSSLCertificate ¶
CheckSSLCertificate checks if the certificate and key file are valid returning the result of the validation and the list of hostnames contained in the common name/s
func (*Manager) ReadConfig ¶
ReadConfig obtains the configuration defined by the user merged with the defaults.
func (*Manager) SearchDHParamFile ¶
SearchDHParamFile iterates all the secrets mounted inside the /etc/nginx-ssl directory in order to find a file with the name dhparam.pem. If such file exists it will returns the path. If not it just returns an empty string
type Server ¶
type Server struct { Name string Locations []*Location SSL bool SSLCertificate string SSLCertificateKey string }
Server describes an NGINX server
type ServerByName ¶
type ServerByName []*Server
ServerByName sorts server by name
func (ServerByName) Len ¶
func (c ServerByName) Len() int
func (ServerByName) Less ¶
func (c ServerByName) Less(i, j int) bool
func (ServerByName) Swap ¶
func (c ServerByName) Swap(i, j int)
type Upstream ¶
type Upstream struct { Name string Backends []UpstreamServer }
Upstream describes an NGINX upstream
func NewUpstream ¶
NewUpstream creates an upstream without servers.
type UpstreamByNameServers ¶
type UpstreamByNameServers []*Upstream
UpstreamByNameServers sorts upstreams by name
func (UpstreamByNameServers) Len ¶
func (c UpstreamByNameServers) Len() int
func (UpstreamByNameServers) Less ¶
func (c UpstreamByNameServers) Less(i, j int) bool
func (UpstreamByNameServers) Swap ¶
func (c UpstreamByNameServers) Swap(i, j int)
type UpstreamServer ¶
UpstreamServer describes a server in an NGINX upstream
func NewDefaultServer ¶
func NewDefaultServer() UpstreamServer
NewDefaultServer return an UpstreamServer to be use as default server that returns 503.
type UpstreamServerByAddrPort ¶
type UpstreamServerByAddrPort []UpstreamServer
UpstreamServerByAddrPort sorts upstream servers by address and port
func (UpstreamServerByAddrPort) Len ¶
func (c UpstreamServerByAddrPort) Len() int
func (UpstreamServerByAddrPort) Less ¶
func (c UpstreamServerByAddrPort) Less(i, j int) bool
func (UpstreamServerByAddrPort) Swap ¶
func (c UpstreamServerByAddrPort) Swap(i, j int)