diff --git a/k8s/apps/README.md b/k8s/apps/README.md index 4c166f5..9ffacee 100644 --- a/k8s/apps/README.md +++ b/k8s/apps/README.md @@ -4,6 +4,12 @@ This directory contains Kubernetes manifests for auxiliary applications that sup ## Files +- `httpbin.yaml` - Go implementation of httpbin.org for testing HTTP requests and responses + - Based on the [go-httpbin](https://github.com/mccutchen/go-httpbin) project + - Includes readiness and liveness probes to ensure the application is healthy + - Provides various endpoints for testing different HTTP features (/get, /post, /status, etc.) + - Runs on port 8080 + - `k6.yaml` - k6 load testing tool configuration for performance testing - References the external script file `test-script.js` - When applying this manifest, use: `kubectl create configmap k6-test-script --from-file=test-script.js=./k8s/apps/test-script.js -n tools` diff --git a/k8s/apps/httpbin.yaml b/k8s/apps/httpbin.yaml new file mode 100644 index 0000000..cb078dc --- /dev/null +++ b/k8s/apps/httpbin.yaml @@ -0,0 +1,60 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: httpbin + namespace: tools + labels: + app: httpbin +spec: + replicas: 1 + selector: + matchLabels: + app: httpbin + template: + metadata: + labels: + app: httpbin + spec: + containers: + - name: httpbin + image: mccutchen/go-httpbin:2.18.3 + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /get + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 5 + timeoutSeconds: 2 + successThreshold: 1 + failureThreshold: 3 + livenessProbe: + httpGet: + path: /get + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 2 + successThreshold: 1 + failureThreshold: 3 + resources: + limits: + memory: "128Mi" + cpu: "100m" + requests: + memory: "64Mi" + cpu: "50m" +--- +apiVersion: v1 +kind: Service +metadata: + name: httpbin + namespace: tools +spec: + selector: + app: httpbin + ports: + - port: 8080 + targetPort: 8080 + type: ClusterIP \ No newline at end of file diff --git a/k8s/tyk-stack-ingress/run-tyk-cp-dp.sh b/k8s/tyk-stack-ingress/run-tyk-cp-dp.sh index 211701e..f6e54b4 100755 --- a/k8s/tyk-stack-ingress/run-tyk-cp-dp.sh +++ b/k8s/tyk-stack-ingress/run-tyk-cp-dp.sh @@ -405,6 +405,8 @@ done log "Creating $TOOLS_NAMESPACE namespace" kubectl create namespace "$TOOLS_NAMESPACE" 2> /dev/null || true +log "Installing httpbin app in $TOOLS_NAMESPACE namespace" +kubectl apply -f ../apps/httpbin.yaml log "Installing k6 load testing resources in $TOOLS_NAMESPACE namespace" kubectl create configmap k6-test-script --from-file=test-script.js=../apps/test-script.js \