Helm

Table of contents

  1. Repository
  2. Deploy
    1. Chart Values
  3. Ingress Controller
  4. Examples

Repository

This chart repository can be added to helm with

helm repo add ealenn https://ealenn.github.io/charts
helm repo update

More information on Artifact Hub

Deploy

helm upgrade -i ${name} ealenn/echo-server --namespace ${namespace} --force

Example: helm upgrade -i echo-server ealenn/echo-server --namespace echo-server --force

Chart Values

You can override values with example.values.yaml file

curl https://raw.githubusercontent.com/Ealenn/Echo-Server/master/docs/examples/echo.helm.yaml \
  --output ./example.values.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
replicaCount: 5

ingress:
  enabled: true
  hosts:
    - host: echo.cluster.local
      paths:
        - /
  annotations:
    kubernetes.io/ingress.class: nginx

  application:
    logs:
      ignore:
        ping: true
helm upgrade -i \
  -f ./example.values.yaml \
  echo-server ealenn/echo-server \
  --namespace echo-server \
  --force

Ingress Controller

You can use Nginx Ingress Controller for try Echo-Server with :

helm install stable/nginx-ingress --name nginx --namespace nginx

Examples

Custom responses

Query Header Content Conditions
?echo_code= X-ECHO-CODE HTTP code 200, 404 200 <= CODE <= 599
    404-401 or 200-500-301  
?echo_body= X-ECHO-BODY Body message  
?echo_env_body= X-ECHO-ENV-BODY The key of environment variable Enable environment true
?echo_header= X-ECHO-HEADER Response Header Lang: en-US Enable header true
?echo_time= X-ECHO-TIME Wait time in ms 0 <= TIME <= 60.000
?echo_file= X-ECHO-FILE Path of Directory or File Enable file true

You can change commands and conditions.

Custom HTTP Status Code

➜ curl -I --header 'X-ECHO-CODE: 404' echo.cluster.local
➜ curl -I echo.cluster.local/?echo_code=404

HTTP/1.1 404 Not Found
➜ curl -I --header 'X-ECHO-CODE: 404-300' echo.cluster.local
➜ curl -I echo.cluster.local/?echo_code=404-300

HTTP/1.1 404 Not Found
HTTP/1.1 300 Multiple Choices
for i in {1..10}do
➜    curl -I echo.cluster.local/?echo_code=200-400-500
➜ done

HTTP/1.1 500 Internal Server Error
HTTP/1.1 400 Bad Request
HTTP/1.1 200 OK
HTTP/1.1 500 Internal Server Error
HTTP/1.1 200 OK
HTTP/1.1 500 Internal Server Error

Custom Body

➜ curl --header 'X-ECHO-BODY: amazing' echo.cluster.local
➜ curl echo.cluster.local/?echo_body=amazing

"amazing"

Custom Body with environment variable value

➜ curl --header 'X-ECHO-ENV-BODY: HOSTNAME' echo.cluster.local
➜ curl echo.cluster.local/?echo_env_body=HOSTNAME

"c53a9ed79fa2"
for i in {1..10}do
➜    curl echo.cluster.local/?echo_env_body=HOSTNAME
➜ done

"c53a9ed79fa2"
"f10c3af61e40"
"c53a9ed79fa2"
"f10c3af61e40"
"c53a9ed79fa2"

Custom Headers

➜ curl --header 'X-ECHO-HEADER: One:1' echo.cluster.local
➜ curl echo.cluster.local/?echo_header=One:1

HTTP/1.1 200 OK
One: 1
➜ curl --header 'X-ECHO-HEADER: One:1, Two:2' echo.cluster.local
➜ curl "echo.cluster.local/?echo_header=One:1,%20Two:2"

HTTP/1.1 200 OK
One: 1
Two: 2

Custom response latency

➜ curl --header 'X-ECHO-TIME: 5000' echo.cluster.local
➜ curl "echo.cluster.local/?echo_time=5000"

⏳... 5000 ms

You can change default validations with

ENVIRONMENT CLI Default
CONTROLS__TIMES__MIN –controls:times:min 0
CONTROLS__TIMES__MAX –controls:times:max 60000

(Latency is defined in milliseconds)

File/Folder explorer

➜ curl --header 'X-ECHO-FILE: /' echo.cluster.local
➜ curl "echo.cluster.local/?echo_file=/"

["app", "bin", "etc", "usr", "var"]

Combine custom actions

➜ curl --header 'X-ECHO-CODE: 401' --header 'X-ECHO-BODY: Oups' echo.cluster.local
➜ curl "echo.cluster.local/?echo_body=Oups&echo_code=401"

HTTP/1.1 401 Unauthorized
"Oups"