Skip to content

Commit

Permalink
feat(helm): bump minimum supported kubernetes version to 0.19 (#7925)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexledesma committed May 18, 2022
1 parent 205d811 commit fb025dc
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 167 deletions.
2 changes: 1 addition & 1 deletion helm/dagster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
name: dagster
version: 0.0.1-dev
kubeVersion: ">= 1.18.0-0"
kubeVersion: ">= 1.19.0-0"
description: The data orchestration platform built for productivity.
type: application
keywords:
Expand Down
2 changes: 1 addition & 1 deletion helm/dagster/charts/dagster-user-deployments/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v2
name: dagster-user-deployments
version: 0.0.1-dev
kubeVersion: ">= 1.18.0-0"
kubeVersion: ">= 1.19.0-0"
description: A chart to deploy code servers for your Dagster deployment.
type: application
keywords:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class FlowerIngressConfiguration(BaseModel):

class Ingress(BaseModel):
enabled: bool
apiVersion: Optional[str]
annotations: kubernetes.Annotations
dagit: DagitIngressConfiguration
readOnlyDagit: DagitIngressConfiguration
Expand Down
67 changes: 8 additions & 59 deletions helm/dagster/schema/schema_tests/test_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,20 @@
from schema.utils.helm_template import HelmTemplate


@pytest.fixture(name="template_function")
def helm_template_function():
return lambda output, model: HelmTemplate(
@pytest.fixture(name="template")
def helm_template() -> HelmTemplate:
return HelmTemplate(
helm_dir_path="helm/dagster",
subchart_paths=["charts/dagster-user-deployments"],
output=output,
model=model,
output="templates/ingress.yaml",
model=models.V1Ingress,
)


@pytest.mark.parametrize(
argnames=["output", "model", "api_version"],
argvalues=[
(
"templates/ingress-v1beta1.yaml",
models.ExtensionsV1beta1Ingress,
"extensions/v1beta1/Ingress",
),
(
"templates/ingress.yaml",
models.V1Ingress,
"networking.k8s.io/v1/Ingress",
),
],
)
def test_ingress(template_function, output, model, api_version):
template = template_function(output, model)
def test_ingress(template):
helm_values = DagsterHelmValues.construct(
ingress=Ingress.construct(
enabled=True,
apiVersion=api_version,
dagit=DagitIngressConfiguration.construct(
host="foobar.com",
path="bing",
Expand All @@ -70,27 +53,10 @@ def test_ingress(template_function, output, model, api_version):
assert rule.host == "foobar.com"


@pytest.mark.parametrize(
argnames=["output", "model", "api_version"],
argvalues=[
(
"templates/ingress-v1beta1.yaml",
models.ExtensionsV1beta1Ingress,
"extensions/v1beta1/Ingress",
),
(
"templates/ingress.yaml",
models.V1Ingress,
"networking.k8s.io/v1/Ingress",
),
],
)
def test_ingress_read_only(template_function, output, model, api_version):
template = template_function(output, model)
def test_ingress_read_only(template):
helm_values = DagsterHelmValues.construct(
ingress=Ingress.construct(
enabled=True,
apiVersion=api_version,
dagit=DagitIngressConfiguration.construct(
host="foobar.com",
path="bing",
Expand Down Expand Up @@ -127,23 +93,7 @@ def test_ingress_read_only(template_function, output, model, api_version):
assert [rule.host for rule in ingress.spec.rules] == ["foobar.com", "dagster.io"]


@pytest.mark.parametrize(
argnames=["output", "model", "api_version"],
argvalues=[
(
"templates/ingress-v1beta1.yaml",
models.ExtensionsV1beta1Ingress,
"extensions/v1beta1/Ingress",
),
(
"templates/ingress.yaml",
models.V1Ingress,
"networking.k8s.io/v1/Ingress",
),
],
)
def test_ingress_tls(template_function, output, model, api_version):
template = template_function(output, model)
def test_ingress_tls(template):
dagit_host = "dagit.com"
dagit_readonly_host = "dagit-readonly.com"
flower_host = "flower.com"
Expand All @@ -155,7 +105,6 @@ def test_ingress_tls(template_function, output, model, api_version):
helm_values = DagsterHelmValues.construct(
ingress=Ingress.construct(
enabled=True,
apiVersion=api_version,
dagit=DagitIngressConfiguration.construct(
host=dagit_host,
pathType=IngressPathType.IMPLEMENTATION_SPECIFIC,
Expand Down
3 changes: 1 addition & 2 deletions helm/dagster/schema/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
install_requires=["click", "pydantic"],
extras_require={
"test": [
# remove pin once minimum supported kubernetes version is 1.19
"kubernetes<22.6.0"
"kubernetes",
]
},
entry_points={
Expand Down
95 changes: 0 additions & 95 deletions helm/dagster/templates/ingress-v1beta1.yaml

This file was deleted.

5 changes: 1 addition & 4 deletions helm/dagster/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{{- $apiVersion := .Values.ingress.apiVersion | default "" }}
{{- $hasApiVersion := (.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress") }}
{{- $hasOverrideApiVersion := eq $apiVersion "networking.k8s.io/v1/Ingress" }}
{{- if and (.Values.ingress.enabled) (or $hasApiVersion $hasOverrideApiVersion) }}
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand Down
4 changes: 0 additions & 4 deletions helm/dagster/values.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fb025dc

Please sign in to comment.