Skip to content

Instantly share code, notes, and snippets.

@mercul3s
Created March 12, 2019 20:56
Show Gist options
  • Save mercul3s/ac409afb841b0a4889629bbf97f61e4e to your computer and use it in GitHub Desktop.
Save mercul3s/ac409afb841b0a4889629bbf97f61e4e to your computer and use it in GitHub Desktop.
Template of a function deployment with a toleration
# Source: templates/deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: canary-deployment
namespace: openfaas-fn
labels:
app: openfaas-fn
helm.sh/chart: renderer-0.1.0
app.kubernetes.io/instance: renderer-canary
app.kubernetes.io/managed-by: Tiller
app.kubernetes.io/version: latest
spec:
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: canary-deployment
app.kubernetes.io/instance: canary-deployment
app: canary-deployment
controller: canary-deployment
template:
metadata:
labels:
app.kubernetes.io/name: canary-deployment
app.kubernetes.io/instance: canary-deployment
com.openfaas.scale.factor: "2"
com.openfaas.scale.max: "5"
com.openfaas.scale.min: "1"
app: canary-deployment
controller: canary-deployment
faas_function: canary-deployment
spec:
containers:
- name: canary-deployment
image: "example-image:latest"
imagePullPolicy: Always
env:
- name: debug
value: "true"
- name: output
value: verbose
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
exec:
command:
- cat
- /tmp/.lock
failureThreshold: 2
initialDelaySeconds: 3
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
exec:
command:
- cat
- /tmp/.lock
failureThreshold: 2
initialDelaySeconds: 3
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
{}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: dedicated
operator: In
values:
- preemptible-faas-pool
tolerations:
- effect: NoSchedule
key: dedicated
operator: Equal
value: preemptible-faas-pool
terminationGracePeriodSeconds: 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment