Skip to content

Commit

Permalink
Chart: Fix network policy issue for webserver and flowerui (#20199)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgvishnuram authored Dec 29, 2021
1 parent a082123 commit 939724b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
5 changes: 5 additions & 0 deletions chart/UPDATING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ The default Airflow image that is used with the Chart is now ``2.2.3``, previous

The old parameter names will continue to work, however support for them will be removed in a future release so please update your values file.

Changes in webserver and flower ``NetworkPolicy`` default ports
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

The defaults for ``webserver.networkPolicy.ingress.ports`` and ``flower.networkPolicy.ingress.ports`` moved away from using named ports to numerical ports to avoid issues with OpenShift.

Airflow Helm Chart 1.3.0
------------------------

Expand Down
6 changes: 1 addition & 5 deletions chart/tests/test_flower.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,11 @@ def test_defaults(self):
assert [{"namespaceSelector": {"matchLabels": {"release": "myrelease"}}}] == jmespath.search(
"spec.ingress[0].from", docs[0]
)
assert [{"port": "flower-ui"}] == jmespath.search("spec.ingress[0].ports", docs[0])
assert [{"port": 5555}] == jmespath.search("spec.ingress[0].ports", docs[0])

@pytest.mark.parametrize(
"ports, expected_ports",
[
(
[{"protocol": "UDP", "port": "{{ .Values.ports.flowerUI }}"}],
[{"protocol": "UDP", "port": 5555}],
),
([{"port": "sidecar"}], [{"port": "sidecar"}]),
(
[
Expand Down
6 changes: 1 addition & 5 deletions chart/tests/test_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,14 +595,10 @@ def test_defaults(self):
assert [{"namespaceSelector": {"matchLabels": {"release": "myrelease"}}}] == jmespath.search(
"spec.ingress[0].from", docs[0]
)
assert [{"port": "airflow-ui"}] == jmespath.search("spec.ingress[0].ports", docs[0])
assert [{"port": 8080}] == jmespath.search("spec.ingress[0].ports", docs[0])

@parameterized.expand(
[
(
[{"protocol": "UDP", "port": "{{ .Values.ports.airflowUI }}"}],
[{"protocol": "UDP", "port": 8080}],
),
([{"port": "sidecar"}], [{"port": "sidecar"}]),
(
[
Expand Down
8 changes: 4 additions & 4 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2404,12 +2404,12 @@
},
"default": [
{
"port": "airflow-ui"
"port": "{{ .Values.ports.airflowUI }}"
}
],
"examples": [
{
"port": "sidecar"
"port": 8070
}
]
}
Expand Down Expand Up @@ -2725,12 +2725,12 @@
},
"default": [
{
"port": "flower-ui"
"port": "{{ .Values.ports.flowerUI }}"
}
],
"examples": [
{
"port": "sidecar"
"port": 5565
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ webserver:
from: []
# Ports for webserver NetworkPolicy ingress (if `from` is set)
ports:
- port: airflow-ui
- port: "{{ .Values.ports.airflowUI }}"

resources: {}
# limits:
Expand Down Expand Up @@ -982,7 +982,7 @@ flower:
from: []
# Ports for flower NetworkPolicy ingress (if ingressPeers is set)
ports:
- port: flower-ui
- port: "{{ .Values.ports.flowerUI }}"

resources: {}
# limits:
Expand Down

0 comments on commit 939724b

Please sign in to comment.