All Projects → keikoproj → upgrade-manager

keikoproj / upgrade-manager

Licence: other
Reliable, extensible rolling-upgrades of Autoscaling groups in Kubernetes

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to upgrade-manager

active-monitor
Provides deep monitoring and self-healing of Kubernetes clusters
Stars: ✭ 135 (+2.27%)
Mutual labels:  kubernetes-controller, kubernetes-tools
lifecycle-manager
Graceful AWS scaling event on Kubernetes using lifecycle hooks
Stars: ✭ 89 (-32.58%)
Mutual labels:  autoscaling-groups
smartnat
Kubernetes controller to expose Services with TCP/UDP
Stars: ✭ 25 (-81.06%)
Mutual labels:  kubernetes-controller
ctrl
Tiny Kubernetes controller framework
Stars: ✭ 16 (-87.88%)
Mutual labels:  kubernetes-controller
aws-vpn-controller
The AWS VPN Controller allows you to create and delete AWS VPNs and connect them to your VPCs using Kubernetes Custom Resource Definitions.
Stars: ✭ 26 (-80.3%)
Mutual labels:  kubernetes-controller
terraform-aws-ecs-cluster
Creates an ECS cluster backed by an Auto Scaling Group
Stars: ✭ 57 (-56.82%)
Mutual labels:  autoscaling-groups
vault-sidecar-injector
Kubernetes admission webhook for secure, seamless and dynamic handling of secrets in your applications
Stars: ✭ 55 (-58.33%)
Mutual labels:  kubernetes-controller
deploykit
A toolkit for creating and managing declarative, self-healing infrastructure.
Stars: ✭ 2,246 (+1601.52%)
Mutual labels:  autoscaling-groups
cdap-operator
CDAP Kubernetes Operator
Stars: ✭ 17 (-87.12%)
Mutual labels:  kubernetes-controller
gotway
☸️ Cloud native API Gateway powered with in-redis cache
Stars: ✭ 71 (-46.21%)
Mutual labels:  kubernetes-controller
aws-cloud-map-mcs-controller-for-k8s
K8s controller implementing Multi-Cluster Services API based on AWS Cloud Map.
Stars: ✭ 61 (-53.79%)
Mutual labels:  kubernetes-controller
certificate-expiry-monitor-controller
Certificate Expiry Monitor Controller monitors the expiration of TLS certificates used in Ingress.
Stars: ✭ 114 (-13.64%)
Mutual labels:  kubernetes-controller
amazon-ec2-auto-scaling-group-examples
This repository contains code samples, learning activities, and best-practices for scaling and elasticity with Amazon EC2 Auto Scaling groups.
Stars: ✭ 27 (-79.55%)
Mutual labels:  autoscaling-groups
vegeta-controller
VegetaController is Kubernetes Custom Controller that allows distributed execution of tsenart/vegeta.
Stars: ✭ 23 (-82.58%)
Mutual labels:  kubernetes-controller
AutoSpotting
Saves up to 90% of AWS EC2 costs by automating the use of spot instances on existing AutoScaling groups. Installs in minutes using CloudFormation or Terraform. Convenient to deploy at scale using StackSets. Uses tagging to avoid launch configuration changes. Automated spot termination handling. Reliable fallback to on-demand instances.
Stars: ✭ 2,058 (+1459.09%)
Mutual labels:  autoscaling-groups
kotary
Managing Kubernetes Quota with confidence
Stars: ✭ 85 (-35.61%)
Mutual labels:  kubernetes-controller
k8s-dt-node-labeller
Kubernetes controller for labelling a node with devicetree properties
Stars: ✭ 17 (-87.12%)
Mutual labels:  kubernetes-controller
sentinel
Watch for changes in the status of Kubernetes resources and publish them to other systems for processing.
Stars: ✭ 15 (-88.64%)
Mutual labels:  kubernetes-controller
thundernetes
Thundernetes makes it easy to run your game servers on Kubernetes
Stars: ✭ 215 (+62.88%)
Mutual labels:  kubernetes-controller
kubereplay
Seamless integration of goReplay and Kubernetes
Stars: ✭ 30 (-77.27%)
Mutual labels:  kubernetes-controller

RollingUpgrade

Build Status Build Status codecov

Reliable, extensible rolling-upgrades of Autoscaling groups in Kubernetes

RollingUpgrade provides a Kubernetes native mechanism for doing rolling-updates of instances in an AutoScaling group using a CRD and a controller.

What does it do?

  • RollingUpgrade is highly inspired by the way kops does rolling-updates.

  • It provides similar options for the rolling-updates as kops and more.

  • The RollingUpgrade Kubernetes custom resource has the following options in the spec:

    • asgName: Name of the autoscaling group to perform the rolling-update.
    • preDrain.script: The script to run before draining a node.
    • postDrain.script: The script to run after draining a node. This allows for performing actions such as quiescing network traffic, adding labels, etc.
    • postDrain.waitSeconds: The seconds to wait after a node is drained.
    • postDrain.postWaitScript: The script to run after the node is drained and the waitSeconds have passed. This can be used for ensuring that the drained pods actually were able to start elsewhere.
    • nodeIntervalSeconds: The amount of time in seconds to wait after each node in the ASG is terminated.
    • postTerminate.script: Optional bash script to execute after the node has terminated.
    • strategy.mode: This field is optional and allows for two possible modes
      • lazy - this is the default mode, upgrade will terminate an instance first.
      • eager - upgrade will launch an instance prior to terminating.
    • strategy.type: This field is optional and currently two strategies are supported
      • randomUpdate - Default is type is not specified. Picks nodes randomly for updating. Refer to random_update_strategy.yaml for sample custom resource definition.
      • uniformAcrossAzUpdate - Picks same number of nodes or same percentage of nodes from each AZ for update. Refer to uniform_across_az_update_strategy.yaml for sample custom resource definition.
    • strategy.maxUnavailable: Optional field. The number of nodes that can be unavailable during rolling upgrade, can be specified as number of nodes or the percent of total number of nodes. Default is "1".
    • strategy.drainTimeout: Optional field. Node will be terminated after drain timeout even if kubectl drain has not been completed and value has to be specified in seconds. Default is -1.
    • ignoreDrainFailures : Optional field. Default value is false. If this field is set to true, drain failures will be ignored and the instances will proceed to termination.
  • After performing the rolling-update of the nodes in the ASG, RollingUpgrade puts the following data in the "Status" field.

    • currentStatus: Whether the rolling-update completed or errored out.
    • startTime: The RFC3339 timestamp when the rolling-update began. E.g. 2019-01-15T23:51:10Z
    • endTime: The RFC3339 timestamp when the rolling-update completed. E.g. 2019-01-15T00:35:10Z
    • nodesProcessed: The number of ec2 instances that were processed.
    • conditions: Conditions describing the lifecycle of the rolling-update.

Design

For each RollingUpgrade custom resource that is submitted, the following flowchart shows the sequence of actions taken to perform the rolling-update. part-1, part-2

Dependencies

  • Kubernetes cluster on AWS with nodes in AutoscalingGroups. rolling-upgrades have been tested with Kubernetes clusters v1.12+.
  • An IAM role with at least the policy specified below. The upgrade-manager should be run with that IAM role.

Installing

Complete step by step guide to create a cluster and run rolling-upgrades

For a complete, step by step guide for creating a cluster with kops, editing it and then running rolling-upgrades, please see this

Existing cluster in AWS

If you already have an existing cluster created using kops, follow the instructions below.

  • Ensure that you have a Kubernetes cluster on AWS.

  • Install the CRD using: kubectl apply -f https://raw.githubusercontent.com/keikoproj/upgrade-manager/master/config/crd/bases/upgrademgr.keikoproj.io_rollingupgrades.yaml

  • Install the controller using: kubectl create -f https://raw.githubusercontent.com/keikoproj/upgrade-manager/master/deploy/rolling-upgrade-controller-deploy.yaml

  • Note that the rolling-upgrade controller requires an IAM role with the following policy

{
    "Effect": "Allow",
    "Action": [
        "ec2:CreateTags",
        "ec2:DescribeInstances",
        "autoscaling:EnterStandby",
        "autoscaling:DescribeAutoScalingGroups",
        "autoscaling:TerminateInstanceInAutoScalingGroup"
    ],
    "Resource": [
        "*"
    ]
}
  • If the rolling-upgrade controller is directly using the IAM role of the node it runs on, the above policy will have to be added to the IAM role of the node.
  • If the rolling-upgrade controller is using it's own role created using KIAM, that role should have the above policy in it.

For more details and FAQs, refer to this

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].