# Hypertest Installation on Kubernetes

An up an running kubernetes cluster with a storage class for dynamic volumes is required. You can refer to Cluster Setup docs if you dont already have a K8s cluster running.

# Kubernetes Cluster Prerequisites

# Minimum Permissions

You need permissions for the following:

  1. create a new namespace
  2. crete a service accounts in that namespace.
  3. add/edit node labels
  4. add/edit ingress and storage classes
  5. deploy ingress controller in a new namespace
kubctl get svc
kubctl get nodes
kubctl get ns
# TODO: bash script for health checkup

# Storage class

Hypertest relies on dynamic volumes for running its stateful workloads. This is achieved by kubernetes storage classes for volume creation/mounting.

You should be see your available storage classes by running

kubectl get storageclasses

Note the provisioner from here and we'll create a new storage class using the same provisoner.

ht-storage-class.yml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: hypertest-storage-class
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
provisioner: <your_provisoner_name> #specify your provisioner name here. eg: microk8s.io/hostpath
allowVolumeExpansion: true # set this to true if your provisioner supports expanding volume, otherwise remove this
# Create a new file "ht-storage-class.yml" as shown above and deploy
kubectl apply -f ht-storage-class.yml

# Nginx Ingress controller

If not present already, deploy nginx ingress controller from here (opens new window)

Once deployed, you should be able to see it in your ingress classes

kubectl get ingressclasses

Note the controller from here and we'll create a new ingress class using the same controller.

ht-ingress-class.yml
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
  name: hypertest-ingress-class
spec:
  controller: k8s.io/ingress-nginx  #specify your controller name here. eg: k8s.io/ingress-nginx for nginx-ingress-controller https://kubernetes.github.io/ingress-nginx/
# Create a new file "ht-ingress-class.yml" as shown above and deploy
kubectl apply -f ht-ingress-class.yml

# Node labels and taints

Make sure nodes assigned to run hypertest workloads have the following labels and taints

### for master node
kubectl label nodes <node-name> hypertest_master_node=yes
### for worker nodes
kubectl label nodes <node-name> hypertest_worker_node=yes
### taints for both node types
kubectl taint nodes <node-name> hypertest_node=yes:NoExecute

Taints make sure other workloads are not scheduled on hypertest nodes. If nodes are tainted, you'd need at least 1 more node to run other kubernetes workloads.

Learn more about taints here (opens new window)

# Deploy hypertest controller-service

kubectl apply -f https://hypertest-binaries-1.s3.ap-south-1.amazonaws.com/deployments/0.13.31.json

Once deployed run the following checks

# check if the namespace "hypertest-ns" has been deployed
kubectl get ns

# Check pods in the ht-controller namespace
kubectl get pods -n hypertest-ns -w

# Check if the persistent volume claim is bound
kubectl get pvc -n hypertest-ns

# Check if the persistent volume is present and bound
kubectl get pv

# Setup wildcard DNS

# Get external address from ingress controller

kubectl get svc -n ingress-nginx

Above command provides external-ip from which dashboard would be accessed.

Copy the external-ip (this guide assumess the address to be my-address.elb.ap-south-1.amazonaws.com)

# Create a dns record

  • Create CNAME for domain
  • A record for IPv4
  • AAAA record for IPv6

Point *.hypertest.[your-domain] -> external-ip in your dns provider console (route53, godaddy etc)

eg: CNAME for *.hypertest.test-env.company.co.in -> my-address.elb.ap-south-1.amazonaws.com

# Dashboard Access

Hypertest central dashboard should be Accessible at http://central.hypertest.[your-domain]

  1. Set and verify base dns from dashboard
  2. Deploy a new hypertest instance from the central dashboard
  3. After new hypertest instance is deployed, you can go to service dashboard and configure instance dashboard for your service