August 17, 2022

Running HarperDB in Kubernetes in one command

Welcome to Community Posts
Click below to read the full article.
Summary of What to Expect
Table of Contents
  1. Choose Cloud Provider: While the article uses Azure as an example, you can use any cloud provider of your choice.
  2. Install Helm, Azure CLI, and Kubectl: Head to the Helm website and install Helm binary, Azure CLI, and Kubectl binaries on your local machine.
  3. Verify Installation: Check that the installation was successful by running kubectl, az, and helm commands in your terminal.
  4. Log in to Azure: Use az login to log in to your Azure account.
  5. Create Resource Group: Create a resource group with the command az group create -n harperdb-helm.
  6. Create Kubernetes Cluster: Use az aks create -n harperdb-helm -g harperdb-helm --node-count 1 --generate-ssh-keys to create a Kubernetes cluster.
  7. Get Cluster Credentials: After cluster creation, run az aks get-credentials -n harperdb-helm -g harperdb-helm --admin to populate your kubeconfig file with cluster credentials.
  8. Verify Cluster: Check the cluster status by running kubectl get nodes. You should see a list with one node if everything is fine.
  9. Helm Charts: Helm organizes packages into charts, and they have a specific directory structure.
  10. Create a Chart: Use helm create harperdb to create a new chart with the necessary files and directories.
  11. Simplify the Chart Structure: Delete unnecessary files and directories within the chart, keeping only Chart.yaml, templates/, and values.yaml.
  12. Template Files: Create template files for Kubernetes resources (e.g., deployment, service, and persistent volume claim) within the templates/ directory.
  13. Apply Template Variables: Use Golang template functions (default, required, quote, and .Values) to apply variables and placeholders to the template files.
  14. Define Values: Customize the values.yaml file with default values for variables used in the templates.
  15. Render the Template: Verify the correctness of the templates by rendering them using the command helm template -n <namespace> --set <variable=value> harperdb.
  16. Install the Chart: If everything is correct, use helm install -n database --set <variable=value> harperdb to deploy the application to the Kubernetes cluster.
  17. Check and Remove the Release: To check the deployed application, run helm list -n database. To remove the release, use helm delete harperdb -n database.
  18. Access the Deployed Application: Refer to the previous article for instructions on accessing the deployed application, especially the "Accessing HarperDB" session.