Kubernetes

Deploy Sherlock Agent in Kubernetes

Learn how to deploy Datasherlock on a Kubernetes cluster seamlessly. Follow these steps to set up and configure Datasherlock for your Kubernetes environment

Setup Kubernetes

If you don't already have a Kubernetes cluster like EKS, GKE, or AKS, you can create one using Kind:

kind create cluster

Register Database Metadata with Datasherlocks

You can register your database's metadata with Datasherlocks. Below is an example configuration for MySQL:

type: "<DB_TYPE>"
database:
  host: "<DB_HOST>"
  username: "<DB_USERNAME>"
  port: "<DB_PORT>"
  database: "<DB_NAME>"
  ssl: "<DB_SSL>"

Use the following command to register an agent with the Datasherlocks cloud. It will provide you with a token and a remote link. Make sure to keep these credentials secure:

sherlock register --config config.yaml --name <AGENT_NAME>

Create values.yaml

config:
  type: "mysql"
  database:
    host: "YOUR_DB_HOST"
    username: "YOUR_DB_USER"
    port: "YOUR_DB_PORT"
    database: "YOUR_DB_NAME"
    ssl: false

Deploy a agent on production

Deploy the agent on production using Helm. First, add the Datasherlocks Helm repository:

helm repo add datasherlock https://datasherlocks.github.io/sherlock

Then, install the MySQL agent with the following command, providing the necessary parameters:

helm install mysql-agent datasherlock/sherlock -n agent --set tunnelToken=***** -f values.yaml --set db_password=**** --set apiKey=*****

SSO Config

Create values.yaml

config:
  type: "mysql"
  database:
    host: "YOUR_DB_HOST"
    username: "YOUR_DB_USER"
    port: "YOUR_DB_PORT"
    database: "YOUR_DB_NAME"
    ssl: false
  oauth:
    client_id: "client_id"
    scopes: ["openid", "profile", "email"]
    provider: "https://accounts.google.com"

Upgrade helm deployment

helm upgrade mysql-agent datasherlock/sherlock -n agent --set tunnelToken=***** -f values.yaml --set db_password=**** --set apiKey=***** --set clientSecret=****

Last updated