Skip to content

Set up your VM as a data service location#

In this article, you will learn how easy it is to deploy data applications on your Linux (ubuntu) VM. We will create a SeekTable data service on your local workstation and connect to it locally.

Brief summary#

Here is a summary of the steps you will need to follow. Firstly, install the prerequisite software if not present then we create a kubernetes cluster and set it up as an Ametnes Data Service location and then finally, we create a simple SeekTable service.

Signup#

If you do not have an Ametnes Cloud account, sign up here to create one.

Setting up an Ametnes Data Services Location#

An Ametnes Application Location is basically a kubernetes cluster that is set up and connected to the Ametnes Cloud control plane. It will generally be a dedicated cluster but that is not mandatory.

Install Prerequisites.#

Depending on your operating system, the prerequisites to get you started will differ.

Setup docker#

setup-tools.sh
cat > setup-tools.sh<<EOF
# Install kind
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-amd64
chmod 755 ./kind && sudo mv ./kind /usr/local/bin/

# Install helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

# Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

# Setup docker
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" -y
sudo apt install docker-ce -y
sudo usermod -aG docker $USER
EOF

Run with

bash ./setup-tools.sh

Setup you application location#

Using kind with GPUs

If you have and would like to use GPUs on your VM, install kind with this

Script#

setup-location.sh
cat > setup-location.sh<<EOF
ip_address="\$1"
location_uuid="\$2"
version="v1.29.2@sha256:51a1434a5397193442f0be2a297b488b6c919ce8a3931be0ce822606ea5ca245"
cat > /tmp/kind.yml <<EOK
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
  image: "kindest/node:\${version}"
  kubeadmConfigPatches:
  - |
    kind: InitConfiguration
    nodeRegistration:
      kubeletExtraArgs:
        node-labels: "location.ametnes.io/platform=kind,location.ametnes.io/ipv4-address=\${ip_address}"
  extraPortMappings:
  - containerPort: 80
    hostPort: 80
    protocol: TCP
  - containerPort: 443
    hostPort: 443
    protocol: TCP

- role: worker
  image: "kindest/node:\${version}"
EOK
kind create cluster --config=/tmp/kind.yml
helm repo add ametnes https://ametnes.github.io/helm && helm repo update
helm upgrade --install --create-namespace --namespace ametnes-system ametnes-cloud-agent ametnes/cloud-agent --set agent.config.location="\${location_uuid}"
EOF

Location UUID#

In your Ametnes Cloud console account, get the default Application Location with

  1. Login into your Ametnes Cloud account here.
  2. Navigate to the Service Locations menu on the left
  3. Copy the default location's UUID

External IP address#

Identify your external IP address. If using an EC2 instance, this will be your public IP address if one exists.

Create the location cluster with#

bash ./setup-location.sh <your-external-ip-address> <location-uuid>

After a short while, the data service location should come online.

Create the service#

Log into your Ametnes Cloud console at here or sign up here if you do not have one.

  1. Using the Services left menu, navigate to the service management dashboard.
  2. Click New Service.
  3. Enter the SeekTable to filter from the list and select Create
  4. In the displayed form, enter the following info.
    1. Enter the Name: SeekTable-Service-DSL1 and Description: SeekTable-Service-DSL1.
    2. Select a Version from the list.
    3. Select the Location: Demo/DSL1.
    4. Click Create.

Test connectivity#

  1. Using the Services left menu, navigate to the service management dashboard. Your service should be listed.

    Service not showing

    If your service list is empty, use the filter at the top right corner, to filter for ALL services.

  2. After a while, your data service status will change to ready.

  3. To the right of your service, click the Admin button and you will navigate to your service's details page.
  4. At the bottom of the page, copy the endpoint of your service as well as your username/key and password.
  5. In your browser, paste the URL https://<your.instance.host.name>/.
  6. You should get a prompt to login.

Clean up#

Delete all services#

  1. In your Ametnes Cloud console, navigate to the Admin section of each service
  2. Delete the service.

Summary#

In this post, we explored how to set up your local workstation as an Ametnes Data Service location. This then allowed us to deploy a SeekTable service that we were able to connect to.