Skip to content

Commit

Permalink
add intro and example project
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Aug 28, 2024
1 parent 1512f8f commit d2d2a98
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 39 deletions.
17 changes: 13 additions & 4 deletions docs/docs-beta/docs/guides/deployment/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ title: "Deploy to Kubernetes"
sidebar_position: 21
---

TODO - INTRODUCTION
Deploying Dagster to a Kubernetes cluster is a popular option for maintaining a production Dagster deployment. Dagster uses Helm, a package manager for Kubernetes applications, to help manage deploying Dagster to a Kubernetes cluster.

Dagster provides [Helm charts](https://github.com/dagster-io/dagster/tree/master/helm) for deploying Dagster that you can customize for your specific needs. For each Dagster coponent used by the Helm chart, Dagster publishes a corresponding image to [DockerHub](https://hub.docker.com/u/dagster).

Check failure on line 8 in docs/docs-beta/docs/guides/deployment/kubernetes.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Dagster.spelling] Is 'coponent' spelled correctly? Raw Output: {"message": "[Dagster.spelling] Is 'coponent' spelled correctly?", "location": {"path": "docs/docs-beta/docs/guides/deployment/kubernetes.md", "range": {"start": {"line": 8, "column": 175}}}, "severity": "ERROR"}

Check failure on line 8 in docs/docs-beta/docs/guides/deployment/kubernetes.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'coponent'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'coponent'?", "location": {"path": "docs/docs-beta/docs/guides/deployment/kubernetes.md", "range": {"start": {"line": 8, "column": 175}}}, "severity": "ERROR"}

## What you'll learn

- How to use Kubernetes and Helm to deploy Dagster
- How to get your Dagster project ready to deploy to your Kubernetes cluster
- How to build a Docker image containing your Dagster project to deploy to your cluster
- How to access and customize the Dagster-provided Helm charts
- How to apply the configuration in the Helm charts to your Kubernetes cluster to deploy your Dagster project
- How to connect to your deployed Dagster project

<details>
<summary>Prerequisites</summary>
Expand All @@ -17,11 +23,14 @@ To follow the steps in this guide, you'll need:
- Familiarity with [Docker](https://docs.docker.com/)
- Familiarity with [Kubernetes](https://kubernetes.io/docs/home/)
- Familiarity with [Helm](https://helm.sh/docs/)
- A Dagster project to deploy. You can also use the [example project](/todo). Would be great to have a command they can use to clone the project
- A Dagster project to deploy. You can also use the [example project](/todo). You can download the example project using the command:
```bash
dagster project from-example --example deploy_k8s_beta --name assets_dbt_python
```
- To have Docker installed. [Docker installation guide](https://docs.docker.com/engine/install/)
- To have `kubectl` installed. [Kubernetes installation guide](https://kubernetes.io/docs/tasks/tools/)
- To have a Kubernetes cluster created. If you would like to follow along with this guide on your local machine, you can install Docker Desktop and turn on the included Kubernetes server [Docker Desktop and Kubernetes guide](https://docs.docker.com/desktop/kubernetes/)
- Access to a Docker image registry, such as Amazon Web Services ECR or DockerHub
- Access to a Docker image registry, such as Amazon Web Services ECR or DockerHub. If you are following along to the guide on your local machine, you do not need access to a Docker image registry.

Check warning on line 33 in docs/docs-beta/docs/guides/deployment/kubernetes.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Dagster.acronyms] Spell out 'ECR', if it's unfamiliar to the audience. Raw Output: {"message": "[Dagster.acronyms] Spell out 'ECR', if it's unfamiliar to the audience.", "location": {"path": "docs/docs-beta/docs/guides/deployment/kubernetes.md", "range": {"start": {"line": 33, "column": 66}}}, "severity": "INFO"}

Check warning on line 33 in docs/docs-beta/docs/guides/deployment/kubernetes.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Dagster.contractions] Use 'don't' instead of 'do not'. Raw Output: {"message": "[Dagster.contractions] Use 'don't' instead of 'do not'.", "location": {"path": "docs/docs-beta/docs/guides/deployment/kubernetes.md", "range": {"start": {"line": 33, "column": 151}}}, "severity": "INFO"}
- To have Helm 3 installed. [Helm installation guide](https://helm.sh/docs/intro/install/)

</details>
Expand Down
21 changes: 0 additions & 21 deletions examples/deploy_k8s_beta/Dockerfile

This file was deleted.

14 changes: 0 additions & 14 deletions examples/deploy_k8s_beta/example_project/__init__.py

This file was deleted.

21 changes: 21 additions & 0 deletions examples/deploy_k8s_beta/iris_analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import dagster as dg
import pandas as pd


@dg.asset
def iris_dataset_size(context: dg.AssetExecutionContext) -> None:
df = pd.read_csv(
"https://docs.dagster.io/assets/iris.csv",
names=[
"sepal_length_cm",
"sepal_width_cm",
"petal_length_cm",
"petal_width_cm",
"species",
],
)

context.log.info(f"Loaded {df.shape[0]} data points.")


defs = dg.Definitions(assets=[iris_dataset_size])

0 comments on commit d2d2a98

Please sign in to comment.