Skip to content

Commit

Permalink
Move NGINX configuration to other place
Browse files Browse the repository at this point in the history
  • Loading branch information
rikatz committed Apr 14, 2024
1 parent f91e0e5 commit 2fb693f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
23 changes: 23 additions & 0 deletions docs/enhancements/20231001-split-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,29 @@ to start, stop and reload NGINX
* /test - (POST) Test the configuration of a given file location
* "config" argument is the location of temporary file that should be tested

## Implementation details
### Control Plane

This container will have the following functionality:
* Watch / Map changes on Kubernetes API Server
* Write the configuration files on the shared directory
* Call the Openresty endpoint to do the dynamic configuration
* Trigger reload, when required, on the dataplane container

Open ports:
* Metrics port

### Data Plane
This container will have the following functionality

* Provide Access between users and Pods
* (TODO): Provide TLS Passthrough

Open ports:
* HTTP/HTTPs Ports
* Localhost only - Openresty configuration port
* (TODO): Metrics port

### Mounting empty SA on controller container

```yaml
Expand Down
2 changes: 1 addition & 1 deletion images/nginx-1.25/TAG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.0.6
v0.0.7
2 changes: 1 addition & 1 deletion internal/ingress/controller/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) error {
return err
}

o, err := n.command.ExecCommand("-s", "reload").CombinedOutput()
o, err := n.command.ExecCommand("-s", "reload", "-c", cfgPath).CombinedOutput()
if err != nil {
return fmt.Errorf("%v\n%v", err, string(o))
}
Expand Down
2 changes: 1 addition & 1 deletion internal/ingress/controller/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func rlimitMaxNumFiles() int {

const (
defBinary = "/usr/bin/nginx"
cfgPath = "/etc/nginx/nginx.conf"
cfgPath = "/etc/ingress-controller/nginx.conf"
)

// NginxExecTester defines the interface to execute
Expand Down

0 comments on commit 2fb693f

Please sign in to comment.