AWS Open Source Blog
Sailing with Spinnaker on AWS
We have recently begun contributing to an exciting open source project, Spinnaker from Netflix. Spinnaker is a cloud-based continuous delivery platform for releasing software changes rapidly and reliably. Spinnaker makes it easier for developers to focus on writing code without having to worry about the underlying cloud infrastructure. It integrates seamlessly with tools such as Jenkins and TravisCI. Spinnaker provides the flexibility to deploy applications on virtual machines running in the cloud or in your container platform of choice, such as Amazon ECS or Kubernetes. AWS customers like Capital One are using Spinnaker to provide their developers with a single CI/CD pipeline to deploy their applications.
Today, we are excited to share that Spinnaker can now be deployed on Amazon Elastic Container Service for Kubernetes (Amazon EKS). To ensure proper installation of Spinnaker on top of Amazon EKS, we recently updated the official documentation.
Integrating Spinnaker and Amazon EKS
Amazon EKS runs the Kubernetes management infrastructure across multiple AWS Availability Zones. EKS automatically detects and replaces unhealthy control plane nodes, and provides on-demand upgrades and patching. You simply provision worker nodes and connect them to the provided EKS endpoint.
When running Spinnaker on Amazon EKS, the application deployment tool inherits all the scaling and reliability benefits that Kubernetes offers.
In this post, we will walk you through how to install Spinnaker on Amazon EKS and enable other AWS-powered cloud providers:
- AWS EC2 option: allows you to manage Amazon EC2 Instances.
- AWS ECS option: allows you to manage containers on Amazon ECS.
- Kubernetes option: allows you to manage containers on Amazon EKS.
Setup
Follow these instructions to configure a Kubernetes V2 (manifest-based) Clouddriver to run Spinnaker on EKS.
Set Up the Managing Account
In the managing account, create a two-subnet VPC, IAM roles, instance profiles, and a Security Group for EKS control-plane communications and an EKS cluster. This step will take around 15-20 minutes to complete.
After the stack creation succeeds, run the following:
Set Up the Managed Account
In each of managed accounts, create an IAM role that can be assumed by Spinnaker. This needs to be executed in the managing account as well:
kubectl and heptio Authenticator Configuration
- Install and configure kubectl and heptio authenticator for aws on the workstation/instance from which you are running Halyard. The Halyard version must be >=1.5.0.
When an Amazon EKS cluster is created, the IAM entity (user or role) that creates the cluster is added to the Kubernetes RBAC authorization table as the administrator. Initially, only that IAM user can make calls to the Kubernetes API server using kubectl.
If you use the console to create the cluster, you must ensure that the same IAM user credentials are in the AWS SDK credential chain when you are running kubectl commands on your cluster.
In the setup as shown above, we used the AWS CLI. Ensure that the server/workstation from which you are running the kubectl commands in step 2 below have the same AWS credentials.
Paste the following into your kubeconfig file, replacing <endpoint-url>, <base64-encoded-ca-cert> and <cluster-name> with the values for $EKS_CLUSTER_ENDPOINT, $EKS_CLUSTER_CA_DATA, and $EKS_CLUSTER_NAME as noted above:
(Optional) To have the Heptio authenticator assume a role to perform cluster operations (instead of the default AWS credential provider chain), uncomment the -r and <role-arn> lines and substitute an IAM role ARN to use with your user.
(Optional) To have the Heptio authenticator always use a specific named AWS credential profile (instead of the default AWS credential provider chain), uncomment the env lines and substitute <aws-profile> with the profile name to use.
- Create the necessary service accounts and cluster role bindings
Enable Kubernetes Cloud Provider Using Halyard
This option will allow you to manage containers on EKS . You can replace “kubernetes-master” in the commands below with an account name of your choice.
Enable AWS EC2 Cloud Provider Using Halyard
This option will allow you to manage EC2 instances. Replace ${NAME_OF_YOUR_AWS_ACCOUNT} with a friendly name for your AWS account and ${YOUR_AWS_ACCOUNT_ID} with your AWS account ID.
Enable Amazon ECS Provider Using Halyard
This option will allow you to manage containers on ECS. Replace ${NAME_OF_YOUR_AWS_ACCOUNT} with the friendly name for your AWS account that you used in configuring the EC2 cloud provider above, and the ${ECS_ACCOUNT_NAME} with a friendly name that you want to use for ECS.
Choose Halyard Distributed Deployment
This step will configure Halyard to deploy Spinnaker microservices on EKS.
Choose Persistent Storage to S3 Using Halyard
We will use Amazon Simple Storage Service (S3) as persistent storage.
Launch and Configure Amazon EKS Worker Nodes
Worker nodes launched using the commands below are standard Amazon EC2 instances and use EKS optimized AMIs.
Join the Nodes with the Spinnaker EKS Cluster
Replace $SPINNAKER_ROLE_ARN with $AUTH_ARN value and save it as aws-auth-cm.yaml:
Join the nodes with the cluster:
Watch the status of your nodes and wait for them to reach the Ready status:
Deploy Spinnaker Using Halyard
List the available versions:
Set the version you want to use:
Connect
What’s Next
AWS will be presenting at the Spinnaker Summit this October 8th and 9th in Seattle. If you would like to learn more about the Spinnaker contributions we’re making, please join us on Slack #aws-general or email us at spinnaker-aws@amazon.com.