Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions src/_nebari/stages/kubernetes_daskgateway/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import contextlib
from typing import Any, Dict, List, Type

from _nebari.stages.base import NebariKustomizeStage
from nebari import schema
from nebari.hookspecs import NebariStage, hookimpl


class InputSchema(schema.Base):
pass


class OutputSchema(schema.Base):
pass


class DaskGatewayStage(NebariKustomizeStage):
name = "10-kubernetes-daskgateway"
priority = 100

input_schema = InputSchema
output_schema = OutputSchema

@property
def kustomize_vars(self):
return {
"namespace": self.config.namespace,
"daskgateway_helm_version": self.config.monitoring.healthchecks.daskgateway_helm_version,
}

@contextlib.contextmanager
def deploy(
self, stage_outputs: Dict[str, Dict[str, Any]], disable_prompt: bool = False
):
if self.config.monitoring.healthchecks.enabled:
with super().deploy(stage_outputs, disable_prompt):
yield
else:
with self.destroy(stage_outputs, {}):
yield


@hookimpl
def nebari_stage() -> List[Type[NebariStage]]:
return [DaskGatewayStage]
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

helmCharts:
- name: daskgateway
repo: https://helm.dask.org/
releaseName: daskgateway
namespace: {{ namespace }}
version: "{{ daskgateway_helm_version }}"
valuesFile: values.yaml
29 changes: 29 additions & 0 deletions src/_nebari/stages/kubernetes_daskgateway/template/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
metadata:
name: ${var.name}-daskgateway-gateway
namespace: var.namespace

spec:
replicas: 1
selector:
match_labels:
app.kubernetes.io/component: dask-gateway-gateway

template:
metadata:

labels:
app.kubernetes.io/component: dask-gateway-gateway

annotations:
checksum/config-map: sha256(jsonencode(kubernetes_config_map.gateway.data))
checksum/secret: sha256(jsonencode(kubernetes_secret.gateway.data))

spec:
affinity:
node_affinity:
required_during_scheduling_ignored_during_execution:
node_selector_term:
match_expressions:
key: var.general-node-group.key
operator: In
values: var.general-node-group.value