diff --git a/scale-to-zero-with-keda/README.md b/scale-to-zero-with-keda/README.md index f770eca8..813437bb 100644 --- a/scale-to-zero-with-keda/README.md +++ b/scale-to-zero-with-keda/README.md @@ -34,6 +34,8 @@ Make sure Istio sidecar injection is enabled in the target Namespace: kubectl label namespace default istio-injection=enabled ``` +Edit `k8s-resources/scalable-worker-fn.yml` and `k8s-resources/peer-authentication.yaml` files to fill in the namespace value (namespace where prometheus was deployed). + Apply the example resources from `./k8s-resources` directory: ```bash kubectl apply -f ./k8s-resources diff --git a/scale-to-zero-with-keda/k8s-resources/peer-authentication.yaml b/scale-to-zero-with-keda/k8s-resources/peer-authentication.yaml new file mode 100644 index 00000000..dbf0ac89 --- /dev/null +++ b/scale-to-zero-with-keda/k8s-resources/peer-authentication.yaml @@ -0,0 +1,8 @@ +apiVersion: security.istio.io/v1beta1 +kind: PeerAuthentication +metadata: + name: default + namespace: {prometheus-namespace} +spec: + mtls: + mode: PERMISSIVE \ No newline at end of file diff --git a/scale-to-zero-with-keda/k8s-resources/scalable-worker-fn.yml b/scale-to-zero-with-keda/k8s-resources/scalable-worker-fn.yml index 85911ccc..3c26f981 100644 --- a/scale-to-zero-with-keda/k8s-resources/scalable-worker-fn.yml +++ b/scale-to-zero-with-keda/k8s-resources/scalable-worker-fn.yml @@ -37,7 +37,7 @@ spec: triggers: - type: prometheus metadata: - serverAddress: http://prometheus-operated.kyma-system.svc.cluster.local:9090 + serverAddress: http://prometheus-operated.{prometheus-namespace}.svc.cluster.local:9090 query: sum(rate(istio_requests_total{destination_service="scalable-worker-fn.default.svc.cluster.local",reporter="source"}[1m])) threshold: '2'