Snowflake Plugin#

This guide provides an overview of how to set up Snowflake in your Flyte deployment.

Spin up a cluster#

You can spin up a demo cluster using the following command:

flytectl demo start

Or install Flyte using the flyte-binary helm chart.

Note

Add the Flyte chart repo to Helm if you’re installing via the Helm charts.

helm repo add flyteorg https://flyteorg.github.io/flyte

Specify plugin configuration#

Enable the Snowflake plugin on the demo cluster by adding the following block to ~/.flyte/sandbox/config.yaml:

tasks:
  task-plugins:
    default-for-task-types:
      container: container
      container_array: k8s-array
      sidecar: sidecar
      snowflake: snowflake
    enabled-plugins:
      - container
      - k8s-array
      - sidecar
      - snowflake

Obtain and add the Snowflake JWT token#

Create a Snowflake account, and follow the Snowflake docs to generate a JWT token. Then, add the Snowflake JWT token to FlytePropeller.

Add the JWT token as an environment variable to the flyte-sandbox deployment.

kubectl edit deploy flyte-sandbox -n flyte

Update the env configuration:

env:
- name: POD_NAME
  valueFrom:
  fieldRef:
    apiVersion: v1
    fieldPath: metadata.name
- name: POD_NAMESPACE
  valueFrom:
  fieldRef:
    apiVersion: v1
    fieldPath: metadata.namespace
- name: FLYTE_SECRET_FLYTE_SNOWFLAKE_CLIENT_TOKEN
  value: <JWT_TOKEN>
image: flyte-binary:sandbox
...

Replace <JWT_TOKEN> with your JWT token.

Upgrade the deployment#

kubectl rollout restart deployment flyte-sandbox -n flyte

Wait for the upgrade to complete. You can check the status of the deployment pods by running the following command:

kubectl get pods -n flyte

For Snowflake plugin on the Flyte cluster, please refer to `Snowflake Plugin Example <https://docs.flyte.org/en/latest/flytesnacks/examples/snowflake_plugin/snowflake.html>`_