Closed jpds closed 4 years ago
Can you please remove com.openfaas.scale.factor: "100"
and try without it? If you want to test auto scaling you should run a load test.
@stefanprodan Even without the factor
, I still only have one min pod.
Here's the Flux config I use to deploy openfaas:
---
apiVersion: flux.weave.works/v1beta1
kind: HelmRelease
metadata:
name: openfaas
namespace: openfaas
annotations:
flux.weave.works/automated: "true"
spec:
releaseName: openfaas
chart:
repository: https://openfaas.github.io/faas-netes/
name: openfaas
version: 1.8.1
values:
basic_auth: true
exposeServices: false
functionNamespace: "openfaas-fn"
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-body-size: 10m
nginx.ingress.kubernetes.io/proxy-connect-timeout: 60
nginx.ingress.kubernetes.io/proxy-send-timeout: 60
nginx.ingress.kubernetes.io/proxy-read-timeout: 60
nginx.ingress.kubernetes.io/ssl-redirect: "true"
certmanager.k8s.io/cluster-issuer: "letsencrypt-prod"
certmanager.k8s.io/acme-challenge-type: http01
hosts:
- host: fn.mydomain.io
path: /
serviceName: gateway
servicePort: 8080
tls:
- hosts:
- fn.mydomain.io
secretName: openfaas-tls
gateway:
replicas: 2
operator:
create: true
queueWorker:
replicas: 2
serviceType: ClusterIP
You are using an old chart version, the latest is 2.1.2
, try this:
chart:
repository: https://openfaas.github.io/faas-netes/
name: openfaas
version: 2.1.2
After the upgrade to 2.1.2 please delete the functions and redeploy them, just to start a fresh test.
@stefanprodan Thanks. I upgraded and redeployed the function with just the label: min: "3"
. I still only have one replica and logs of:
openfaas/gateway-58899f65bd-478zd[operator]: I0318 16:47:02.024766 1 controller.go:331] Creating deployment for 'my-function'
openfaas/gateway-58899f65bd-c5vt4[operator]: I0318 16:47:02.024621 1 controller.go:331] Creating deployment for 'my-function'
openfaas/gateway-58899f65bd-478zd[operator]: I0318 16:47:02.039694 1 controller.go:340] Creating ClusterIP service for 'my-function'
openfaas/gateway-58899f65bd-c5vt4[operator]: I0318 16:47:02.049003 1 controller.go:340] Creating ClusterIP service for 'my-function'
openfaas/gateway-58899f65bd-478zd[operator]: E0318 16:47:02.053761 1 controller.go:283] error syncing 'openfaas-fn/my-function': deployment.apps "my-function" not found
openfaas/gateway-58899f65bd-c5vt4[operator]: I0318 16:47:02.091877 1 controller.go:344] ClusterIP service 'my-function' already exists. Skipping creation.
openfaas/gateway-58899f65bd-c5vt4[operator]: E0318 16:47:02.091904 1 controller.go:283] error syncing 'openfaas-fn/my-function': deployment.apps "my-function" not found
....
openfaas/faas-idler-647969d86f-jgm4n[faas-idler]:
openfaas/faas-idler-647969d86f-jgm4n[faas-idler]: 2019/03/18 16:47:17 Skip: certinfo due to missing label
openfaas/faas-idler-647969d86f-jgm4n[faas-idler]: 2019/03/18 16:47:17 Skip: my-function due to missing label
Flux config for the function:
apiVersion: openfaas.com/v1alpha2
kind: Function
metadata:
name: my-function
namespace: openfaas-fn
spec:
name: my-function
image: my-ecr-url/my-function:master-githash
labels:
com.openfaas.scale.min: "4"
environment:
...
write_debug: "true"
requests:
cpu: "10m"
memory: "64Mi"
Ok I've checked the operator code and looks like the min replica is missing from the CRD loop. Please open an issue in here https://github.com/openfaas-incubator/openfaas-operator
As a workaround you can set the min replicas like this
apiVersion: openfaas.com/v1alpha2
kind: Function
metadata:
name: my-function
namespace: openfaas-fn
spec:
replicas: 4
Filed https://github.com/openfaas-incubator/openfaas-operator/issues/74 - and thank you very much for the replicas:
workaround @stefanprodan!
/close
/lock: closing as inactive. Feel free to raise a new issue if this is still required
Expected Behaviour
I'm configuring a function with:
However, I never see this run with more than one replica, even when setting the factor to 100 as I have. My logs are read:
I do not know what this missing label is.
Your Environment
faas-cli version
): 0.8.3kubectl version