Make calico/node resource requests dynamic based on cluster size

This commit is contained in:
Casey Davenport
2017-06-08 13:52:56 -07:00
parent 88d3245671
commit 83ec0d87ff
7 changed files with 62 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ Calico is an implementation of the Kubernetes network policy API. The provided
- A DaemonSet which runs Calico on each node in the cluster.
- A Deployment which installs the Calico Typha agent.
- A Service for the Calico Typha agent.
- A HorizontalPodAutoscaler to dynamically adjust the Typha Deployment.
### Learn More

View File

@@ -11,6 +11,8 @@ spec:
selector:
matchLabels:
k8s-app: calico-node
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
@@ -58,7 +60,7 @@ spec:
privileged: true
resources:
requests:
cpu: 250m
cpu: __CALICO_NODE_CPU__
volumeMounts:
- mountPath: /lib/modules
name: lib-modules

View File

@@ -0,0 +1,17 @@
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: calico-typha
namespace: kube-system
labels:
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
k8s-app: calico-typha
spec:
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: calico-typha
minReplicas: 1
maxReplicas: 20
targetCPUUtilizationPercentage: 75

View File

@@ -45,4 +45,4 @@ spec:
value: "kubernetes"
resources:
requests:
cpu: 1000m
cpu: 200m

View File

@@ -15,4 +15,3 @@ spec:
name: calico-typha
selector:
k8s-app: calico-typha