k8s-test

command module
v0.0.0-...-df91844 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2021 License: MIT Imports: 14 Imported by: 0

README

k8s-test

A simple application for testing a k8s environment.

Prepare

  1. Install ingress
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update

helm install -f helm/ingress/values.yaml ingress-nginx ingress-nginx/ingress-nginx
  1. Add repository bitnamy for postgres
helm repo add bitnami https://charts.bitnami.com/bitnami

Run application

Skaffold
skaffold run

Test

Get a public IP address from an admin console. For example, it's 89.22.183.246.

Add a public IP to /etc/hosts

echo "89.22.183.246 cluster-test" >> /etc/hosts

Check endpoints

curl http://cluster-test/
root handler

curl http://cluster-test/user/count
{count of user: 10000}

curl http://cluster-test/user/random
{"Id":2837,"Name":"fake-2836","Emails":["fake-master-2836@email.com","fake-slave-2836@email.com"]}

Run performance test

ab -n 1000 -c 5 http://cluster-test/user/random
for i in `seq 1 20`; do echo $i; ab -n 1000 -c 5 http://cluster-test/user/random ; done

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL