Skip to content

Commit 224b154

Browse files
committed
feat: add ingressClassName support to Ingress
Signed-off-by: Ales Verbic <[email protected]>
1 parent f397acf commit 224b154

File tree

6 files changed

+45
-5
lines changed

6 files changed

+45
-5
lines changed

.github/workflows/pr.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
Run-CI-Script:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/setup-python@v2
10+
- uses: actions/setup-python@v5
1111
with:
12-
python-version: '3.8'
13-
- uses: actions/checkout@v2
12+
python-version: '3.10'
13+
- uses: actions/checkout@v4
1414
- run: scripts/ci.sh

deploy_config_generator/output/kube_ingress.py

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ class OutputPlugin(kube_common.OutputPlugin):
6363
type='dict',
6464
fields=copy.deepcopy(INGRESS_BACKEND_FIELD_SPEC),
6565
),
66+
ingress_class_name=dict(
67+
type='str',
68+
),
6669
rules=dict(
6770
type='list',
6871
subtype='dict',

docs/plugin_kube_ingress.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Name | Type | Required | Default | Description
2828
`spec . default_backend . service . port`|`dict`|no||
2929
`spec . default_backend . service . port . name`|`str`|no||
3030
`spec . default_backend . service . port . number`|`int`|no||
31+
`spec . ingress_class_name`|`str`|no||
3132
`spec . rules`|`list` (of `dict`)|no||
3233
`spec . rules . host`|`str`|no||
3334
`spec . rules . http`|`dict`|no||

tests/integration/kube_basic/deploy/config.yml

+16
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,22 @@ kube_ingresses:
153153
name: test
154154
port:
155155
number: 80
156+
- metadata:
157+
name: test-ingress-with-class-name
158+
annotations:
159+
nginx.ingress.kubernetes.io/rewrite-target: /
160+
spec:
161+
ingress_class_name: kong
162+
rules:
163+
- http:
164+
paths:
165+
- path: /testpath
166+
path_type: Prefix
167+
backend:
168+
service:
169+
name: test
170+
port:
171+
number: 80
156172

157173
kube_pvcs:
158174
- metadata:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
annotations:
5+
nginx.ingress.kubernetes.io/rewrite-target: /
6+
name: test-ingress-with-class-name
7+
spec:
8+
ingressClassName: kong
9+
rules:
10+
- http:
11+
paths:
12+
- backend:
13+
service:
14+
name: test
15+
port:
16+
number: 80
17+
path: /testpath
18+
pathType: Prefix

tox.ini

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ downloadcache = {toxworkdir}/cache/
33
envlist = py3
44

55
[testenv]
6-
deps = flake8
6+
deps =
7+
flake8
8+
pytest
79
commands =
810
flake8
9-
python setup.py test
11+
pytest tests
1012
python setup.py integration
1113

1214
[flake8]

0 commit comments

Comments
 (0)