deploy CLI command. It currently only supports deploying to Kubernetes on managed cloud services. You can check the overview page to learn other options that you have.
Before we begin, it will help to understand the architecture around the ZenML server and the database that it uses. Now, depending on your setup, you may find one of the following scenarios relevant.
Option 1: Starting from scratch
If you don’t have an existing Kubernetes cluster, you have the following two options to set it up:- Creating it manually using the documentation for your cloud provider. For convenience, here are links for AWS, Azure and GCP.
- Using a stack recipe that sets up a cluster along with other tools that you might need in your cloud stack like artifact stores, and secret managers. Take a look at all available stack recipes to see if there’s something that works for you.
Once you have created your cluster, make sure that you configure your
kubectl client to talk to
it. If you have used stack recipes, this step is already done for you!
To be able to run the deploy command, you should have your cloud provider’s
CLI configured locally with permissions to create resources like MySQL
databases and networks.
Option 2: Using existing cloud resources
Existing Kubernetes Cluster
If you already have an existing cluster without an ingress controller, you can jump straight to thedeploy command above to get going with the defaults. Please make sure you have your local kubectl configured to talk to your cluster.
Having an existing NGINX Ingress Controller
The deploy command, by default, tries to create an NGINX ingress controller on your cluster. If you already have an existing controller, you can tell ZenML to not re-deploy it through the use of a config file. This file can be found in the Configuration File Templates towards the end of this guide. It offers a host of configuration options that you can leverage for advanced use cases.
-
Check if an ingress controller is running on your cluster by running the following command. You should see an entry in the output with the hostname populated.
-
Set
create_ingress_controllertofalse. -
Supply your controller’s hostname to the
ingress_controller_hostnamevariable.The address should not have a trailing/. -
You can now run the
deploycommand and pass the config file above, to it.To be able to run the deploy command, you should have your cloud provider’s CLI configured locally with permissions to create resources like MySQL databases and networks.
Existing Hosted SQL Database
If you also already have a database that you would want to use with the deployment, you can choose to configure it with the use of the config file. Here we will demonstrate setting the database.-
Fill the fields below from the config file with values from your database.
-
Run the
deploycommand and pass the config file above to it.To be able to run the deploy command, you should have your cloud provider’s CLI configured locally with permissions to create resources like MySQL databases and networks.
Configuration File Templates
Base Config File
This is the general structure of a config file. Use this as a base and then add any cloud-specific parameters from the sections below.Feel free to include only those variables that you want to customize, in your
file. For all other variables, the defaults (specified in square brackets)
would be used.
General
General
Cloud specific settings
- AWS
- GCP
- Azure
database_username and database_password from the general config is used to set those variables for the AWS RDS instance.Connecting to deployed ZenML
Once ZenML is deployed, one or multiple users can connect to with thezenml connect command. If no arguments are supplied, ZenML will attempt to connect to the last ZenML server deployed from the local host using the zenml deploy command: