Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

v0.13.x-Reserve resources for calico typha (#1607) #1664

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions builtin/files/cluster.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,13 @@ kubernetes:
selfHosting:
type: canal # either "canal" or "flannel"
typha: false # enable for type 'canal' for 50+ node clusters
# typhaResources: # control k8s resources assigned to Typha pods
# requests:
# cpu: "100m"
# memory: "100Mi"
# limits:
# cpu: "250m"
# memory: "200Mi"
# calicoNodeImage:
# repo: quay.io/calico/node
# tag: v3.1.3
Expand Down
7 changes: 7 additions & 0 deletions builtin/files/userdata/cloud-config-controller
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,13 @@ write_files:
# value: "true"
#- name: TYPHA_PROMETHEUSMETRICSPORT
# value: "9093"
resources:
requests:
cpu: {{ .Kubernetes.Networking.SelfHosting.TyphaResources.Requests.Cpu }}
memory: {{ .Kubernetes.Networking.SelfHosting.TyphaResources.Requests.Memory }}
limits:
cpu: {{ .Kubernetes.Networking.SelfHosting.TyphaResources.Limits.Cpu }}
memory: {{ .Kubernetes.Networking.SelfHosting.TyphaResources.Limits.Memory }}
livenessProbe:
httpGet:
path: /liveness
Expand Down
14 changes: 12 additions & 2 deletions pkg/api/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,18 @@ func NewDefaultCluster() *Cluster {
Enabled: false,
},
SelfHosting: SelfHosting{
Type: "canal",
Typha: false,
Type: "canal",
Typha: false,
TyphaResources: ComputeResources{
Requests: ResourceQuota{
Cpu: "100m",
Memory: "100Mi",
},
Limits: ResourceQuota{
Cpu: "250",
Memory: "200Mi",
},
},
CalicoNodeImage: Image{Repo: "quay.io/calico/node", Tag: kubeNetworkingSelfHostingDefaultCalicoNodeImageTag, RktPullDocker: false},
CalicoCniImage: Image{Repo: "quay.io/calico/cni", Tag: kubeNetworkingSelfHostingDefaultCalicoCniImageTag, RktPullDocker: false},
FlannelImage: Image{Repo: "quay.io/coreos/flannel", Tag: kubeNetworkingSelfHostingDefaultFlannelImageTag, RktPullDocker: false},
Expand Down
15 changes: 8 additions & 7 deletions pkg/api/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ type Networking struct {
}

type SelfHosting struct {
Type string `yaml:"type"`
Typha bool `yaml:"typha"`
CalicoNodeImage Image `yaml:"calicoNodeImage"`
CalicoCniImage Image `yaml:"calicoCniImage"`
FlannelImage Image `yaml:"flannelImage"`
FlannelCniImage Image `yaml:"flannelCniImage"`
TyphaImage Image `yaml:"typhaImage"`
Type string `yaml:"type"`
Typha bool `yaml:"typha"`
TyphaResources ComputeResources `yaml:"typhaResources,omitempty"`
CalicoNodeImage Image `yaml:"calicoNodeImage"`
CalicoCniImage Image `yaml:"calicoCniImage"`
FlannelImage Image `yaml:"flannelImage"`
FlannelCniImage Image `yaml:"flannelCniImage"`
TyphaImage Image `yaml:"typhaImage"`
}