-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add internal auth url support for astronomer components (#2066)
* add internal auth url support for astronomer components * update global values to support internal auth flag * add houston service port to internal auth url * update alertmanager ingress config * common template to call houston internal auth * fix pre-commit * update houston network policy * add basic tests * update houston config * fix houston configmap template * fix namespace in test cases
- Loading branch information
1 parent
464917c
commit 93d8cdc
Showing
10 changed files
with
83 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
tests/chart_tests/test_astronomer_houston_Internal_authorization.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import pytest | ||
|
||
from tests import supported_k8s_versions | ||
from tests.chart_tests.helm_template_generator import render_chart | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"kube_version", | ||
supported_k8s_versions, | ||
) | ||
class TestHoustonInternalAuthorization: | ||
def test_ingress_with_authorization_defaults(self, kube_version): | ||
"""Test Alertmanager Service with authSidecar.""" | ||
docs = render_chart( | ||
kube_version=kube_version, | ||
values={}, | ||
show_only=[ | ||
"charts/alertmanager/templates/ingress.yaml", | ||
"charts/grafana/templates/ingress.yaml", | ||
"charts/kibana/templates/ingress.yaml", | ||
"charts/prometheus/templates/ingress.yaml", | ||
], | ||
) | ||
|
||
assert len(docs) == 4 | ||
for doc in docs: | ||
assert doc["kind"] == "Ingress" | ||
assert doc["apiVersion"] == "networking.k8s.io/v1" | ||
assert ( | ||
"https://houston.example.com/v1/authorization" | ||
in doc["metadata"]["annotations"][ | ||
"nginx.ingress.kubernetes.io/auth-url" | ||
] | ||
) | ||
|
||
def test_ingress_with_internal_authorization(self, kube_version): | ||
"""Test Alertmanager Service with authSidecar.""" | ||
docs = render_chart( | ||
kube_version=kube_version, | ||
values={"global": {"enableHoustonInternalAuthorization": True}}, | ||
show_only=[ | ||
"charts/alertmanager/templates/ingress.yaml", | ||
"charts/grafana/templates/ingress.yaml", | ||
"charts/kibana/templates/ingress.yaml", | ||
"charts/prometheus/templates/ingress.yaml", | ||
], | ||
) | ||
|
||
assert len(docs) == 4 | ||
for doc in docs: | ||
assert doc["kind"] == "Ingress" | ||
assert doc["apiVersion"] == "networking.k8s.io/v1" | ||
assert ( | ||
"http://release-name-houston.default.svc.cluster.local:8871/v1/authorization" | ||
in doc["metadata"]["annotations"][ | ||
"nginx.ingress.kubernetes.io/auth-url" | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters