Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kubernetes scalability: VPA, Federation & Cluster API

Katie Gamanji
September 04, 2019

Kubernetes scalability: VPA, Federation & Cluster API

Kubernetes scalability: VPA, Federation & Cluster API for Cloud Native Prague meetup

Katie Gamanji

September 04, 2019
Tweet

More Decks by Katie Gamanji

Other Decks in Technology

Transcript

  1. Condé Nast International has set the benchmark for print and

    digital publishing with a heritage of more than 110 years.
  2. apiVersion: apps/v1beta1 kind: Deployment metadata: name: nginx labels: app: nginx

    spec: template: [...] spec: containers: - resources: requests: memory: "16Mi" cpu: "25m" limits: memory: "16Mi" cpu: "50m"
  3. apiVersion: apps/v1beta1 kind: Deployment metadata: name: nginx labels: app: nginx

    spec: template: [...] spec: containers: - resources: requests: memory: "16Mi" cpu: "25m" limits: memory: "16Mi" cpu: "50m"
  4. VPA Reduce the maintenance cost, by automating configuration of resource

    requirements. Improving utilization of cluster resources, while minimizing the risk of containers running out of memory or getting CPU starved.
  5. VPA • Vertical Pod Autoscaler ◦ CRD v0.5.0 (v1beta2) ◦

    requires v1.11 • 3 components: ◦ admission controller ◦ recommender ◦ updater
  6. VPA VPA update policy: • Auto - assign/update resource requests

    by updating existing pods (restart-free) • Recreate - assign/update resource requests by evicting pods (restart required) • Initial - assign resource requests on creation only • Off - no automatic change, however resources are calculated
  7. Federation v2 Mechanism for managing applications and services in multiple

    Kubernetes clusters tracked by the Kubernetes cluster registry.
  8. Federation v2 SIG multicluster: • Federation ◦ v1 - deprecated

    ◦ v2 (alpha) - requires v1.13 • Cluster registry ◦ maintain list of clusters and associated metadata
  9. Federation v2 Cluster placement • targeted clusters by the federation

    Configuration overrides • patches to federated resources
  10. Federation v2 Cluster Placement • clusters spec: placement: clusters: -

    name: cluster2 - name: cluster1 • clusterSelector spec: clusterSelector: matchLabels: region: eu-central-1
  11. Federation v2 Configuration overrides • Replace (default), add or remove

    spec: overrides: - clusterName: cluster1 clusterOverrides: - path: "/spec/replicas" value: 5
  12. apiVersion: types.kubefed.io/v1beta1 kind: FederatedDeployment metadata: name: nginx-deployment spec: template: spec:

    replicas: 3 [...] placement: clusters: - cluster2 - cluster1 overrides: - clusterName: cluster2 clusterOverrides: - path: "/spec/replicas" value: 7
  13. Cluster API • Cluster - CIDRs for pods and services

    + DNS suffix • Machine - kubelet and control plane verisons • MachineSet • MachineDeployment • MachineClass - consolidate provider specific details
  14. Cluster API Controllers vs actuators: Controllers: - e.g. MachineSet -

    watch resources for changes - invoke actuators Actuators: - e.g. Cluster, Machine - provider-specific logic to match the declared state