Commit 0cb390e9 authored by Dmytro Bogatov's avatar Dmytro Bogatov 💕

Add RPS as parameter.

parent ffff102c
Pipeline #3239 passed with stage
in 3 seconds
......@@ -16,12 +16,14 @@ source .secret.sh
# $1 - URL
# $2 - name
# $3 - auth
# $4 - rps
#
generate-ingress () {
URL=$1
NAME=$2
AUTH=$3
RPS=$4
DIR=services/$NAME/ingress
......@@ -74,6 +76,7 @@ generate-ingress () {
sed -i -e "s#__AUTH__#$AUTH#g" $DIR/../ingress.yaml
sed -i -e "s#__NAME__#$NAME#g" $DIR/../ingress.yaml
sed -i -e "s#__RPS__#$RPS#g" $DIR/../ingress.yaml
sed -i -e '/^\s*$/d' $DIR/../ingress.yaml
......@@ -90,6 +93,7 @@ generate-service () {
image=$2
replicas=$REPLICAS
auth=""
rps="10"
echo "Generating $service configs..."
......@@ -103,6 +107,11 @@ generate-service () {
auth="nginx.ingress.kubernetes.io/auth-type: basic"
fi
if [ "$service" == "k8sapi-dbogatov-org" ]
then
rps="100"
fi
if [ "$service" == "moon-travel-com-ua" ]
then
URL="moon-travel.com.ua"
......@@ -131,7 +140,7 @@ generate-service () {
sed -i -e "s#__REPLICAS__#$replicas#g" services/$service/{service,deployment}.yaml
sed -i -e "s#__AUTH__#$auth#g" services/$service/{service,deployment}.yaml
generate-ingress "$URL" "$service" "$auth"
generate-ingress "$URL" "$service" "$auth" "$rps"
if [ "$service" == "shevastream-com" ]
then
......
#!/usr/bin/env bash
set -e
shopt -s expand_aliases
#!/usr/bin/env bash
source .secret.sh
K8STOKEN=$(curl -s https://$K8STOKEN@token.dbogatov.org | tr -d '[:space:]')
# KPARAMS="--insecure-skip-tls-verify=true --token=$K8STOKEN --server=https://k8sapi.dbogatov.org'"
alias kubectl='kubectl --insecure-skip-tls-verify=true --token=$K8STOKEN --server=https://k8sapi.dbogatov.org'
KUBECONFIG=""
kubectl cluster-info
......@@ -11,7 +11,7 @@ metadata:
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "route"
nginx.ingress.kubernetes.io/session-cookie-hash: "md5"
nginx.ingress.kubernetes.io/limit-rps: "10"
nginx.ingress.kubernetes.io/limit-rps: "__RPS__"
nginx.ingress.kubernetes.io/auth-secret: basic-auth
nginx.ingress.kubernetes.io/auth-realm: "Authentication Required!"
__AUTH__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment