Skip to content
Snippets Groups Projects
Commit 03616ca8 authored by Alex Ellis (OpenFaaS Ltd)'s avatar Alex Ellis (OpenFaaS Ltd)
Browse files

Enable autoscaler by default for openfaasPro users

parent de3c5242
No related branches found
No related tags found
No related merge requests found
......@@ -48,13 +48,15 @@ Get it from arkade:
arkade get helm
```
Or use the helm3 installer:
Or use the Helm installation script:
```bash
curl -sSLf https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
```
We recommend creating two namespaces, one for the OpenFaaS *core services* and one for the *functions*:
We recommend creating two namespaces, one for the OpenFaaS *core services* and one for the *functions*.
You can skip this step if you're using arkade to install OpenFaaS.
```sh
kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml
......@@ -70,19 +72,17 @@ helm repo add openfaas https://openfaas.github.io/faas-netes/
Now decide how you want to expose the services and edit the `helm upgrade` command as required.
* To use NodePorts (default) pass no additional flags
* To use a LoadBalancer add `--set serviceType=LoadBalancer`
* To use an IngressController add `--set ingress.enabled=true`
> Note: even without a LoadBalancer or IngressController you can access your gateway at any time via `kubectl port-forward`.
* To use NodePorts/ClusterIP - (the default and best for development, with port-forwarding)
* To use an IngressController add `--set ingress.enabled=true` (recommended for production, for use with TLS)
* To use a LoadBalancer add `--set serviceType=LoadBalancer` (not recommended, since it will expose plain HTTP)
## Deploy OpenFaaS Community Edition
## Deploy OpenFaaS Community Edition (CE)
> The Community Edition is meant for open source developers
> OpenFaaS Community Edition is meant exploration and development.
>
> OpenFaaS Pro has been tuned for production use including flexible auto-scaling, high-available deployments, durability, add-on features, and more.
> OpenFaaS Pro customers should read on to the next section for production deployments.
Now deploy OpenFaaS from the helm chart repo:
Deploy CE from the helm chart repo directly:
```sh
helm repo update \
......@@ -101,9 +101,11 @@ PASSWORD=$(kubectl -n openfaas get secret basic-auth -o jsonpath="{.data.basic-a
echo "OpenFaaS admin password: $PASSWORD"
```
## Deploy as an OpenFaaS Pro customer
It is not recommended to disable basic authentication.
## Deploy OpenFaaS Pro
* Create the required secret with your [OpenFaaS Pro license](https://www.openfaas.com/support/):
* Create the required secret with your [OpenFaaS Pro license](https://www.openfaas.com/pricing/):
```bash
kubectl create secret generic \
......@@ -502,7 +504,7 @@ yaml) |
| Parameter | Description | Default |
| ----------------------- | ---------------------------------- | ---------------------------------------------------------- |
| `autoscaler.disableHorizontalScaling` | Set to true, to only scale to zero, without scaling replicas between the defined Min and Max count for the function | `false` |
| `autoscaler.enabled ` | Enable the autoscaler | `false` |
| `autoscaler.enabled ` | Enable the autoscaler - if openfaasPro is set to true | `true` |
| `autoscaler.image` | Container image used for the autoscaler | See [values.yaml](./values.yaml) |
| `autoscaler.replicas` | Replicas of the autoscaler | `1` |
| `autoscaler.resources` | Resource limits and requests for the autoscaler pods | See [values.yaml](./values.yaml) |
......
{{- if .Values.openfaasPro }}
{{- if .Values.autoscaler.enabled }}
apiVersion: apps/v1
kind: Deployment
......@@ -28,29 +29,21 @@ spec:
secret:
secretName: basic-auth
{{- end }}
{{- if .Values.autoscaler.enabled }}
- name: license
secret:
secretName: openfaas-license
{{- end }}
containers:
- name: autoscaler
resources:
{{- .Values.autoscaler.resources | toYaml | nindent 12 }}
{{- if .Values.autoscaler.enabled }}
image: {{ .Values.autoscaler.image }}
{{- else }}
image: {{ .Values.autoscaler.image }}
{{- end }}
imagePullPolicy: {{ .Values.openfaasImagePullPolicy }}
{{- if .Values.autoscaler.enabled }}
command:
- "/usr/bin/autoscaler"
- "-license-file=/var/secrets/license/license"
{{- if eq (or .Values.autoscaler.disableHorizontalScaling false) true }}
- "-horizontal-scaling=false"
{{- end }}
{{- end }}
env:
- name: gateway_url
value: "http://gateway.{{ .Release.Namespace }}:8080/"
......@@ -64,11 +57,9 @@ spec:
- name: basic_auth
value: "{{ .Values.basic_auth }}"
volumeMounts:
{{- if .Values.autoscaler.enabled }}
- name: license
readOnly: true
mountPath: "/var/secrets/license"
{{- end }}
- name: auth
readOnly: true
mountPath: "/var/secrets/autoscaler"
......@@ -86,3 +77,4 @@ spec:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}
{{- end }}
......@@ -4,12 +4,18 @@
# Initial configuration to set Pro configurations on
openfaasPro: true
# The operator mode supports the Function CustomResource
# which enables tooling like ArgoCD / Flux v2
# Recommended operating mode for the OpenFaaS controller aka "faas-netes"
# is operator mode, including a CustomResource for functions.
#
# The operator mode is required for GitOps tooling like ArgoCD / Flux v2
# and to export existing functions for backup purposes.
operator:
create: true
# Do not turn off, enables authentication on all core components
# Enable authentication on all OpenFaaS core components.
# You must not turn off basicAuth, however, you can pre-create the
# secret, if you're using a GitOps tool to create a stable secret
# before installing OpenFaaS Pro via this chart
generateBasicAuth: true
# Follow docs at: https://docs.openfaas.com/openfaas-pro/dashboard/
......@@ -18,8 +24,9 @@ dashboard:
publicURL: localhost
enabled: true
# The autoscaler is enabled by default
# Learn more:
# https://docs.openfaas.com/architecture/autoscaling/
# The autoscaler is not enabled by default, but should be enabled here
autoscaler:
enabled: true
......
......@@ -40,7 +40,7 @@ openfaasImagePullPolicy: "Always"
autoscaler:
image: ghcr.io/openfaasltd/autoscaler:0.2.7
replicas: 1
enabled: false
enabled: true
resources:
requests:
memory: "128Mi"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment