Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/transport server external name #3041

Merged
merged 27 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7878e35
Initial support for TS external name
jjngx Sep 15, 2022
e3f888a
add example files for externalsvc vs example
vepatel Sep 14, 2022
11cadc1
add ts secure-app for externalName
vepatel Sep 14, 2022
9ed8919
Remove duplicate
vepatel Sep 15, 2022
07cccde
Update TS template
jjngx Sep 16, 2022
89ebc2b
Remove obsolete comments
jjngx Sep 16, 2022
b6374fe
Merge branch 'main' into feat/transport-server-external-name
vepatel Sep 16, 2022
f0bf34c
move resolver addresses outside tls passthough
vepatel Sep 16, 2022
f4e3422
Add automated tests
vepatel Sep 16, 2022
0de1dfb
skip test for OSS
vepatel Sep 16, 2022
488ce0c
run linter
vepatel Sep 16, 2022
a3ba316
Merge branch 'main' into feat/transport-server-external-name
jjngx Sep 19, 2022
c95564c
Update TS docs for ExternalName and ConfigMaps
jjngx Sep 19, 2022
3961ab3
Merge branch 'main' into feat/transport-server-external-name
jjngx Sep 19, 2022
3ffed47
Merge branch 'main' into feat/transport-server-external-name
jjngx Sep 21, 2022
5bb47cc
Add a readme for TS example
jjngx Sep 21, 2022
21e980e
Update example docs
jjngx Sep 22, 2022
12eaae4
Merge branch 'main' into feat/transport-server-external-name
jjngx Sep 22, 2022
41be7fc
Increase test coverage
jjngx Sep 22, 2022
2fff1fe
Merge branch 'main' into feat/transport-server-external-name
jjngx Sep 22, 2022
8a3ab16
Update README for TS ExternalName
jjngx Sep 22, 2022
e49d503
Move files for TransportServer example to one folder
jjngx Sep 23, 2022
dc79c99
Merge branch 'main' into feat/transport-server-external-name
jjngx Sep 23, 2022
4bc26c9
Fix error handling, update docs
jjngx Sep 23, 2022
0186b91
Make linter happy again
jjngx Sep 23, 2022
b3736b0
Update TS ExternalName example
jjngx Sep 26, 2022
83bd49e
Merge branch 'main' into feat/transport-server-external-name
jjngx Sep 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/content/configuration/transportserver-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,4 +372,4 @@ Note how the events section includes a Warning event with the Rejected reason.

## Customization via ConfigMap

The [ConfigMap](/nginx-ingress-controller/configuration/global-configuration/configmap-resource) keys (except for `stream-snippets` and `stream-log-format`) do not affect TransportServer resources.
The [ConfigMap](/nginx-ingress-controller/configuration/global-configuration/configmap-resource) keys (except for `stream-snippets`, `stream-log-format`, `resolver-addresses`, `resolver-ipv6`, `resolver-valid` and `resolver-timeout`) do not affect TransportServer resources.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Service
apiVersion: v1
metadata:
name: externalname-service
spec:
type: ExternalName
externalName: external-backend-svc.external-ns.svc.cluster.local
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example isn't working - the externalName entry needs to be changed to map to the name for the service defined in secure-app-external.yaml

Suggested change
externalName: external-backend-svc.external-ns.svc.cluster.local
externalName: secure-app-external-backend-svc.external-ns.svc.cluster.local

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry - I realise now that updating this is called out in the README. Again I think this is confusing and we are better off duplicating the files with the correct service name in each (one for TS and one for VS); or just having the same service name for both of the external name services

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated and moved all yaml files required for this example to transport server folder.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-config
namespace: nginx-ingress
data:
resolver-addresses: "kube-dns.kube-system.svc.cluster.local"
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
apiVersion: v1
kind: Namespace
metadata:
name: external-ns
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: secure-app-external-backend
namespace: external-ns
spec:
replicas: 1
selector:
matchLabels:
app: secure-app-external-backend
template:
metadata:
labels:
app: secure-app-external-backend
spec:
containers:
- name: secure-app-external-backend
image: nginxdemos/nginx-hello:plain-text
ports:
- containerPort: 8443
volumeMounts:
- name: secret
mountPath: /etc/nginx/ssl
readOnly: true
- name: config-volume
mountPath: /etc/nginx/conf.d
volumes:
- name: secret
secret:
secretName: app-tls-secret
- name: config-volume
configMap:
name: secure-config
---
apiVersion: v1
kind: Service
metadata:
name: secure-app-external-backend-svc
namespace: external-ns
spec:
ports:
- port: 8443
targetPort: 8443
protocol: TCP
name: https
selector:
app: secure-app-external-backend
---
apiVersion: v1
kind: ConfigMap
metadata:
name: secure-config
namespace: external-ns
data:
app.conf: |-
server {
listen 8443 ssl;
listen [::]:8443 ssl;

server_name app.example.com;

ssl_certificate /etc/nginx/ssl/tls.crt;
ssl_certificate_key /etc/nginx/ssl/tls.key;

default_type text/plain;

location / {
return 200 "hello from pod $hostname\n";
}
}
---
apiVersion: v1
kind: Secret
metadata:
name: app-tls-secret
namespace: external-ns
data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURGRENDQWZ3Q0NRQ3EzQWxhdnJiaWpqQU5CZ2txaGtpRzl3MEJBUXNGQURCTU1Rc3dDUVlEVlFRR0V3SlYKVXpFTE1Ba0dBMVVFQ0F3Q1EwRXhGakFVQmdOVkJBY01EVk5oYmlCR2NtRnVZMmx6WTI4eEdEQVdCZ05WQkFNTQpEMkZ3Y0M1bGVHRnRjR3hsTG1OdmJUQWVGdzB5TURBek1qTXlNekl3TkROYUZ3MHlNekF6TWpNeU16SXdORE5hCk1Fd3hDekFKQmdOVkJBWVRBbFZUTVFzd0NRWURWUVFJREFKRFFURVdNQlFHQTFVRUJ3d05VMkZ1SUVaeVl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ZxZGI3SEJyakVSRkhFdzQ0Vkt2MVlxK0ZWYnNNN1FTQVZ1V1llcGxGQUpDYzcrSEt1YjRsa1hRM1RkCndSajJLK2pOUzJtUXp1Y2hOQnlBZ1hXVnYveHhMZEE3NnpuWmJYdjl5cXhnTVVjTVZwZGRuSkxVZm9QVVZ1dTcKS0tlVVU3TTNIblRKUStrcldtbUxraUlSCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: v1
jjngx marked this conversation as resolved.
Show resolved Hide resolved
kind: Namespace
metadata:
name: external-ns
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: external-backend
namespace: external-ns
spec:
replicas: 1
selector:
matchLabels:
app: external-backend
template:
metadata:
labels:
app: external-backend
spec:
containers:
- name: external-backend
image: nginxdemos/nginx-hello:plain-text
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: external-backend-svc
namespace: external-ns
spec:
ports:
- port: 80
targetPort: 8080
protocol: TCP
name: http
selector:
app: external-backend
70 changes: 33 additions & 37 deletions internal/configs/configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,29 +573,25 @@ func (cnf *Configurator) deleteTransportServerMetricsLabels(key string) {

// AddOrUpdateTransportServer adds or updates NGINX configuration for the TransportServer resource.
// It is a responsibility of the caller to check that the TransportServer references an existing listener.
func (cnf *Configurator) AddOrUpdateTransportServer(transportServerEx *TransportServerEx) error {
err := cnf.addOrUpdateTransportServer(transportServerEx)
func (cnf *Configurator) AddOrUpdateTransportServer(transportServerEx *TransportServerEx) (Warnings, error) {
warnings, err := cnf.addOrUpdateTransportServer(transportServerEx)
if err != nil {
return fmt.Errorf("Error adding or updating TransportServer %v/%v: %w", transportServerEx.TransportServer.Namespace, transportServerEx.TransportServer.Name, err)
return warnings, fmt.Errorf("error adding or updating TransportServer %v/%v: %w", transportServerEx.TransportServer.Namespace, transportServerEx.TransportServer.Name, err)
}

if err := cnf.reload(nginx.ReloadForOtherUpdate); err != nil {
return fmt.Errorf("Error reloading NGINX for TransportServer %v/%v: %w", transportServerEx.TransportServer.Namespace, transportServerEx.TransportServer.Name, err)
return warnings, fmt.Errorf("error reloading NGINX for TransportServer %v/%v: %w", transportServerEx.TransportServer.Namespace, transportServerEx.TransportServer.Name, err)
}

return nil
return warnings, nil
}

func (cnf *Configurator) addOrUpdateTransportServer(transportServerEx *TransportServerEx) error {
func (cnf *Configurator) addOrUpdateTransportServer(transportServerEx *TransportServerEx) (Warnings, error) {
name := getFileNameForTransportServer(transportServerEx.TransportServer)

tsCfg := generateTransportServerConfig(transportServerEx, transportServerEx.ListenerPort, cnf.isPlus)
tsCfg, warnings := generateTransportServerConfig(transportServerEx, transportServerEx.ListenerPort, cnf.isPlus, cnf.IsResolverConfigured())

content, err := cnf.templateExecutorV2.ExecuteTransportServerTemplate(tsCfg)
if err != nil {
return fmt.Errorf("Error generating TransportServer config %v: %w", name, err)
return warnings, fmt.Errorf("error generating TransportServer config %v: %w", name, err)
}

if cnf.isPlus && cnf.isPrometheusEnabled {
cnf.updateTransportServerMetricsLabels(transportServerEx, tsCfg.Upstreams)
}
Expand All @@ -610,11 +606,9 @@ func (cnf *Configurator) addOrUpdateTransportServer(transportServerEx *Transport
Host: transportServerEx.TransportServer.Spec.Host,
UnixSocket: generateUnixSocket(transportServerEx),
}

return cnf.updateTLSPassthroughHostsConfig()
return warnings, cnf.updateTLSPassthroughHostsConfig()
}

return nil
return warnings, nil
}

// GetVirtualServerRoutesForVirtualServer returns the virtualServerRoutes that a virtualServer
Expand Down Expand Up @@ -697,16 +691,16 @@ func (cnf *Configurator) AddOrUpdateResources(resources ExtendedResources) (Warn
}

for _, tsEx := range resources.TransportServerExes {
err := cnf.addOrUpdateTransportServer(tsEx)
warnings, err := cnf.addOrUpdateTransportServer(tsEx)
if err != nil {
return allWarnings, fmt.Errorf("Error adding or updating TransportServer %v/%v: %w", tsEx.TransportServer.Namespace, tsEx.TransportServer.Name, err)
return allWarnings, fmt.Errorf("error adding or updating TransportServer %v/%v: %w", tsEx.TransportServer.Namespace, tsEx.TransportServer.Name, err)
}
allWarnings.Add(warnings)
jjngx marked this conversation as resolved.
Show resolved Hide resolved
}

if err := cnf.reload(nginx.ReloadForOtherUpdate); err != nil {
return allWarnings, fmt.Errorf("Error when reloading NGINX when updating resources: %w", err)
}

return allWarnings, nil
}

Expand Down Expand Up @@ -939,11 +933,11 @@ func (cnf *Configurator) UpdateEndpointsForTransportServers(transportServerExes
reloadPlus := false

for _, tsEx := range transportServerExes {
err := cnf.addOrUpdateTransportServer(tsEx)
// Ignore warnings here as no new warnings should appear when updating Endpoints for TransportServers
_, err := cnf.addOrUpdateTransportServer(tsEx)
if err != nil {
return fmt.Errorf("Error adding or updating TransportServer %v/%v: %w", tsEx.TransportServer.Namespace, tsEx.TransportServer.Name, err)
jjngx marked this conversation as resolved.
Show resolved Hide resolved
return fmt.Errorf("error adding or updating TransportServer %v/%v: %w", tsEx.TransportServer.Namespace, tsEx.TransportServer.Name, err)
}

if cnf.isPlus {
err := cnf.updatePlusEndpointsForTransportServer(tsEx)
if err != nil {
Expand All @@ -957,11 +951,9 @@ func (cnf *Configurator) UpdateEndpointsForTransportServers(transportServerExes
glog.V(3).Info("No need to reload nginx")
return nil
}

if err := cnf.reload(nginx.ReloadForEndpointsUpdate); err != nil {
return fmt.Errorf("Error reloading NGINX when updating endpoints: %w", err)
return fmt.Errorf("error reloading NGINX when updating endpoints: %w", err)
}

return nil
}

Expand Down Expand Up @@ -1069,6 +1061,7 @@ func (cnf *Configurator) updateStreamServersInPlus(upstream string, servers []st
}

// UpdateConfig updates NGINX configuration parameters.
//
//gocyclo:ignore
func (cnf *Configurator) UpdateConfig(cfgParams *ConfigParams, resources ExtendedResources) (Warnings, error) {
cnf.cfgParams = cfgParams
Expand All @@ -1077,36 +1070,36 @@ func (cnf *Configurator) UpdateConfig(cfgParams *ConfigParams, resources Extende
if cnf.cfgParams.MainServerSSLDHParamFileContent != nil {
fileName, err := cnf.nginxManager.CreateDHParam(*cnf.cfgParams.MainServerSSLDHParamFileContent)
if err != nil {
return allWarnings, fmt.Errorf("Error when updating dhparams: %w", err)
return allWarnings, fmt.Errorf("error when updating dhparams: %w", err)
}
cfgParams.MainServerSSLDHParam = fileName
}

if cfgParams.MainTemplate != nil {
err := cnf.templateExecutor.UpdateMainTemplate(cfgParams.MainTemplate)
if err != nil {
return allWarnings, fmt.Errorf("Error when parsing the main template: %w", err)
return allWarnings, fmt.Errorf("error when parsing the main template: %w", err)
}
}

if cfgParams.IngressTemplate != nil {
err := cnf.templateExecutor.UpdateIngressTemplate(cfgParams.IngressTemplate)
if err != nil {
return allWarnings, fmt.Errorf("Error when parsing the ingress template: %w", err)
return allWarnings, fmt.Errorf("error when parsing the ingress template: %w", err)
}
}

if cfgParams.VirtualServerTemplate != nil {
err := cnf.templateExecutorV2.UpdateVirtualServerTemplate(cfgParams.VirtualServerTemplate)
if err != nil {
return allWarnings, fmt.Errorf("Error when parsing the VirtualServer template: %w", err)
return allWarnings, fmt.Errorf("error when parsing the VirtualServer template: %w", err)
}
}

mainCfg := GenerateNginxMainConfig(cnf.staticCfgParams, cfgParams)
mainCfgContent, err := cnf.templateExecutor.ExecuteMainConfigTemplate(mainCfg)
if err != nil {
return allWarnings, fmt.Errorf("Error when writing main Config")
return allWarnings, fmt.Errorf("error when writing main Config")
}
cnf.nginxManager.CreateMainConfig(mainCfgContent)

Expand All @@ -1132,20 +1125,23 @@ func (cnf *Configurator) UpdateConfig(cfgParams *ConfigParams, resources Extende
allWarnings.Add(warnings)
}

// we don't need to regenerate config for TransportServers, because:
// (1) Changes to the ConfigMap don't affect TransportServer configs directly
// (2) addOrUpdateTransportServer doesn't return any warnings that we need to propagate to the caller.
// if (1) and (2) is no longer the case, we need to generate the config for TransportServers
for _, tsEx := range resources.TransportServerExes {
warnings, err := cnf.addOrUpdateTransportServer(tsEx)
if err != nil {
return allWarnings, err
jjngx marked this conversation as resolved.
Show resolved Hide resolved
}
allWarnings.Add(warnings)
jjngx marked this conversation as resolved.
Show resolved Hide resolved
}

if mainCfg.OpenTracingLoadModule {
if err := cnf.addOrUpdateOpenTracingTracerConfig(mainCfg.OpenTracingTracerConfig); err != nil {
return allWarnings, fmt.Errorf("Error when updating OpenTracing tracer config: %w", err)
return allWarnings, fmt.Errorf("error when updating OpenTracing tracer config: %w", err)
}
}

cnf.nginxManager.SetOpenTracing(mainCfg.OpenTracingLoadModule)
if err := cnf.reload(nginx.ReloadForOtherUpdate); err != nil {
return allWarnings, fmt.Errorf("Error when updating config from ConfigMap: %w", err)
return allWarnings, fmt.Errorf("error when updating config from ConfigMap: %w", err)
}

return allWarnings, nil
Expand All @@ -1154,7 +1150,7 @@ func (cnf *Configurator) UpdateConfig(cfgParams *ConfigParams, resources Extende
// UpdateTransportServers updates TransportServers.
func (cnf *Configurator) UpdateTransportServers(updatedTSExes []*TransportServerEx, deletedKeys []string) error {
for _, tsEx := range updatedTSExes {
err := cnf.addOrUpdateTransportServer(tsEx)
_, err := cnf.addOrUpdateTransportServer(tsEx)
jjngx marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return fmt.Errorf("Error adding or updating TransportServer %v/%v: %w", tsEx.TransportServer.Namespace, tsEx.TransportServer.Name, err)
}
Expand Down
Loading