8000 Add custom listener controls to VirtualServer by shaun-nx · Pull Request #4271 · nginx/kubernetes-ingress · GitHub
[go: up one dir, main page]

Skip to content

Conversation

shaun-nx
Copy link
Contributor
@shaun-nx shaun-nx commented Aug 21, 2023

Proposed changes

Related issue: #4094
Related discussion: #3724

This change updates both VirtualServer and GlobalConfiguration resources to enable VirtualServers to specify custom HTTP and HTTPS listener ports.

Example VirtualServer YAML:

apiVersion: k8s.nginx.org/v1
kind: VirtualServer
metadata:
  name: cafe
spec:
  listener:
    http: http-8083
    https: https-8443
  host: cafe.example.com
  tls:
    secret: cafe-secret
  upstreams:
  ...

Example GlobalConfiguration YAML:

apiVersion: k8s.nginx.org/v1alpha1
kind: GlobalConfiguration
metadata:
  name: nginx-configuration
  namespace: nginx-ingress
spec:
  listeners:
  - name: http-8083
    port: 8083
    protocol: HTTP
  - name: https-8443
    port: 8443
    protocol: HTTP
    ssl: true

When performing requests to the example VirtualServer, all HTTP based requests will use port 8083 and HTTPS based requests will use 8443.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

shaun-nx and others added 28 commits August 17, 2023 14:55
@github-actions github-actions bot added documentation Pull requests/issues for documentation enhancement Pull requests for new features/feature enhancements labels Aug 21, 2023
@github-actions github-actions bot added the helm_chart Pull requests that update the Helm Chart label Aug 21, 2023
@codecov
Copy link
codecov bot commented Aug 21, 2023

Codecov Report

Merging #4271 (772d3c6) into main (79a3eb9) will increase coverage by 0.19%.
The diff coverage is 70.00%.

@@            Coverage Diff             @@
##             main    #4271      +/-   ##
==========================================
+ Coverage   51.97%   52.17%   +0.19%     
==========================================
  Files          59       59              
  Lines       16762    16930     +168     
==========================================
+ Hits         8712     8833     +121     
- Misses       7753     7798      +45     
- Partials      297      299       +2     
Files Changed Coverage Δ
internal/configs/configurator.go 37.94% <0.00%> (-0.54%) ⬇️
internal/configs/version2/http.go 0.00% <ø> (ø)
internal/k8s/controller.go 12.00% <0.00%> (-0.11%) ⬇️
...g/apis/configuration/validation/transportserver.go 96.21% <ø> (-0.10%) ⬇️
internal/configs/virtualserver.go 94.57% <100.00%> (+0.02%) ⬆️
internal/k8s/configuration.go 95.76% <100.00%> (-0.04%) ⬇️
...is/configuration/validation/globalconfiguration.go 92.39% <100.00%> (+5.11%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@shaun-nx shaun-nx changed the title Feat/custom listeners Add custom listener controls to VirtualServer Aug 22, 2023
@shaun-nx shaun-nx marked this pull request as ready for review August 22, 2023 12:27
@shaun-nx shaun-nx requested a review from a team as a code owner August 22, 2023 12:27
@shaun-nx shaun-nx added this to the v3.3.0 milestone Aug 22, 2023
Copy link
Contributor
@jjngx jjngx left a comment

Choose a reason for hiding this comment

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

👍🏻 great stuff!

@shaun-nx shaun-nx requested a review from vepatel August 24, 2023 14:11
@shaun-nx shaun-nx merged commit 05ba01b into main Aug 24, 2023
@shaun-nx shaun-nx deleted the feat/custom-listeners 67E6 branch August 24, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests/issues for documentation enhancement Pull requests for new features/feature enhancements helm_chart Pull requests that update the Helm Chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0