<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Armory Docs – Administration on AWS</title><link>/continuous-deployment/armory-admin/aws/</link><description>Recent content in Administration on AWS on Armory Docs</description><generator>Hugo -- gohugo.io</generator><atom:link href="/continuous-deployment/armory-admin/aws/index.xml" rel="self" type="application/rss+xml"/><item><title>Continuous-Deployment: Bake Machine Images on AWS Using Packer</title><link>/continuous-deployment/armory-admin/aws/packer/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/armory-admin/aws/packer/</guid><description>
&lt;h2 id="overview-of-baking-images-in-spinnaker">Overview of baking images in Spinnaker&lt;/h2>
&lt;p>Spinnaker&lt;sup>TM&lt;/sup> uses the open source Packer tool to bake images, which is included in the Spinnaker Rosco microservice. For example, if you are deploying to AWS, you can use Spinnaker to bake Amazon Machine Images (AMIs) from the artifacts that were produced by your CI tool.&lt;/p>
&lt;blockquote>
&lt;p>This section focuses on configuring Packer scripts to build machine images (such as AMIs). If you&amp;rsquo;re only deploying to Kubernetes, you can skip this section.&lt;/p>
&lt;/blockquote>
&lt;h2 id="configuring-aws-bake-credentials">Configuring AWS bake credentials&lt;/h2>
&lt;p>If you&amp;rsquo;ve configured Spinnaker to deploy to AWS, then you&amp;rsquo;ve likely set up a set of IAM credentials and permissions for Clouddriver to be able to deploy to AWS (using the AWS API). Since Packer is run from a different microservice in Spinnaker (Rosco), configuration of Bake credentials is separate from the configuration of Deploy credentials.&lt;/p>
&lt;p>&lt;strong>AMI baking primarily occurs in a single AWS account; you can configure baked AMIs to be shared to additional desired AWS accounts&lt;/strong>&lt;/p>
&lt;h3 id="aws-bake-credentials-using-iam-credentials">AWS bake credentials using IAM credentials&lt;/h3>
&lt;p>If you&amp;rsquo;ve configured Spinnaker to interact with AWS using explicit credentials (an AWS Access Key and Secret Access Key), you can likewise configure Rosco to use a set of AWS credentials. What you essentially need are an IAM user with permissions to do the things that Packer needs to do, and then you can pass those credentials to Rosco.&lt;/p>
&lt;p>The AWS account that you&amp;rsquo;re baking in must also match an account configured as a Managed Account, and that Managed Account must be configured as the primary AWS account within Spinnaker.&lt;/p>
&lt;p>This User must have all permissions necessary to bake (for example, PowerUserAccess and associated PassRoles)&lt;/p>
&lt;p>This User may be, but does not have to be, the same as the Managing Account User.&lt;/p>
&lt;p>Spinnaker will always bake with this user. If you need to deploy to other accounts, update your Packer template to support sharing the baked image with other accounts. For example, add this to your &lt;code>builder&lt;/code> configuration in your packer template (and add the custom packer template following the instructions in &lt;a href="https://www.spinnaker.io/setup/bakery/#packer-templates">the Spinnaker Packer documentation&lt;/a>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;ami_users&amp;#34;&lt;/span>: [&lt;span style="color:#f1fa8c">&amp;#34;222222222222&amp;#34;&lt;/span>,&lt;span style="color:#f1fa8c">&amp;#34;333333333333&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="create-an-iam-user">Create an IAM user&lt;/h4>
&lt;p>If you don&amp;rsquo;t have an IAM user with the desired permissions, you can create one by doing the following:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Log into the AWS account where Spinnaker lives, into the browser-based AWS Console&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Navigate to the IAM page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;IAM&amp;rdquo; under &amp;ldquo;Security, Identity, &amp;amp; Compliance&amp;rdquo;)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Users&amp;rdquo; on the left side&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Add user&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Specify a logical user name, such as &amp;ldquo;SpinnakerBake&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Check the &amp;ldquo;Programmatic access&amp;rdquo; checkbox&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Select &amp;ldquo;Attach existing policies directly&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Find and attach the AWS &amp;ldquo;PowerUserAccess&amp;rdquo; Policy&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Next: Tags&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Optionally, add tags that will identify this user&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Next: Review&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Create user&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Copy the &amp;ldquo;Access key ID&amp;rdquo; and &amp;ldquo;Secret access key&amp;rdquo; (you&amp;rsquo;ll have to click &amp;ldquo;Show&amp;rdquo;).&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Close&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on the &amp;ldquo;User name&amp;rdquo; for the user that you just created.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Add inline policy&amp;rdquo; (on the right).&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on the &amp;ldquo;JSON&amp;rdquo; tab, and paste in this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Version&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;2012-10-17&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Statement&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Action&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;iam:PassRole&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Resource&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;*&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Effect&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;Allow&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Review Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Call it &amp;ldquo;PassRole&amp;rdquo; and then click &amp;ldquo;Create Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;/ol>
&lt;h4 id="add-iam-user-credentials-to-rosco">Add IAM user credentials to Rosco&lt;/h4>
&lt;p>Using the &amp;ldquo;Access key ID&amp;rdquo; and &amp;ldquo;Secret access key&amp;rdquo; for your generated user, run this command in Halyard:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4"># You will be prompted for the secret access key&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>hal config provider aws bakery edit --aws-access-key &lt;span style="color:#f1fa8c">&amp;#34;YOUR_ACCESS_KEY&amp;#34;&lt;/span> --aws-secret-key
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Then deploy your changes with this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>hal deploy apply
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="aws-bake-credentials-using-iam-profiles">AWS bake credentials using IAM profiles&lt;/h3>
&lt;p>If you&amp;rsquo;re using IAM Instance Roles, you need to provide credentials to Spinnaker to use to Bake by adding additional policies to the EC2 instances where Spinnaker is running. The AWS account that you&amp;rsquo;re baking in must also be configured as a Managed Account, and that Managed Account must be configured as the primary AWS account within Spinnaker.&lt;/p>
&lt;p>These policies must have all permissions necessary to bake (for example, PowerUserAccess and associated PassRoles)&lt;/p>
&lt;p>Spinnaker will always bake with the EC2 instance role (unless you specify explicit baking creds). If you need to deploy to other accounts, update your Packer template to support sharing the baked image with other accounts. For example, add this to your &lt;code>builder&lt;/code> configuration in your packer template (and add the custom packer template following the instructions in &lt;a href="https://www.spinnaker.io/setup/bakery/#packer-templates">the Spinnaker Packer documentation&lt;/a>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;ami_users&amp;#34;&lt;/span>: [&lt;span style="color:#f1fa8c">&amp;#34;222222222222&amp;#34;&lt;/span>,&lt;span style="color:#f1fa8c">&amp;#34;333333333333&amp;#34;&lt;/span>]
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If you don&amp;rsquo;t configure Rosco with explicit AWS credentials to use, Packer will default to the AWS permissions available to the Rosco container. In general, this means that Packer will use the IAM Role/Profile attached to the Kubernetes nodes where Spinnaker is running. In order for this to work, the IAM Role/Profile attached to your Kubernetes cluster will need a set of permissions to be able to create and interact with EC2 instances (and assign roles to those EC2 instances).&lt;/p>
&lt;ol>
&lt;li>
&lt;p>First, identify the IAM Profile attached to the Kubernetes cluster where Spinnaker is running. If you&amp;rsquo;re running EKS, this will be the role attached to the EKS EC2 worker nodes.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Go to the Role Summary for the IAM Profile, and click &amp;ldquo;Attach policies&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Find and select the AWS &amp;ldquo;PowerUserAccess&amp;rdquo; Policy&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Attach policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Add inline policy&amp;rdquo; (on the right).&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on the &amp;ldquo;JSON&amp;rdquo; tab, and paste in this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Version&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;2012-10-17&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Statement&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Action&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;iam:PassRole&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Resource&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;*&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Effect&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;Allow&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Review Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Call it &amp;ldquo;PassRole&amp;rdquo; and then click &amp;ldquo;Create Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>This role should be immediately available to your Rosco instance.&lt;/p>
&lt;h2 id="configuring-aws-networks">Configuring AWS networks&lt;/h2>
&lt;p>In addition to providing permissions for Rosco&amp;rsquo;s packer to do Bake stages, if your AWS account doesn&amp;rsquo;t have a default VPC / subnet, you can specify a default subnet to bake in with this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>hal config provider aws bakery edit --aws-subnet subnet-0123456789
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>hal deploy apply
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Or, on a per-bake basis, you can specify what VPC and subnet to bake by adding these two extended attributes to the Bake stage:&lt;/p>
&lt;ul>
&lt;li>&lt;code>aws_vpc_id&lt;/code>: &lt;code>vpc-123456&lt;/code>&lt;/li>
&lt;li>&lt;code>aws_subnet_id&lt;/code>: &lt;code>subnet-0123456789&lt;/code>&lt;/li>
&lt;/ul>
&lt;h2 id="what-exactly-are-packer-scripts">What exactly are Packer scripts?&lt;/h2>
&lt;p>Spinnaker works best when deploying immutable artifacts to immutable machine images. When working with machine images, packer scripts are used during the &lt;strong>Bake Stage&lt;/strong> to create an immutable machine image.&lt;/p>
&lt;p>Spinnaker has a microservice called Rosco, which uses &lt;a href="https://www.packer.io/">Packer&lt;/a> to bake machine images (such as Amazon Machine Images or AMIs). Out of the box, it comes with the packer templates and scripts listed &lt;a href="https://github.com/spinnaker/rosco/tree/master/rosco-web/config/packer">here&lt;/a>.&lt;/p>
&lt;p>By default, Rosco performs the following actions in a &amp;ldquo;Bake&amp;rdquo; stage:&lt;/p>
&lt;ul>
&lt;li>Takes a list of desired packages specified in the pipeline definition&lt;/li>
&lt;li>Identifies the &lt;code>deb&lt;/code> files produced by your CI pipeline and matches those to the desired package&lt;/li>
&lt;li>Creates a set of Packer variables using the name/repository of the matched &lt;code>deb&lt;/code> file(s)&lt;/li>
&lt;li>Bakes an AMI using the packer template (visible &lt;a href="https://github.com/spinnaker/rosco/blob/master/halconfig/packer/aws-ebs.json">here&lt;/a>&lt;/li>
&lt;li>Runs the &lt;code>install_packages.sh&lt;/code> script (visible &lt;a href="https://github.com/spinnaker/rosco/blob/master/halconfig/packer/install_packages.sh">here&lt;/a>) to install the identified &lt;code>deb&lt;/code> packages into the AMI&lt;/li>
&lt;li>Make the AMI ID available to later stages in the Spinnaker pipeline (such as deployments)&lt;/li>
&lt;/ul>
&lt;p>In a bake stage configuration, you can specify other packer templates to use.&lt;/p>
&lt;p>If your app is using zip, tarballs or you need some customization, you need to create a new Packer script (see below).&lt;/p>
&lt;h2 id="adding-custom-packer-scripts-to-armory">Adding custom Packer scripts to Armory&lt;/h2>
&lt;p>Out of the box, Armory comes with these built-in Packer templates and scripts: &lt;a href="https://github.com/spinnaker/rosco/tree/master/rosco-web/config/packer">https://github.com/spinnaker/rosco/tree/master/rosco-web/config/packer&lt;/a>&lt;/p>
&lt;p>If you&amp;rsquo;d like to add additional Packer template or script files, you can add them via the &lt;a href="/continuous-deployment/installation/armory-operator/">Armory Operator&lt;/a> .&lt;/p>
&lt;p>Add any Packer template and supporting scripts as string-formatted entries under the &lt;code>spec.spinnakerConfig.files&lt;/code> section of the &lt;code>SpinnakerService&lt;/code> config.&lt;/p>
&lt;p>If you have a template named example-packer-config.json containing the following:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;packerSetting&amp;#34;&lt;/span> : &lt;span style="color:#f1fa8c">&amp;#34;someValue&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>and a script file named my-custom-script.sh containing the following:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">#!/bash/bash -e
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">&lt;/span>&lt;span style="color:#8be9fd;font-style:italic">echo&lt;/span> &lt;span style="color:#f1fa8c">&amp;#34;Hello world!&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>make the following entries into the &lt;code>SpinnakerService&lt;/code> config:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">files&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">profiles__rosco__packer__example-packer-config.json&lt;/span>: |&lt;span style="color:#f1fa8c">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f1fa8c"> {
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f1fa8c"> &amp;#34;packerSetting&amp;#34; : &amp;#34;someValue&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f1fa8c"> }&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">profiles__rosco__packer__my-custom-script.sh&lt;/span>: |&lt;span style="color:#f1fa8c">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f1fa8c"> #!/bash/bash -e
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f1fa8c"> echo &amp;#34;Hello world!&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>NOTE: The Armory Operator interprets the double underscores in the file names as slashes indicating the directory path where the Operator saves the file.&lt;/p>
&lt;p>See the &amp;ldquo;Export Packer template files&amp;rdquo; step in the &lt;a href="/continuous-deployment/installation/armory-operator/hal-op-migration/">Migrating from Halyard to Operator&lt;/a> section of the Armory Operator document for more examples.&lt;/p></description></item><item><title>Continuous-Deployment: Configure AWS for Spinnaker Using IAM Instance Roles</title><link>/continuous-deployment/armory-admin/aws/aws-iam-roles-configure/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/armory-admin/aws/aws-iam-roles-configure/</guid><description>
&lt;h2 id="overview-of-deploying-applications-to-aws">Overview of deploying applications to AWS&lt;/h2>
&lt;p>This document will guide you through the following:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>Understanding AWS deployment from Spinnaker&lt;sup>TM&lt;/sup>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Configuring Spinnaker to use AWS IAM Instance Roles (if Spinnaker is running on AWS, either via AWS EKS or installed directly on EC2 instances)&lt;/p>
&lt;ul>
&lt;li>Creating a Managed Account IAM Role in each of your target AWS Accounts&lt;/li>
&lt;li>Creating the default BaseIamRole for use when deploying EC2 instances&lt;/li>
&lt;li>Creating a Managing Account IAM Policy in your primary AWS Account&lt;/li>
&lt;li>Adding the Managing Account IAM Policy to the existing IAM Instance Role on the AWS nodes&lt;/li>
&lt;li>Configuring the Managed Accounts IAM Roles to trust the IAM Instance Role from the AWS nodes&lt;/li>
&lt;li>Adding the Managed Accounts to Spinnaker&lt;/li>
&lt;li>Adding/Enabling the AWS Cloud Provider to Spinnaker&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h2 id="prerequisites-for-deploying-to-aws">Prerequisites for deploying to AWS&lt;/h2>
&lt;ul>
&lt;li>You installed Spinnaker with Operator.&lt;/li>
&lt;li>You have access to the Spinnaker config files, and a way to apply them (&lt;code>kubectl&lt;/code> for Operator).&lt;/li>
&lt;li>If you&amp;rsquo;re using Operator, you have a access to run &lt;code>kubectl&lt;/code> commands against the cluster where Spinnaker is installed.&lt;/li>
&lt;li>You have permissions to create IAM roles using IAM policies and permissions, in all relevant AWS accounts.
&lt;ul>
&lt;li>You should also be able to set up cross-account trust relationships between IAM roles.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>If you want to add the IAM Role to Spinnaker via an Access Key/Secret Access Key, you have permissions to create an IAM User.&lt;/li>
&lt;li>If you want to add the IAM Role to Spinnaker via IAM instance profiles/policies, you have permissions to modify the IAM instance.&lt;/li>
&lt;/ul>
&lt;blockquote>
&lt;p>All configuration with AWS in this document will be handled via the browser-based AWS Console. All configurations could &lt;strong>alternatively&lt;/strong> be configured via the &lt;code>aws&lt;/code> CLI, but this is not currently covered in this document.&lt;/p>
&lt;/blockquote>
&lt;p>Also - you will be granting AWS Power User Access to each of the Managed Account Roles. You could optionally grant fewer permissions, but those more limited permissions are not covered in this document.&lt;/p>
&lt;h2 id="background-understanding-aws-deployment-from-spinnaker">Background: Understanding AWS Deployment from Spinnaker&lt;/h2>
&lt;p>Even if Spinnaker is installed in Kubernetes, it can be used to deploy to other cloud environments, such as AWS. Rather than granting Spinnaker direct access to each of the target AWS accounts, Spinnaker will assume a role in each of the target accounts.&lt;/p>
&lt;h3 id="deploying-to-aws-ec2">Deploying to AWS EC2&lt;/h3>
&lt;p>Spinnaker is able to deploy EC2 instances via Auto Scaling Groups.&lt;/p>
&lt;ul>
&lt;li>Spinnaker&amp;rsquo;s Clouddriver Pod should be able to assume a &lt;strong>Managed Account Role&lt;/strong> in each deployment target AWS account, and use that role to perform any AWS actions. This may include one or more of the following:
&lt;ul>
&lt;li>Create AWS Launch Configurations and Auto Scaling Groups to deploy AWS EC2 instances&lt;/li>
&lt;li>Run ECS Containers&lt;/li>
&lt;li>Run AWS Lambda Actions (alpha/beta as of the time of this document)&lt;/li>
&lt;li>Create AWS CloudFormation Stacks (alpha/beta as of the time of this document)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Clouddriver is configured with direct access to a &lt;strong>&amp;ldquo;Managing Account&amp;rdquo;&lt;/strong> Policy (&lt;em>it may be helpful to think of this as the &lt;strong>Master&lt;/strong> or &lt;strong>Source&lt;/strong> Policy&lt;/em>), which is accomplished in one of two ways:
&lt;ul>
&lt;li>If Spinnaker is running in AWS (either in AWS EKS, or with Kubernetes nodes running in AWS EC2), the Managing Account Policy can be made available to Spinnaker by adding it to the AWS nodes (EC2 instances) where the Spinnaker Clouddriver pod(s) are running.
&lt;ul>
&lt;li>&lt;em>(You can also use Kube2IAM or similar capabilities, but this is not covered in this document)&lt;/em>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>An IAM User with access to the Managing Account Policy can be passed directly to Spinnaker via an Access Key and Secret Access Key&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>For each AWS account that you want Spinnaker to be able to deploy to, Spinnaker needs a &lt;strong>&amp;ldquo;Managed Account&amp;rdquo;&lt;/strong> Role in that AWS account, with permissions to do the things you want Spinnaker to be able to do (&lt;em>it may be helpful to think of this as a &lt;strong>Target Role&lt;/strong>&lt;/em>)&lt;/li>
&lt;li>The Managing Account Role (Source/Master Role) should be able to assume each of the Managed Account Roles (Target Roles). This requires two things:
&lt;ul>
&lt;li>The Managing Account Role needs a permission string for each Managed Account it needs to be able to assume. &lt;em>It may be helpful to think of this as an outbound permission.&lt;/em>&lt;/li>
&lt;li>Each Managed Account needs to have a trust relationship with the Managing Account User or Role to allow the Managing Account User or Role to assume it. &lt;em>It may be helpful to think of this as an inbound permission.&lt;/em>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;p>In addition, if you are deploying EC2 instances with AWS, you will need to provide an IAM role for each instance. If you do not specify a role, Spinnaker will attempt to use a role called &lt;code>BaseIAMRole&lt;/code>. So you should create a BaseIAMRole (potentially with no permissions).&lt;/p>
&lt;h3 id="deployment-scenario">Deployment scenario&lt;/h3>
&lt;p>Here&amp;rsquo;s an example situation:&lt;/p>
&lt;ul>
&lt;li>We would like Armory to deploy to three AWS accounts, with account IDs 111111111111, 222222222222, and 333333333333. Each of these is a &lt;em>Managed Account&lt;/em>&lt;/li>
&lt;li>Choose one account (111111111111), that Armory will log into directly. This is the &lt;em>Managing Account&lt;/em>&lt;/li>
&lt;li>We will end up with four IAM entities:
&lt;ul>
&lt;li>A &lt;em>Managing Account Policy&lt;/em> in account 111111111111 (&lt;code>arn:aws:iam::111111111111:user/managingAccount&lt;/code>)&lt;/li>
&lt;li>A &lt;em>Managed Account Role&lt;/em> in account 111111111111 (&lt;code>arn:aws:iam::111111111111:role/spinnakerManaged&lt;/code>)&lt;/li>
&lt;li>A &lt;em>Managed Account Role&lt;/em> in account 222222222222 (&lt;code>arn:aws:iam::222222222222:role/spinnakerManaged&lt;/code>)&lt;/li>
&lt;li>A &lt;em>Managed Account Role&lt;/em> in account 333333333333 (&lt;code>arn:aws:iam::333333333333:role/spinnakerManaged&lt;/code>)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>The &lt;em>Managing Account Policy&lt;/em> needs these:
&lt;ul>
&lt;li>The &lt;code>sts:AssumeRole&lt;/code> permission for each of the Managed Account Roles&lt;/li>
&lt;li>The &lt;code>ec2:DescribeAvailabilityZones&lt;/code> permission&lt;/li>
&lt;li>The &lt;code>ec2:DescribeRegions&lt;/code> permission&lt;/li>
&lt;li>It should be attached to the IAM Instance Role where Armory is running&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Each &lt;em>Managed Account Role&lt;/em> needs these:
&lt;ul>
&lt;li>&lt;strong>PowerUserAccess&lt;/strong>&lt;/li>
&lt;li>The &lt;code>iam:PassRole&lt;/code> permission for roles that will be assigned to EC2 instances that are being deployed&lt;/li>
&lt;li>A trust relationship with the IAM Instance Role attached to the EC2 instances where Armory is running (to allow Armory to assume the Managed Account Role)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h3 id="spinnaker-configuration-examples">Spinnaker configuration examples&lt;/h3>
&lt;p>Here&amp;rsquo;s a sample &lt;code>SpinnakerService&lt;/code> manifest block that supports the above:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: spinnaker.armory.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providers&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">aws&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accounts&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: aws-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">requiredGroupMembership&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providerVersion&lt;/span>: V1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">permissions&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accountId&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;111111111111&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">regions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-east-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">assumeRole&lt;/span>: role/spinnakerManaged
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: aws-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">requiredGroupMembership&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providerVersion&lt;/span>: V1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">permissions&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accountId&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;222222222222&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">regions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-east-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">assumeRole&lt;/span>: role/spinnakerManaged
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: aws-3
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">requiredGroupMembership&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providerVersion&lt;/span>: V1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">permissions&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accountId&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;333333333333&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">regions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-east-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">assumeRole&lt;/span>: role/spinnakerManaged
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#6272a4"># Because we&amp;#39;re baking in 111111111111, this must match the accountName that is associated with 111111111111&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">primaryAccount&lt;/span>: aws-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">bakeryDefaults&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">templateFile&lt;/span>: aws-ebs-shared.json
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">baseImages&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsAssociatePublicIpAddress&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultVirtualizationType&lt;/span>: hvm
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultKeyPairTemplate&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;{{name}}-keypair&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultRegions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaults&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">iamRole&lt;/span>: BaseIAMRole
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="configuring-armory-to-use-aws-iam-instance-roles">Configuring Armory to use AWS IAM Instance Roles&lt;/h2>
&lt;p>If you are running Armory on AWS (either via AWS EKS or installed directly on EC2 instances), you can use AWS IAM roles to allow Clouddriver to interact with the various AWS APIs across multiple AWS Accounts.&lt;/p>
&lt;h3 id="instance-role-part-1-creating-a-managed-account-iam-role-in-each-your-target-aws-accounts">Instance Role Part 1: Creating a Managed Account IAM Role in each your target AWS Accounts&lt;/h3>
&lt;p>In each account that you want Armory to deploy to, you should create an IAM role for Armory to assume.&lt;/p>
&lt;p>For each account you want to deploy to, perform the following:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Log into the browser-based AWS Console&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Navigate to the IAM page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;IAM&amp;rdquo; under &amp;ldquo;Security, Identity, &amp;amp; Compliance&amp;rdquo;)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Roles&amp;rdquo; on the left hand side&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Create role&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>For now, for the &amp;ldquo;Choose the service that will use this role&amp;rdquo;, select &amp;ldquo;EC2&amp;rdquo;. We will change this later, because we want to specify an explicit consumer of this role later on.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Next: Permissions&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Search for &amp;ldquo;PowerUserAccess&amp;rdquo; in the search filter, and select the Policy called &amp;ldquo;PowerUserAcces&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Next: Tags&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Optionally, add tags that will identify this role.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Next: Review&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Enter a Role Name. For example, &amp;ldquo;DevSpinnakerManagedRole&amp;rdquo;. Optionally, add a description, such as &amp;ldquo;Allows Armory Dev Cluster to perform actions in this account.&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Create Role&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>In the list of Roles, click on your new Role (you may have to scroll down or filter for it).&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Add inline policy&amp;rdquo; (on the right).&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on the &amp;ldquo;JSON&amp;rdquo; tab, and paste in this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Version&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;2012-10-17&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Statement&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Action&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;iam:ListServerCertificates&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;iam:PassRole&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Resource&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;*&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Effect&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;Allow&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Review Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Call it &amp;ldquo;PassRole-and-Certificates&amp;rdquo;, and click &amp;ldquo;Create Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Copy the Role ARN and save it. It should look something like this: &lt;code>arn:aws:iam::123456789012:role/DevSpinnakerManagedRole&lt;/code>. &lt;strong>This will be used in the section &amp;ldquo;Instance Role Part 3&amp;rdquo;, and in section &amp;ldquo;Instance Role Part 6&amp;rdquo;&lt;/strong>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>You will end up with a Role ARN for each Managed / Target account. The Role names do not have to be the same (although it is a bit cleaner if they are). For example, you may end up with roles that look like this:&lt;/p>
&lt;ul>
&lt;li>&lt;code>arn:aws:iam::123456789012:role/DevSpinnakerManagedRole&lt;/code>&lt;/li>
&lt;li>&lt;code>arn:aws:iam::123456789013:role/DevSpinnakerManagedRole&lt;/code>&lt;/li>
&lt;li>&lt;code>arn:aws:iam::123456789014:role/DevSpinnakerManaged&lt;/code>&lt;/li>
&lt;/ul>
&lt;h3 id="instance-role-part-2-creating-the-baseiamrole-for-ec2-instances">Instance Role Part 2: Creating the BaseIAMRole for EC2 instances&lt;/h3>
&lt;p>When deploying EC2 instances, Armory currently requires that you attach a role for each instance (even if you don&amp;rsquo;t want to grant the instance any special permissions. If you do not specify an instance role, Armory will default to a role called &lt;code>BaseIAMRole&lt;/code>, and it will throw an error if this does not exist. Therefore, you should at a minimum create an empty role called BaseIAMRole.&lt;/p>
&lt;ol>
&lt;li>Log into the browser-based AWS Console&lt;/li>
&lt;li>Navigate to the IAM page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;IAM&amp;rdquo; under &amp;ldquo;Security, Identity, &amp;amp; Compliance&amp;rdquo;)&lt;/li>
&lt;li>Click on &amp;ldquo;Roles&amp;rdquo; on the left side&lt;/li>
&lt;li>Click &amp;ldquo;Create role&amp;rdquo;&lt;/li>
&lt;li>Select &amp;ldquo;EC2&amp;rdquo;, and click &amp;ldquo;Next: Permissions&amp;rdquo;&lt;/li>
&lt;li>Click &amp;ldquo;Next: Tags&amp;rdquo;&lt;/li>
&lt;li>Optionally, add tags if required by your organization. Then, click &amp;ldquo;Next: Review&amp;rdquo;.&lt;/li>
&lt;li>Specify the Role Name as &amp;ldquo;BaseIAMRole&amp;rdquo;&lt;/li>
&lt;/ol>
&lt;h3 id="instance-role-part-3-creating-a-managing-account-iam-policy-in-your-primary-aws-account">Instance Role Part 3: Creating a Managing Account IAM Policy in your primary AWS Account&lt;/h3>
&lt;p>In the account that Armory lives in (i.e., the AWS account that owns the EKS cluster where Armory is installed), create an IAM Policy with permissions to assume all of your Managed Roles.&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Log into the AWS account where Armory lives, into the browser-based AWS Console&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Navigate to the IAM page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;IAM&amp;rdquo; under &amp;ldquo;Security, Identity, &amp;amp; Compliance&amp;rdquo;)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Policies&amp;rdquo; on the left hand side&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Create Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on the &amp;ldquo;JSON&amp;rdquo; tab, and paste in this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Version&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;2012-10-17&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Statement&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Effect&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;Allow&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Action&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;ec2:DescribeAvailabilityZones&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;ec2:DescribeRegions&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Resource&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;*&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Action&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;sts:AssumeRole&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Resource&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;arn:aws:iam::123456789012:role/DevSpinnakerManagedRole&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;arn:aws:iam::123456789013:role/spinnakerManaged&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;arn:aws:iam::123456789014:role/DevSpinnakerManaged&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Effect&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;Allow&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Update the &lt;code>sts:AssumeRole&lt;/code> block with the list of Managed Roles you created in &lt;strong>Instance Role Part 1&lt;/strong>.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Review Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Create a name for your policy, such as &amp;ldquo;SpinnakerManagingPolicy&amp;rdquo;. &lt;em>This policy will be attached to your Armory instance, so give it a name describing your Armory instance.&lt;/em> Optionally, add a descriptive description. Copy the name of the policy. &lt;strong>This will be used in the next section, &amp;ldquo;Instance Role Part 4&amp;rdquo;&lt;/strong>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>On the list policies, click your newly-created Policy.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>&lt;em>(This policy could also be attached inline directly to the IAM Instance Role, rather than creating a standalone policy)&lt;/em>&lt;/p>
&lt;h3 id="instance-role-part-4-adding-the-managing-account-iam-policy-to-the-existing-iam-instance-role-on-the-aws-nodes">Instance Role Part 4: Adding the Managing Account IAM Policy to the existing IAM Instance Role on the AWS nodes&lt;/h3>
&lt;ol>
&lt;li>Log into the AWS account where Armory lives, into the browser-based AWS Console&lt;/li>
&lt;li>Navigate to the EC2 page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;EC2&amp;rdquo; under &amp;ldquo;Compute&amp;rdquo;)&lt;/li>
&lt;li>Click on &amp;ldquo;Running Instances&amp;rdquo;&lt;/li>
&lt;li>Find one of the nodes which is part of your EKS or other Kubernetes cluster, and select it.&lt;/li>
&lt;li>In the Instance details section of the screen (in the lower half), find the &amp;ldquo;IAM Role&amp;rdquo; and click on it to go to the Role page.&lt;/li>
&lt;li>Click on &amp;ldquo;Attach Policies&amp;rdquo;&lt;/li>
&lt;li>Search for the Policy that you created, and select it.&lt;/li>
&lt;li>Click &amp;ldquo;Attach Policy&amp;rdquo;&lt;/li>
&lt;li>Back on the screen for the Role, copy the node role ARN. It should look something like this: &lt;code>arn:aws:iam::123456789010:role/node-role&lt;/code>. &lt;strong>This will be used in the next section, &amp;ldquo;Instance Role Part 5&amp;rdquo;&lt;/strong>&lt;/li>
&lt;/ol>
&lt;p>Note: If your instances do not have an IAM instance profile and role attached to them, you can follow these steps to create and attach one:&lt;/p>
&lt;ol>
&lt;li>Log into the AWS account where Armory lives, into the browser-based AWS Console&lt;/li>
&lt;li>Navigate to the IAM page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;IAM&amp;rdquo; under &amp;ldquo;Security, Identity, &amp;amp; Compliance&amp;rdquo;&lt;/li>
&lt;li>Click on &amp;ldquo;Roles&amp;rdquo;&lt;/li>
&lt;li>Click on &amp;ldquo;Create role&amp;rdquo;&lt;/li>
&lt;li>Select &amp;ldquo;EC2&amp;rdquo; for the service that will use the role, and click &amp;ldquo;Next: Permissions&amp;rdquo;&lt;/li>
&lt;li>In the policy filter, enter the name of the managing policy you created in step 3. Click &amp;ldquo;Next: Tags&amp;rdquo;&lt;/li>
&lt;li>Add any relevant tags. Click &amp;ldquo;Next: Review&amp;rdquo;&lt;/li>
&lt;li>Give the role a name, such as &amp;ldquo;Armory&amp;rdquo;. &lt;em>This role will be attached to your Armory instance, so give it a name describing your Armory instance.&lt;/em> Optionally, add a descriptive description. Copy the name of the role.&lt;/li>
&lt;li>Navigate to the EC2 page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;EC2&amp;rdquo; under &amp;ldquo;Compute&amp;rdquo;)&lt;/li>
&lt;li>Click on &amp;ldquo;Running Instances&amp;rdquo;&lt;/li>
&lt;li>Find one of the nodes which is part of your EKS or other Kubernetes cluster, and select it.&lt;/li>
&lt;li>Click &amp;ldquo;Actions&amp;rdquo; at the top, then select &amp;ldquo;Instance Settings&amp;rdquo; and then &amp;ldquo;Attach/Replace IAM Role&amp;rdquo;&lt;/li>
&lt;li>In the &amp;ldquo;IAM role&amp;rdquo; dropdown, select the IAM role that you just created&lt;/li>
&lt;li>Click &amp;ldquo;Apply&amp;rdquo;&lt;/li>
&lt;li>Repeaat the last four steps for each of the other instances in your EKS or Kubernetes cluster.&lt;/li>
&lt;/ol>
&lt;h3 id="instance-role-part-5-configuring-the-managed-accounts-iam-roles-to-trust-the-iam-instance-role-from-the-aws-nodes">Instance Role Part 5: Configuring the Managed Accounts IAM Roles to trust the IAM Instance Role from the AWS nodes&lt;/h3>
&lt;p>Now that we know what role will be assuming each of the Managed Roles, we must configure the Managed Roles (Target Roles) to trust and allow the Managing (Assuming) Role to assume them. This is called a &amp;ldquo;Trust Relationship&amp;rdquo; and is configured each of the Managed Roles (Target Roles).&lt;/p>
&lt;p>For each account you want to deploy to, perform the following:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Log into the browser-based AWS Console&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Navigate to the IAM page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;IAM&amp;rdquo; under &amp;ldquo;Security, Identity, &amp;amp; Compliance&amp;rdquo;)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Roles&amp;rdquo; on the left hand side&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Find the Managed Role that you created earlier in this account, and click on the Role Name to edit the role.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on the &amp;ldquo;Trust relationships&amp;rdquo; tab.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Edit trust relationship&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Replace the Policy Document with this (Update the ARN with the node role ARN from &amp;ldquo;Instance Role Part 4&amp;rdquo;)&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Version&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;2012-10-17&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Statement&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Effect&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;Allow&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Principal&amp;#34;&lt;/span>: {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;AWS&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;arn:aws:iam::123456789010:role/node-role&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Action&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;sts:AssumeRole&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Update Trust Policy&amp;rdquo;, in the bottom right.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;h3 id="instance-role-part-6-adding-the-managed-accounts-to-armory">Instance Role Part 6: Adding the Managed Accounts to Armory&lt;/h3>
&lt;p>The Clouddriver pod(s) should be now able to assume each of the Managed Roles (Target Roles) in each of your Deployment Target accounts. We need to configure Armory to be aware of the accounts and roles its allowed to consume.&lt;/p>
&lt;p>For each of the Managed (Target) accounts you want to deploy to, add a new entry to the &lt;code>accounts&lt;/code> array in &lt;code>SpinnakerService&lt;/code> manifest as follows:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: spinnaker.armory.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providers&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">aws&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accounts&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: aws-dev-1 &lt;span style="color:#6272a4"># Should be a unique name which is used in the Armory UI and API to identify the deployment target. For example, aws-dev-1 or aws-dev-2&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">requiredGroupMembership&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providerVersion&lt;/span>: V1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">permissions&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accountId&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;111111111111&amp;#39;&lt;/span> &lt;span style="color:#6272a4"># Should be the account ID for the Managed Role (Target Role) you are assuming. For example, if the role ARN is arn:aws:iam::123456789012:role/ DevSpinnakerManagedRole, then ACCOUNT_ID would be 123456789012&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">regions&lt;/span>: &lt;span style="color:#6272a4"># Configure the regions you want to deploy to&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-east-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">assumeRole&lt;/span>: role/spinnakerManaged &lt;span style="color:#6272a4"># Should be the full role name within the account, including the type of object (role). For example, if the role ARN is arn:aws:iam::123456789012:role/DevSpinnakerManagedRole, then ROLE_NAME would be role/DevSpinnakerManagedRole&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">primaryAccount&lt;/span>: aws-dev-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">bakeryDefaults&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">templateFile&lt;/span>: aws-ebs-shared.json
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">baseImages&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsAssociatePublicIpAddress&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultVirtualizationType&lt;/span>: hvm
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultKeyPairTemplate&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;{{name}}-keypair&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultRegions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaults&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">iamRole&lt;/span>: BaseIAMRole
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="instance-role-part-7-addingenabling-the-aws-cloudprovider-configuration-to-armory">Instance Role Part 7: Adding/Enabling the AWS CloudProvider configuration to Armory&lt;/h3>
&lt;p>Apply the changes done in &lt;code>Spinnakerservice&lt;/code> manifest:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl -n &amp;lt;spinnaker namespace&amp;gt; apply -f &amp;lt;SpinnakerService manifest file&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Continuous-Deployment: Configure Spinnaker to Access AWS Using IAM User Roles</title><link>/continuous-deployment/armory-admin/aws/add-aws-account/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/armory-admin/aws/add-aws-account/</guid><description>
&lt;h2 id="overview-of-deploying-applications-to-aws">Overview of deploying applications to AWS&lt;/h2>
&lt;p>This document will guide you through the following:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>Understanding AWS deployment from Spinnaker&lt;sup>TM&lt;/sup>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Configuring Spinnaker to use AWS IAM Instance Roles (if Spinnaker is running on AWS, either via AWS EKS or installed directly on EC2 instances)&lt;/p>
&lt;ul>
&lt;li>Creating a Managed Account IAM Role in each of your target AWS Accounts&lt;/li>
&lt;li>Creating the default BaseIamRole for use when deploying EC2 instances&lt;/li>
&lt;li>Creating a Managing Account IAM Policy in your primary AWS Account&lt;/li>
&lt;li>Adding the Managing Account IAM Policy to the existing IAM Instance Role on the AWS nodes&lt;/li>
&lt;li>Configuring the Managed Accounts IAM Roles to trust the IAM Instance Role from the AWS nodes&lt;/li>
&lt;li>Adding the Managed Accounts to Spinnaker&lt;/li>
&lt;li>Adding/Enabling the AWS Cloud Provider to Spinnaker&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h2 id="prerequisites-for-deploying-to-aws">Prerequisites for deploying to AWS&lt;/h2>
&lt;ul>
&lt;li>You installed Spinnaker with Operator.&lt;/li>
&lt;li>You have access to the Spinnaker config files, and a way to apply them (&lt;code>kubectl&lt;/code> for Operator).&lt;/li>
&lt;li>If you&amp;rsquo;re using Operator, you have a access to run &lt;code>kubectl&lt;/code> commands against the cluster where Spinnaker is installed.&lt;/li>
&lt;li>You have permissions to create IAM roles using IAM policies and permissions, in all relevant AWS accounts.
&lt;ul>
&lt;li>You should also be able to set up cross-account trust relationships between IAM roles.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>If you want to add the IAM Role to Spinnaker via an Access Key/Secret Access Key, you have permissions to create an IAM User.&lt;/li>
&lt;li>If you want to add the IAM Role to Spinnaker via IAM instance profiles/policies, you have permissions to modify the IAM instance.&lt;/li>
&lt;/ul>
&lt;blockquote>
&lt;p>All configuration with AWS in this document will be handled via the browser-based AWS Console. All configurations could &lt;strong>alternatively&lt;/strong> be configured via the &lt;code>aws&lt;/code> CLI, but this is not currently covered in this document.&lt;/p>
&lt;/blockquote>
&lt;p>Also - you will be granting AWS Power User Access to each of the Managed Account Roles. You could optionally grant fewer permissions, but those more limited permissions are not covered in this document.&lt;/p>
&lt;h2 id="background-understanding-aws-deployment-from-spinnaker">Background: Understanding AWS Deployment from Spinnaker&lt;/h2>
&lt;p>Even if Spinnaker is installed in Kubernetes, it can be used to deploy to other cloud environments, such as AWS. Rather than granting Spinnaker direct access to each of the target AWS accounts, Spinnaker will assume a role in each of the target accounts.&lt;/p>
&lt;h3 id="deploying-to-aws-ec2">Deploying to AWS EC2&lt;/h3>
&lt;p>Spinnaker is able to deploy EC2 instances via Auto Scaling Groups.&lt;/p>
&lt;ul>
&lt;li>Spinnaker&amp;rsquo;s Clouddriver Pod should be able to assume a &lt;strong>Managed Account Role&lt;/strong> in each deployment target AWS account, and use that role to perform any AWS actions. This may include one or more of the following:
&lt;ul>
&lt;li>Create AWS Launch Configurations and Auto Scaling Groups to deploy AWS EC2 instances&lt;/li>
&lt;li>Run ECS Containers&lt;/li>
&lt;li>Run AWS Lambda Actions (alpha/beta as of the time of this document)&lt;/li>
&lt;li>Create AWS CloudFormation Stacks (alpha/beta as of the time of this document)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Clouddriver is configured with direct access to a &lt;strong>&amp;ldquo;Managing Account&amp;rdquo;&lt;/strong> Policy (&lt;em>it may be helpful to think of this as the &lt;strong>Master&lt;/strong> or &lt;strong>Source&lt;/strong> Policy&lt;/em>), which is accomplished in one of two ways:
&lt;ul>
&lt;li>If Spinnaker is running in AWS (either in AWS EKS, or with Kubernetes nodes running in AWS EC2), the Managing Account Policy can be made available to Spinnaker by adding it to the AWS nodes (EC2 instances) where the Spinnaker Clouddriver pod(s) are running.
&lt;ul>
&lt;li>&lt;em>(You can also use Kube2IAM or similar capabilities, but this is not covered in this document)&lt;/em>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>An IAM User with access to the Managing Account Policy can be passed directly to Spinnaker via an Access Key and Secret Access Key&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>For each AWS account that you want Spinnaker to be able to deploy to, Spinnaker needs a &lt;strong>&amp;ldquo;Managed Account&amp;rdquo;&lt;/strong> Role in that AWS account, with permissions to do the things you want Spinnaker to be able to do (&lt;em>it may be helpful to think of this as a &lt;strong>Target Role&lt;/strong>&lt;/em>)&lt;/li>
&lt;li>The Managing Account Role (Source/Master Role) should be able to assume each of the Managed Account Roles (Target Roles). This requires two things:
&lt;ul>
&lt;li>The Managing Account Role needs a permission string for each Managed Account it needs to be able to assume. &lt;em>It may be helpful to think of this as an outbound permission.&lt;/em>&lt;/li>
&lt;li>Each Managed Account needs to have a trust relationship with the Managing Account User or Role to allow the Managing Account User or Role to assume it. &lt;em>It may be helpful to think of this as an inbound permission.&lt;/em>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;p>In addition, if you are deploying EC2 instances with AWS, you will need to provide an IAM role for each instance. If you do not specify a role, Spinnaker will attempt to use a role called &lt;code>BaseIAMRole&lt;/code>. So you should create a BaseIAMRole (potentially with no permissions).&lt;/p>
&lt;h3 id="deployment-scenario">Deployment scenario&lt;/h3>
&lt;p>Here&amp;rsquo;s an example situation:&lt;/p>
&lt;ul>
&lt;li>We would like Spinnaker to deploy to three AWS accounts, with account IDs 111111111111, 222222222222, and 333333333333. Each of these is a &lt;em>Managed Account&lt;/em>&lt;/li>
&lt;li>Choose one account (111111111111), that Spinnaker will log into directly. This is the &lt;em>Managing Account&lt;/em>&lt;/li>
&lt;li>We will end up with four IAM entities:
&lt;ul>
&lt;li>A &lt;em>Managing Account User&lt;/em> in account 111111111111 (&lt;code>arn:aws:iam::111111111111:user/managingAccount&lt;/code>)&lt;/li>
&lt;li>A &lt;em>Managed Account Role&lt;/em> in account 111111111111 (&lt;code>arn:aws:iam::111111111111:role/spinnakerManaged&lt;/code>)&lt;/li>
&lt;li>A &lt;em>Managed Account Role&lt;/em> in account 222222222222 (&lt;code>arn:aws:iam::222222222222:role/spinnakerManaged&lt;/code>)&lt;/li>
&lt;li>A &lt;em>Managed Account Role&lt;/em> in account 333333333333 (&lt;code>arn:aws:iam::333333333333:role/spinnakerManaged&lt;/code>)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>The &lt;em>Managing Account User&lt;/em> needs these permissions:
&lt;ul>
&lt;li>The &lt;code>sts:AssumeRole&lt;/code> permission for each of the Managed Account Roles&lt;/li>
&lt;li>The &lt;code>ec2:DescribeAvailabilityZones&lt;/code> permission&lt;/li>
&lt;li>The &lt;code>ec2:DescribeRegions&lt;/code> permission&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Each &lt;em>Managed Account Role&lt;/em> needs these:
&lt;ul>
&lt;li>&lt;strong>PowerUserAccess&lt;/strong>&lt;/li>
&lt;li>The &lt;code>iam:PassRole&lt;/code> permission for roles that will be assigned to EC2 instances that are being deployed&lt;/li>
&lt;li>A trust relationship with the Managing Account User (to allow the Managing Account User to assume the Managed Account Role)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h3 id="spinnaker-configuration-examples">Spinnaker configuration examples&lt;/h3>
&lt;p>Here&amp;rsquo;s a sample &lt;code>SpinnakerService&lt;/code> manifest block that supports the above:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: spinnaker.armory.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providers&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">aws&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accounts&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: aws-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">requiredGroupMembership&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providerVersion&lt;/span>: V1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">permissions&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accountId&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;111111111111&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">regions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-east-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">assumeRole&lt;/span>: role/spinnakerManaged
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: aws-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">requiredGroupMembership&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providerVersion&lt;/span>: V1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">permissions&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accountId&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;222222222222&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">regions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-east-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">assumeRole&lt;/span>: role/spinnakerManaged
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: aws-3
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">requiredGroupMembership&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providerVersion&lt;/span>: V1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">permissions&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accountId&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;333333333333&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">regions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-east-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">assumeRole&lt;/span>: role/spinnakerManaged
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#6272a4"># Because we&amp;#39;re baking in 111111111111, this must match the accountName that is associated with 111111111111&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">primaryAccount&lt;/span>: aws-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">bakeryDefaults&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">templateFile&lt;/span>: aws-ebs-shared.json
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#6272a4"># These creds are for our Baking IAM user in account 111111111111&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsAccessKey&lt;/span>: ABC123
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsSecretKey&lt;/span>: abc123
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">baseImages&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsAssociatePublicIpAddress&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultVirtualizationType&lt;/span>: hvm
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accessKeyId&lt;/span>: DEF456
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">secretAccessKey&lt;/span>: def456
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultKeyPairTemplate&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;{{name}}-keypair&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultRegions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaults&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">iamRole&lt;/span>: BaseIAMRole
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="configuring-spinnaker-to-use-aws-iam-roles">Configuring Spinnaker to use AWS IAM Roles&lt;/h2>
&lt;p>If you are not running Spinnaker on AWS, or if you do not want to use AWS IAM roles (or don&amp;rsquo;t have the ability to modify the roles attached to your Kubernetes instances), you can create an AWS IAM user and provide its credentials to Clouddriver to allow Clouddriver to interact with the various AWS APIs across multiple AWS Accounts.&lt;/p>
&lt;h3 id="iam-user-part-1-creating-a-managed-account-iam-role-in-each-your-target-aws-accounts">IAM User Part 1: Creating a Managed Account IAM Role in each your target AWS Accounts&lt;/h3>
&lt;p>In each account that you want Spinnaker to deploy to, you should create an IAM role for Spinnaker to assume.&lt;/p>
&lt;p>For each account you want to deploy to, perform the following:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Log in to the browser-based AWS Console&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Navigate to the IAM page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;IAM&amp;rdquo; under &amp;ldquo;Security, Identity, &amp;amp; Compliance&amp;rdquo;)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Roles&amp;rdquo; on the left hand side&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Create role&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>For now, for the &amp;ldquo;Choose the service that will use this role&amp;rdquo;, select &amp;ldquo;EC2&amp;rdquo;. We will change this later, because we want to specify an explicit consumer of this role later on.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Next: Permissions&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Search for &amp;ldquo;PowerUserAccess&amp;rdquo; in the search filter, and select the Policy called &amp;ldquo;PowerUserAcces&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Next: Tags&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Optionally, add tags that will identify this role.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Next: Review&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Enter a Role Name. For example, &amp;ldquo;DevSpinnakerManagedRole&amp;rdquo;. Optionally, add a description, such as &amp;ldquo;Allows Spinnaker Dev Cluster to perform actions in this account.&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Create Role&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>In the list of Roles, click on your new Role (you may have to scroll down or filter for it).&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Add inline policy&amp;rdquo; (on the right).&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on the &amp;ldquo;JSON&amp;rdquo; tab, and paste in this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Version&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;2012-10-17&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Statement&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Action&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;iam:ListServerCertificates&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;iam:PassRole&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Resource&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;*&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Effect&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;Allow&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Review Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Call it &amp;ldquo;PassRole-and-Certificates&amp;rdquo;, and click &amp;ldquo;Create Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Copy the Role ARN and save it. It should look something like this: &lt;code>arn:aws:iam::123456789012:role/DevSpinnakerManagedRole&lt;/code>. &lt;strong>This will be used in the section &amp;ldquo;IAM User Part 3&amp;rdquo; and in section &amp;ldquo;IAM User Part 6&amp;rdquo;&lt;/strong>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>You will end up with a Role ARN for each Managed / Target account. The Role names do not have to be the same (although it is a bit cleaner if they are). For example, you may end up with roles that look like this:&lt;/p>
&lt;ul>
&lt;li>&lt;code>arn:aws:iam::123456789012:role/DevSpinnakerManagedRole&lt;/code>&lt;/li>
&lt;li>&lt;code>arn:aws:iam::123456789013:role/DevSpinnakerManagedRole&lt;/code>&lt;/li>
&lt;li>&lt;code>arn:aws:iam::123456789014:role/DevSpinnakerManaged&lt;/code>&lt;/li>
&lt;/ul>
&lt;h3 id="iam-user-part-2-creating-the-baseiamrole-for-ec2-instances">IAM User Part 2: Creating the BaseIAMRole for EC2 instances&lt;/h3>
&lt;p>When deploying EC2 instances, Spinnaker currently requires that you attach a role for each instance (even if you don&amp;rsquo;t want to grant the instance any special permissions. If you do not specify an instance role, Spinnaker will default to a role called &lt;code>BaseIAMRole&lt;/code>, and it will throw an error if this does not exist. Therefore, you should at a minimum create an empty role called BaseIAMRole.&lt;/p>
&lt;ol>
&lt;li>Log into the browser-based AWS Console&lt;/li>
&lt;li>Navigate to the IAM page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;IAM&amp;rdquo; under &amp;ldquo;Security, Identity, &amp;amp; Compliance&amp;rdquo;)&lt;/li>
&lt;li>Click on &amp;ldquo;Roles&amp;rdquo; on the left side&lt;/li>
&lt;li>Click &amp;ldquo;Create role&amp;rdquo;&lt;/li>
&lt;li>Select &amp;ldquo;EC2&amp;rdquo;, and click &amp;ldquo;Next: Permissions&amp;rdquo;&lt;/li>
&lt;li>Click &amp;ldquo;Next: Tags&amp;rdquo;&lt;/li>
&lt;li>Optionally, add tags if required by your organization. Then, click &amp;ldquo;Next: Review&amp;rdquo;.&lt;/li>
&lt;li>Specify the Role Name as &amp;ldquo;BaseIAMRole&amp;rdquo;&lt;/li>
&lt;/ol>
&lt;h3 id="iam-user-part-3-creating-a-managing-account-iam-policy-in-your-primary-aws-account">IAM User Part 3: Creating a Managing Account IAM Policy in your primary AWS account&lt;/h3>
&lt;p>In the account that Spinnaker lives in (i.e., the AWS account that owns the EKS cluster where Spinnaker is installed), create an IAM Policy with permissions to assume all of your Managed Roles.&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Log into the AWS account where Spinnaker lives, into the browser-based AWS Console&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Navigate to the IAM page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;IAM&amp;rdquo; under &amp;ldquo;Security, Identity, &amp;amp; Compliance&amp;rdquo;)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Policies&amp;rdquo; on the left hand side&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Create Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on the &amp;ldquo;JSON&amp;rdquo; tab, and paste in the following:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Version&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;2012-10-17&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Statement&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Effect&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;Allow&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Action&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;ec2:DescribeAvailabilityZones&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;ec2:DescribeRegions&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Resource&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;*&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Action&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;sts:AssumeRole&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Resource&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;arn:aws:iam::123456789012:role/DevSpinnakerManagedRole&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;arn:aws:iam::123456789013:role/spinnakerManaged&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;arn:aws:iam::123456789014:role/DevSpinnakerManaged&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Effect&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;Allow&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Update the &lt;code>sts:AssumeRole&lt;/code> block with the list of Managed Roles you created in &lt;strong>IAM User Part 1&lt;/strong>.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Review Policy&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Create a name for your policy, such as &amp;ldquo;DevSpinnakerManagingPolicy&amp;rdquo;. Optionally, add a descriptive description. Copy the name of the policy. &lt;strong>This will be used in the next section, &amp;ldquo;IAM User Part 4&amp;rdquo;&lt;/strong>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>On the list policies, click your newly-created Policy.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>&lt;em>(This policy could also be attached inline directly to the IAM User, rather than creating a standalone policy)&lt;/em>&lt;/p>
&lt;h3 id="iam-user-part-4-creating-a-managing-account-iam-user-with-access-to-the-managing-account-policy">IAM User Part 4: Creating a Managing Account IAM User with access to the Managing Account Policy&lt;/h3>
&lt;p>The IAM user we&amp;rsquo;re creating can be in any AWS account, although it may make sense to place it in the same account where Spinnaker lives if Spinnaker is installed in AWS.&lt;/p>
&lt;ol>
&lt;li>Log into the AWS account where Spinnaker lives, into the browser-based AWS Console&lt;/li>
&lt;li>Navigate to the IAM page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;IAM&amp;rdquo; under &amp;ldquo;Security, Identity, &amp;amp; Compliance&amp;rdquo;)&lt;/li>
&lt;li>Click on &amp;ldquo;Users&amp;rdquo; on the left side&lt;/li>
&lt;li>Click on &amp;ldquo;Add user&amp;rdquo;&lt;/li>
&lt;li>Specify a logical user name, such as &amp;ldquo;DevSpinnakerManagingAccount&amp;rdquo;&lt;/li>
&lt;li>Check the &amp;ldquo;Programmatic access&amp;rdquo; checkbox&lt;/li>
&lt;li>Select &amp;ldquo;Attach existing policies directly&amp;rdquo;&lt;/li>
&lt;li>Find the policy you created in &amp;ldquo;IAM User Part 2&amp;rdquo;. and select it with the checkbox.&lt;/li>
&lt;li>Click &amp;ldquo;Next: Tags&amp;rdquo;&lt;/li>
&lt;li>Optionally, add tags that will identify this user&lt;/li>
&lt;li>Click &amp;ldquo;Next: Review&amp;rdquo;&lt;/li>
&lt;li>Click &amp;ldquo;Create user&amp;rdquo;&lt;/li>
&lt;li>Copy the &amp;ldquo;Access key ID&amp;rdquo; and &amp;ldquo;Secret access key&amp;rdquo; (you&amp;rsquo;ll have to click &amp;ldquo;Show&amp;rdquo;). &lt;strong>This will be used later, in &amp;ldquo;IAM User Part 6&amp;rdquo;&lt;/strong>&lt;/li>
&lt;li>Click &amp;ldquo;Close&amp;rdquo;&lt;/li>
&lt;li>Click on the &amp;ldquo;User name&amp;rdquo; for the user that you just created.&lt;/li>
&lt;li>Copy the &amp;ldquo;User ARN&amp;rdquo;. This will look something like this: &lt;code>arn:aws:iam::123456789010:user/DevSpinnakerManagingAccount&lt;/code>. &lt;strong>This will be used in the next section, &amp;ldquo;IAM User Part 5&amp;rdquo;&lt;/strong>&lt;/li>
&lt;/ol>
&lt;h3 id="iam-user-part-5-configuring-the-managed-accounts-to-trust-the-managing-account-iam-user">IAM User Part 5: Configuring the Managed Accounts to trust the Managing Account IAM User&lt;/h3>
&lt;p>Now that we know what user will be assuming each of the Managed Roles, we must configure the Managed Roles (Target Roles) to trust and allow the Managing (Assuming) User to assume them. This is called a &amp;ldquo;Trust Relationship&amp;rdquo; and is configured each of the Managed Roles (Target Roles).&lt;/p>
&lt;p>For each account you want to deploy to, perform the following:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>Log into the browser-based AWS Console&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Navigate to the IAM page (click on &amp;ldquo;Services&amp;rdquo; at the top, then on &amp;ldquo;IAM&amp;rdquo; under &amp;ldquo;Security, Identity, &amp;amp; Compliance&amp;rdquo;)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Roles&amp;rdquo; on the left hand side&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Find the Managed Role that you created earlier in this account, and click on the Role Name to edit the role.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on the &amp;ldquo;Trust relationships&amp;rdquo; tab.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Click on &amp;ldquo;Edit trust relationship&amp;rdquo;&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Replace the Policy Document with this (Update the ARN with the User ARN from &amp;ldquo;IAM User Part 4&amp;rdquo;)&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>{
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Version&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;2012-10-17&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Statement&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Effect&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;Allow&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Principal&amp;#34;&lt;/span>: {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;AWS&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;arn:aws:iam::123456789010:user/DevSpinnakerManagingAccount&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;Action&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;sts:AssumeRole&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;li>
&lt;p>Click &amp;ldquo;Update Trust Policy&amp;rdquo;, in the bottom right.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;h3 id="iam-user-part-6-adding-the-managing-account-user-and-managed-accounts-to-spinnaker">IAM User Part 6: Adding the Managing Account User and managed accounts to Spinnaker&lt;/h3>
&lt;p>The Clouddriver pod(s) should be now able to assume each of the Managed Roles (Target Roles) in each of your Deployment Target accounts. We need to configure Spinnaker to be aware of the accounts and roles it is allowed to consume.&lt;/p>
&lt;p>For each of the Managed (Target) accounts you want to deploy to, add a new entry to the &lt;code>accounts&lt;/code> array in &lt;code>SpinnakerService&lt;/code> manifest as follows:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: spinnaker.armory.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providers&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">aws&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accounts&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: aws-dev-1 &lt;span style="color:#6272a4"># Should be a unique name which is used in the Spinnaker UI and API to identify the deployment target. For example, aws-dev-1 or aws-dev-2&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">requiredGroupMembership&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providerVersion&lt;/span>: V1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">permissions&lt;/span>: {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accountId&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;111111111111&amp;#39;&lt;/span> &lt;span style="color:#6272a4"># Should be the account ID for the Managed Role (Target Role) you are assuming. For example, if the role ARN is arn:aws:iam::123456789012:role/ DevSpinnakerManagedRole, then ACCOUNT_ID would be 123456789012&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">regions&lt;/span>: &lt;span style="color:#6272a4"># Configure the regions you want to deploy to&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-east-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">assumeRole&lt;/span>: role/spinnakerManaged &lt;span style="color:#6272a4"># Should be the full role name within the account, including the type of object (role). For example, if the role ARN is arn:aws:iam::123456789012:role/DevSpinnakerManagedRole, then ROLE_NAME would be role/DevSpinnakerManagedRole&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">primaryAccount&lt;/span>: aws-dev-1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">bakeryDefaults&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">templateFile&lt;/span>: aws-ebs-shared.json
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">baseImages&lt;/span>: []
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsAssociatePublicIpAddress&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultVirtualizationType&lt;/span>: hvm
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#6272a4"># These creds are for our Baking IAM user in account 111111111111&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsAccessKey&lt;/span>: ABC123
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsSecretKey&lt;/span>: abc123
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accessKeyId&lt;/span>: DEF456 &lt;span style="color:#6272a4"># AWS access key and secret access key from &amp;#34;IAM User Part 4&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">secretAccessKey&lt;/span>: def456 &lt;span style="color:#6272a4"># AWS access key and secret access key from &amp;#34;IAM User Part 4&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultKeyPairTemplate&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#39;{{name}}-keypair&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaultRegions&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: us-west-2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">defaults&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">iamRole&lt;/span>: BaseIAMRole
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="iam-user-part-7-addingenabling-the-aws-cloudprovider-configuration-to-spinnaker">IAM User Part 7: Adding/Enabling the AWS CloudProvider configuration to Spinnaker&lt;/h3>
&lt;p>Apply the changes done in &lt;code>Spinnakerservice&lt;/code> manifest:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl -n &amp;lt;spinnaker namespace&amp;gt; apply -f &amp;lt;SpinnakerService manifest file&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Continuous-Deployment: Configure Spinnaker on AWS for Disaster Recovery</title><link>/continuous-deployment/armory-admin/aws/aws-dr/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/armory-admin/aws/aws-dr/</guid><description>
&lt;h2 id="spinnaker-disaster-recovery">Spinnaker disaster recovery&lt;/h2>
&lt;p>The following guide describes how to configure Spinnaker&lt;sup>TM&lt;/sup> deployment on AWS to be more resilient and perform disaster recovery (DR). Spinnaker does not function in multi-master mode, which means that active-active is not supported at this time. Instead, this guide describes how to achieve an active-passive setup. This results in two instances of Spinnaker deployed into two regions that can fail independently.&lt;/p>
&lt;figure>
&lt;img src="/images/cloud-resources/aws/armory-active-passive.png"
alt="Diagram of Armory deployment on AWS with disaster recovery" width="75%" height="75%"/>
&lt;/figure>
&lt;h2 id="requirements">Requirements&lt;/h2>
&lt;ul>
&lt;li>The passive instance will have the same permissions as the active instance&lt;/li>
&lt;li>The active instance is configured to use AWS &lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html">Aurora&lt;/a> and &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/gsg/GetStartedWithS3.html">S3&lt;/a> for persistent storage&lt;/li>
&lt;li>Your Secret engine/store has been configured for disaster recovery&lt;/li>
&lt;li>All other services integrated with Spinnaker, such as your Continuous Integration (CI) system, are configured for disaster recovery&lt;/li>
&lt;/ul>
&lt;h2 id="what-a-passive-instance-is">What a passive instance is&lt;/h2>
&lt;p>A passive instance means that the deployment:&lt;/p>
&lt;ul>
&lt;li>Is not reachable by its known endpoints while passive (external and internal)&lt;/li>
&lt;li>Does not schedule pipelines&lt;/li>
&lt;li>Cannot have pipelines triggered by CI jobs&lt;/li>
&lt;/ul>
&lt;h2 id="storage-considerations">Storage considerations&lt;/h2>
&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
The storage you use should be replicated across regions since these contain all the application and pipeline definitions.
&lt;/div>
&lt;p>Armory recommends using a relational database for Orca and Clouddriver. For Orca, a relational database helps maintain integrity. For Clouddriver, it reduces the time to recovery. Even though any MySQL version 5.7+ database can be used, Armory recommends using AWS Aurora MySQL for the following reasons:&lt;/p>
&lt;ul>
&lt;li>More performant than RDS MySQL&lt;/li>
&lt;li>Better high availability than RDS MySQL&lt;/li>
&lt;li>Less downtime for patching and maintenance&lt;/li>
&lt;li>Support for &lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Replication.CrossRegion.html">cross-region replication&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>Note the following guidelines about storage and caching:&lt;/p>
&lt;ul>
&lt;li>S3 buckets should be set up with cross-region replication turned on. See &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html">Replication&lt;/a> in the AWS documentation.&lt;/li>
&lt;li>Consider the following if you plan to use Aurora MySQL:
&lt;ul>
&lt;li>&lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Replication.CrossRegion.html">Replicating Amazon Aurora MySQL DB Clusters Across AWS Regions&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Encryption.html">Encrypting Aurora databases&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.html">Backing up and Restoring Aurora clusters&lt;/a>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Redis - Each service should be configured to use its &lt;a href="https://www.spinnaker.io/setup/productionize/caching/externalize-redis/#configure-per-service-redis">own Redis&lt;/a>. With Armory services configured to use a relational database or S3 as a permanent backing store Redis is now used for caching. For disaster recovery purposes it is no longer required that Redis is recoverable. A couple things to note are:
&lt;ul>
&lt;li>Gate - Users will need to login again&lt;/li>
&lt;li>Fiat - Will need to sync user permissions and warmup&lt;/li>
&lt;li>Orca - Will lose pending executions&lt;/li>
&lt;li>Rosco - Will lose bake logs&lt;/li>
&lt;li>Igor - Will lose last executed Jenkins job cursor&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h2 id="kubernetes-guidelines">Kubernetes guidelines&lt;/h2>
&lt;p>Keep the following guidelines in mind when configuring Kubernetes.&lt;/p>
&lt;h3 id="control-plane">Control plane&lt;/h3>
&lt;ul>
&lt;li>The Kubernetes control plane should be configured to use multiple availability zones in order to handle availability zone failure. For EKS clusters they are available across availability zones by default.&lt;/li>
&lt;/ul>
&lt;h3 id="workers">Workers&lt;/h3>
&lt;p>The following guidelines are meant for EKS workers:&lt;/p>
&lt;ul>
&lt;li>The Kubernetes cluster should be able to support the Armory load. Use the same instance type and configure the same number of worker nodes as the primary.&lt;/li>
&lt;li>There needs to be at least 1 node in each availability zone the cluster is using.&lt;/li>
&lt;li>The autoscaling group has to have a proper termination policy. Use one or all of the following policies: OldestLaunchConfiguration, OldestLaunchTemplate, OldestInstance. This allows the underlying worker AMIs to be rotated more easily.&lt;/li>
&lt;li>Ideally, Armory pods for each service that do not have a replica of 1 should be spread out among the various workers. This means that pod affinity/anti-affinity should be configured. With this configuration Armory will be able to handle availability zone failures better.&lt;/li>
&lt;/ul>
&lt;h2 id="dns-considerations">DNS considerations&lt;/h2>
&lt;p>A good way to handle failover is to set up DNS entries as a CNAME for each Armory installation.&lt;/p>
&lt;p>For example:&lt;/p>
&lt;ul>
&lt;li>Active Spinnaker accessible through &lt;code>us-west.spinnaker.acme.com&lt;/code> and &lt;code>api.us-west-spinnaker.acme.com&lt;/code> load balancers.&lt;/li>
&lt;li>Passive Spinnaker accessible through &lt;code>us-east.spinnaker.acme.com&lt;/code> and &lt;code>api.us-east-spinnaker.acme.com&lt;/code> load balancers.&lt;/li>
&lt;li>Add DNS entries &lt;code>spinnaker.acme.com&lt;/code> with a CNAME pointing to &lt;code>us-west-spinnaker.acme.com&lt;/code> (same for &lt;code>api&lt;/code> subdomain) and a small TTL (1 minute to 5 minute).&lt;/li>
&lt;/ul>
&lt;p>In this setup, point your CNAME to &lt;code>us-east&lt;/code> when a disaster event happens.&lt;/p>
&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
Armory does not recommend setting up DNS with a backup IP address when manual steps are required for failover.
&lt;/div>
&lt;h2 id="setting-up-a-passive-spinnaker">Setting up a passive Spinnaker&lt;/h2>
&lt;p>To make a passive version of Spinnaker, use the same configuration files as the current active installation for your starting point. Then, modify it to deactivate certain services before deployment.&lt;/p>
&lt;p>To keep the configurations in sync, set up automation to create a passive Spinnaker configuration every time a configuration is changed for the active Spinnaker. An easy way to do this is to use &lt;a href="https://www.mirantis.com/blog/introduction-to-kustomize-part-2-overriding-values-with-overlays/">Kustomize Overlays&lt;/a>.&lt;/p>
&lt;h3 id="configuration-modifications">Configuration modifications&lt;/h3>
&lt;p>Make sure you set replicas for all Spinnaker services to 0. Example in &lt;code>SpinnakerService&lt;/code> manifest for service &lt;code>gate&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: spinnaker.armory.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">deploymentEnvironment&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">customSizing&lt;/span>: &lt;span style="color:#6272a4"># Configure, validate, and view the component sizings for the Armory services.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">gate&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">replicas&lt;/span>: &lt;span style="color:#bd93f9">0&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Once you&amp;rsquo;re done configuring for the passive Spinnaker, run &lt;code>kubectl -n &amp;lt;spinnaker namespace&amp;gt; apply -f &amp;lt;SpinnakerService manifest&amp;gt;&lt;/code> to deploy.&lt;/p>
&lt;div class="alert alert-primary" role="alert">
&lt;h4 class="alert-heading">Note&lt;/h4>
Armory recommends performing a DR exercise run to make sure the passive Armory is set up correctly. Ideally, the DR exercise should include both failing over to the DR region and failing back to the primary region.
&lt;/div>
&lt;h2 id="performing-disaster-recovery">Performing disaster recovery&lt;/h2>
&lt;p>If the active Spinnaker is failing, the following actions need to be taken:&lt;/p>
&lt;h3 id="activating-the-passive-spinnaker">Activating the passive Spinnaker&lt;/h3>
&lt;p>Perform the following tasks when you make the passive Spinnaker into the active Spinnaker:&lt;/p>
&lt;ul>
&lt;li>Use the same version of Operator to deploy the passive Spinnaker installation that was used to deploy the active Spinnaker.&lt;/li>
&lt;li>AWS Aurora
&lt;ul>
&lt;li>Promote another cluster in the global database to have read/write capability.&lt;/li>
&lt;li>Update &lt;code>SpinnakerService&lt;/code> manifest to point to the promoted database if the database endpoint and/or the database credentials have changed.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Create the Redis clusters.&lt;/li>
&lt;li>Activate the passive instance.
&lt;ul>
&lt;li>Set the replicas to more than 0. Ideally, this should be set to the same number of replicas that the active Armory used.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Change the DNS CNAME if it is not already pointing to the passive Armory installation.&lt;/li>
&lt;li>If the Armory that is not working is accessible, it should be deactivated&lt;/li>
&lt;/ul>
&lt;h2 id="recovery-time-objective-rto">Recovery Time Objective (RTO)&lt;/h2>
&lt;p>Restoration time is dependent on the time it takes to restore the database, the Spinnaker services, and the time it takes to update DNS. Most Spinnaker services that fail should recover within a 10-minute timeframe. Clouddriver may take longer especially when at scale because it needs to reconnect to all configured cloud accounts. Note that services are limited to local resources, which are configured to be redundant (databases, nodes, etc.) or highly available. In addition to Clouddriver, the following services may also take additional time to restore since Redis needs time to warm up the cache:&lt;/p>
&lt;ul>
&lt;li>Orca&lt;/li>
&lt;li>Igor&lt;/li>
&lt;li>Echo&lt;/li>
&lt;li>Fiat&lt;/li>
&lt;/ul>
&lt;h2 id="recovery-point-objective-rpo">Recovery Point Objective (RPO)&lt;/h2>
&lt;p>This is the state to which Spinnaker will recover the affected systems in case of a failure, such as database corruption. The current Spinnaker RPO target is 24 hours maximum, tied to the last snapshot of the database.&lt;/p>
&lt;h2 id="other-resources">Other resources&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://blog.verygoodsecurity.com/posts/kubernetes-multi-az-deployments-using-pod-anti-affinity/">Kubernetes Multi-AZ deployments Using Pod Anti-Affinity&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Replication.CrossRegion.html">Replicating Amazon Aurora MySQL DB Clusters Across AWS Regions&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html#aurora-global-database-failover">Failover for Aurora Global Databases&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://docs.aws.amazon.com/eks/index.html">Amazon EKS&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/index.html">Amazon ElastiCache for Redis&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/backups-exporting.html">Amazon ElastiCache for Redis - Exporting Backup to S3&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.mirantis.com/blog/introduction-to-kustomize-part-2-overriding-values-with-overlays/">Kustomize Overlays&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Continuous-Deployment: Configure AWS Lambda for Spinnaker™</title><link>/continuous-deployment/armory-admin/aws/aws-lambda/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/armory-admin/aws/aws-lambda/</guid><description>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>Armory supports using AWS Lambda as a deployment target for your apps and includes a variety of Lambda specific stages. Enabling the full suite of features for Lambda support requires updating the configurations for core Spinnaker services and adding the Lambda Plugin. Depending on how you manage Spinnaker, this requires Operator config updates.&lt;/p>
&lt;h2 id="requirements">Requirements&lt;/h2>
&lt;p>AWS Lambda support requires either Spinnaker 1.23+ or Armory 2.23+.&lt;/p>
&lt;h2 id="configuration">Configuration&lt;/h2>
&lt;p>If you are using the &lt;a href="/continuous-deployment/installation/armory-operator/">Armory Operator&lt;/a>, check out the &lt;a href="https://github.com/armory/spinnaker-kustomize-patches/pull/70">Spinnaker Kustomize Patches repo&lt;/a> for an example on how to easily add the configurations required to enable AWS Lambda.&lt;/p>
&lt;h3 id="enabling-aws-lambda">Enabling AWS Lambda&lt;/h3>
&lt;p>First, enable Lambda as a deployment target for your apps by updating the settings for Clouddriver and the UI (Deck).&lt;/p>
&lt;p>In the &lt;code>spinnakerservice&lt;/code> manifest, update the &lt;code>spinnakerConfig&lt;/code> section to include the properties for Lambda:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: spinnaker.armory.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">profiles&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">deck&lt;/span>: &lt;span style="color:#6272a4"># Enables Lambda Functions UI&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">settings-local.js&lt;/span>: |&lt;span style="color:#f1fa8c">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f1fa8c"> &lt;/span> window.spinnakerSettings.feature.functions = true
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">clouddriver&lt;/span>: &lt;span style="color:#6272a4"># Enables Lambda Functions in &amp;#34;Infrastructure&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">aws&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">features&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">lambda&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accounts&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name: aws-dev # NOTE&lt;/span>: This merge is Index based - so if you do not want to overwrite spinnakerConfig.config.providers.aws.accounts you must create another account in the list
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">lambdaEnabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accountId&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;xxxxxxxx&amp;#34;&lt;/span> &lt;span style="color:#6272a4"># (Required)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">assumeRole&lt;/span>: role/spinnaker &lt;span style="color:#6272a4"># (Required)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="adding-aws-lambda-plugin">Adding AWS Lambda Plugin&lt;/h3>
&lt;p>Next, add the Lambda Plugin to include the Lambda stages (Delete, Deploy, Invoke, and Route) in the UI.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">#-----------------------------------------------------------------------------------------------------------------&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4"># Example configuration for adding AWS Lambda plugin to spinnaker.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">#&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4"># Documentation: https://github.com/spinnaker-plugins/aws-lambda-deployment-plugin-spinnaker&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#6272a4">#-----------------------------------------------------------------------------------------------------------------&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: spinnaker.armory.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">profiles&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">gate&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnaker&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">extensibility&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">deck-proxy&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">plugins&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">Aws.LambdaDeploymentPlugin&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">version&lt;/span>: &lt;span style="color:#bd93f9">1.0.1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">repositories&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsLambdaDeploymentPluginRepo&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">url&lt;/span>: https://raw.githubusercontent.com/spinnaker-plugins/aws-lambda-deployment-plugin-spinnaker/master/plugins.json
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">orca&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnaker&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">extensibility&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">plugins&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">Aws.LambdaDeploymentPlugin&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">version&lt;/span>: &lt;span style="color:#bd93f9">1.0.1&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#6272a4"># extensions:&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#6272a4"># Aws.LambdaDeploymentStage:&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#6272a4"># enabled: true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">repositories&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsLambdaDeploymentPluginRepo&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">id&lt;/span>: awsLambdaDeploymentPluginRepo
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">url&lt;/span>: https://raw.githubusercontent.com/spinnaker-plugins/aws-lambda-deployment-plugin-spinnaker/master/plugins.json
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="applying-config-updates">Applying config updates&lt;/h3>
&lt;p>Once you make the required config changes, apply them by running the command for Operator:&lt;/p>
&lt;p>Assuming the Armory instance lives in the &lt;code>spinnaker&lt;/code> namespace, run the following command to apply the changes:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl -n spinnaker apply -f spinnakerservice.yml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="known-issues">Known issues&lt;/h2>
&lt;h4 id="lambda-ui-issue">Lambda UI issue&lt;/h4>
&lt;p>There is a &lt;a href="https://github.com/spinnaker/spinnaker/issues/6271">UI bug&lt;/a> related to the caching agent that prevents Lambda functions from being displayed in the UI when there are no other clusters associated with the Application. In other words, in order for the function to show up in &amp;ldquo;Functions&amp;rdquo; tab, there needs to be a cluster (such as an AWS ASG/EC2 instance) deployed for that application.&lt;/p>
&lt;p>&lt;strong>Affected versions&lt;/strong>: 2.23.0 (1.23.0) - 2.26.2
&lt;strong>Fixed version&lt;/strong>: 2.26.3&lt;/p>
&lt;h2 id="references">References&lt;/h2>
&lt;p>See the following links for more information:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://github.com/spinnaker-plugins/aws-lambda-deployment-plugin-spinnaker">GitHub - AWS-Lambda-Deployment-Plugin-Spinnaker&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://aws.amazon.com/blogs/opensource/how-to-integrate-aws-lambda-with-spinnaker/">AWS Blog - How to integrate AWS Lambda with Spinnaker&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Continuous-Deployment: Configure AWS Networking for Spinnaker</title><link>/continuous-deployment/armory-admin/aws/aws-subnets-configure/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/armory-admin/aws/aws-subnets-configure/</guid><description>
&lt;h2 id="aws-resources">AWS resources&lt;/h2>
&lt;ul>
&lt;li>AWS VPC &lt;a href="https://docs.aws.amazon.com/vpc/index.html">guides&lt;/a>&lt;/li>
&lt;li>AWS &lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html">VPCs and subnets&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="configuring-subnets">Configuring subnets&lt;/h2>
&lt;p>Spinnaker groups subnets into a single subnet name across multiple availability zones. This makes it simpler for end-users of Spinnaker to choose a group of subnets within a VPC that have a given purpose such as &lt;code>ec2-subnets&lt;/code>, &lt;code>elb-subnets&lt;/code> or &lt;code>public-subnets&lt;/code>. This allows Spinnaker to place the machines within that group and ensure equal redundancy across zones. Below is a logical representation of how Spinnaker groups multiple subnets together. If you want to &lt;strong>make a subnet accessible to Spinnaker&lt;/strong> you&amp;rsquo;ll have to add a tag and value to the subnet with the following: &lt;code>immutable_metadata={&amp;quot;purpose&amp;quot;:&amp;quot;example-purpose&amp;quot;}&lt;/code>&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-10-05-at-3.53.35-PM.png"/>
&lt;/figure>
&lt;p>Conceptually, this is how Spinnaker groups subnets logically.&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-04-18-at-4.07.10-PM.png"
alt="subnets groups"/>
&lt;/figure>
&lt;h2 id="verifying-subnet-configuration">Verifying subnet configuration&lt;/h2>
&lt;p>Once you configured the purpose of your subnets you can use the Spinnaker API to double check that settings have been noticed. It takes between 30 seconds and 2 minutes for the changes to be picked up. After that time period you can run:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>curl http://&amp;lt;YOUR_GATE_ENDPOINT&amp;gt;/subnets/aws
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>You can expect to receive a response similar to:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>[
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;account&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;default-aws-account&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;availabilityZone&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;us-west-1b&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;availableIpAddressCount&amp;#34;&lt;/span>: &lt;span style="color:#bd93f9">4088&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;cidrBlock&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;172.31.0.0/20&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;deprecated&amp;#34;&lt;/span>: &lt;span style="color:#ff79c6">false&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;id&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;subnet-7bd69322&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;purpose&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;external&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;region&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;us-west-1&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;state&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;available&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;target&amp;#34;&lt;/span>: &lt;span style="color:#ff79c6">null&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;type&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;aws&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;vpcId&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;vpc-63327b06&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>]
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If the &lt;code>purpose&lt;/code> field is non-null then things are configured correctly.&lt;/p>
&lt;h2 id="i-dont-see-my-subnets-or-vpcs">I don&amp;rsquo;t see my subnets or VPCs&lt;/h2>
&lt;p>Spinnaker caches as much as possible to keep performance through the UI responsive. If you don&amp;rsquo;t see the subnets and you believe you configured them correctly, then make sure to refresh the cache. You can find the cache going to the &lt;em>config&lt;/em> section of your application and clicking &lt;em>refresh all caches&lt;/em>. You should also make sure to refresh your browswer cache by using your browser&amp;rsquo;s development tools and deleting any browser databases.&lt;/p>
&lt;figure>
&lt;img src="/images/[75a6d5a8966231fe9cfeba7a14d57864]_Image&amp;#43;2017-04-13&amp;#43;at&amp;#43;1.59.38&amp;#43;PM.png"
alt="refresh all caches"/>
&lt;/figure></description></item><item><title>Continuous-Deployment: Configure Amazon Simple Storage Service (S3) Artifacts</title><link>/continuous-deployment/armory-admin/aws/artifacts-s3-configure/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/armory-admin/aws/artifacts-s3-configure/</guid><description>
&lt;h2 id="s3-artifact-configuration">S3 artifact configuration&lt;/h2>
&lt;p>The example on this page describes how to reference a Helm chart tarball for
later use during deployment.&lt;/p>
&lt;p>This is a quick walkthrough of how to configure Spinnaker&lt;sup>TM&lt;/sup> and
Armory to access an
&lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/gsg/GetStartedWithS3.html">S3&lt;/a>
bucket as a source of artifacts. Many of the configurations below have
additional options that may be useful (or possibly required).&lt;/p>
&lt;h2 id="enable-s3-artifacts">Enable S3 artifacts&lt;/h2>
&lt;p>If you&amp;rsquo;ve just installed Spinnaker or Armory, you need to enable S3 as an artifact source.&lt;/p>
&lt;p>Add the following snippet to &lt;code>SpinnakerService&lt;/code> manifest:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: spinnaker.armory.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">features&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">artifacts&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">artifacts&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">s3&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="add-s3-account">Add S3 account&lt;/h2>
&lt;p>You only need to configure the S3 credentials as an account &amp;ndash; all buckets
that account has access to can be referenced after that.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: spinnaker.armory.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">features&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">artifacts&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">artifacts&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">s3&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accounts&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: my-s3-account
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">region&lt;/span>: us-west-2 &lt;span style="color:#6272a4"># S3 region&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsAccessKeyId&lt;/span>: ABCDEF01234... &lt;span style="color:#6272a4"># Your AWS Access Key ID. If not provided, Spinnaker will try to find AWS credentials as described at http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html#credentials-default&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">awsSecretAccessKey&lt;/span>: abc &lt;span style="color:#6272a4"># Your AWS Secret Key. This field supports &amp;#34;encrypted&amp;#34; secret references&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Apply your changes with &lt;code>kubectl -n &amp;lt;spinnaker namespace&amp;gt; apply -f &amp;lt;SpinnakerService manifest&amp;gt;&lt;/code>.&lt;/p></description></item><item><title>Continuous-Deployment: Connect Spinnaker to Amazon Elastic Container Registry</title><link>/continuous-deployment/armory-admin/aws/artifacts-ecr-connect/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/armory-admin/aws/artifacts-ecr-connect/</guid><description>
&lt;h2 id="adding-ecr-as-a-docker-registry">Adding ECR as a Docker registry&lt;/h2>
&lt;p>When configuring a registry, you normally use standard &lt;code>SpinnakerService&lt;/code>
configuration when using the Operator.&lt;/p>
&lt;h3 id="update-your-spinnaker-installation">Update your Spinnaker installation&lt;/h3>
&lt;p>The configuration below must go under &lt;code>spinnakerConfig.config.providers&lt;/code>,
as explained in &lt;a href="/continuous-deployment/armory-admin/artifacts-docker-connect/">Connect Docker Registries&lt;/a>.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: spinnaker.armory.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providers&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">dockerRegistry&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">enabled&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">primaryAccount&lt;/span>: dockerhub
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">accounts&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">name&lt;/span>: dockerhub
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">requiredGroupMembership&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">providerVersion&lt;/span>: V1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">address&lt;/span>: &lt;span style="color:#bd93f9">012345678910.&lt;/span>dkr.ecr.us-east-1.amazonaws.com
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">username&lt;/span>: AWS
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">passwordCommand&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;aws --region us-east-2 ecr get-authorization-token --output text --query &amp;#39;authorizationData[].authorizationToken&amp;#39; | base64 -d | sed &amp;#39;s/^AWS://&amp;#39;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Success! Now you can use ECR as a Docker registry in the configuration stage.&lt;/p>
&lt;figure>
&lt;img src="/images/armory-admin/artifacts/ecr-test.png"/>
&lt;/figure></description></item><item><title>Continuous-Deployment: Expose Spinnaker on AWS EKS</title><link>/continuous-deployment/armory-admin/aws/exposing-spinnaker/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/armory-admin/aws/exposing-spinnaker/</guid><description>
&lt;h2 id="dns-preparation">DNS Preparation&lt;/h2>
&lt;p>In this tutorial, you set up two CNAME entries in your DNS. You
won&amp;rsquo;t be able to actually configure the DNS until you get an A record from AWS
after creating the LoadBalancer, but you need to select the names in order to
configure the LoadBalancer. This example uses &lt;code>demo.armory.io&lt;/code>
to be the Deck service (the UI), and &lt;code>gate.demo.armory.io&lt;/code> to be the Gate
service (the API).&lt;/p>
&lt;h2 id="exposing-armory-on-eks-with-a-public-load-balancer">Exposing Armory on EKS with a public Load Balancer&lt;/h2>
&lt;h3 id="create-a-loadbalancer-service">Create a LoadBalancer service&lt;/h3>
&lt;p>While there are many ways to expose Armory, we find the method described in this post to be the easiest way to get started. If your organization has other requirements, this post may be helpful as you start working through the process.&lt;/p>
&lt;p>Update your &lt;code>SpinnakerService&lt;/code> manifest with the following example &lt;code>expose&lt;/code> configuration, which will automatically create one Kubernetes service LoadBalancer for the API (Gate) and one for the UI (Deck):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiversion&lt;/span>: spinnaker.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ... &lt;span style="color:#6272a4"># rest of config omitted for brevity&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">expose&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">type&lt;/span>: service
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">service&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">type&lt;/span>: LoadBalancer
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Save and apply the configuration. After some time, you can see the LoadBalancer CNAMEs that were created:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">NAMESPACE&lt;/span>&lt;span style="color:#ff79c6">={&lt;/span>spinnaker namespace&lt;span style="color:#ff79c6">}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">API_URL&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#ff79c6">$(&lt;/span>kubectl -n &lt;span style="color:#8be9fd;font-style:italic">$NAMESPACE&lt;/span> get spinsvc spinnaker -o &lt;span style="color:#8be9fd;font-style:italic">jsonpath&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#39;{.status.apiUrl}&amp;#39;&lt;/span>&lt;span style="color:#ff79c6">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">UI_URL&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#ff79c6">$(&lt;/span>kubectl -n &lt;span style="color:#8be9fd;font-style:italic">$NAMESPACE&lt;/span> get spinsvc spinnaker -o &lt;span style="color:#8be9fd;font-style:italic">jsonpath&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#39;{.status.uiUrl}&amp;#39;&lt;/span>&lt;span style="color:#ff79c6">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="secure-with-ssl-on-eks">Secure with SSL on EKS&lt;/h3>
&lt;p>This tutorial presumes you&amp;rsquo;ve already created a certificate in the &lt;a href="https://aws.amazon.com/certificate-manager/">AWS Certificate Manager&lt;/a>.&lt;/p>
&lt;p>Update and apply the &lt;code>SpinnakerService&lt;/code> manifest to specify the DNS names for Gate and Deck, and to provide annotations specific for EKS LoadBalancers:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiversion&lt;/span>: spinnaker.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">security&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">apiSecurity&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">overrideBaseUrl&lt;/span>: https://spinnaker-gate.armory.io &lt;span style="color:#6272a4"># Specify your DNS name for Gate with https scheme&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">uiSecurity&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">overrideBaseUrl&lt;/span>: https://spinnaker.armory.io &lt;span style="color:#6272a4"># Specify your DNS name for Deck with https scheme&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ... &lt;span style="color:#6272a4"># rest of config omitted for brevity&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">expose&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">type&lt;/span>: service
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">service&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">type&lt;/span>: LoadBalancer
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">annotations&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">service.beta.kubernetes.io/aws-load-balancer-backend-protocol&lt;/span>: http
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">service.beta.kubernetes.io/aws-load-balancer-ssl-cert&lt;/span>: &amp;lt;ACM CERT ARN&amp;gt; &lt;span style="color:#6272a4"># Replace with your cert ARN&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">service.beta.kubernetes.io/aws-load-balancer-ssl-ports&lt;/span>: &lt;span style="color:#bd93f9">80&lt;/span>,&lt;span style="color:#bd93f9">443&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Assuming that Armory is installed in &lt;code>spinnaker&lt;/code> namespace:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl -n spinnaker apply -f spinnakerservice.yml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="enabling-sticky-sessions">Enabling sticky sessions&lt;/h3>
&lt;p>If your Armory installation will be using authentication and you expect to scale the API server (Gate) beyond more than one instance you&amp;rsquo;ll want to enable sticky sessions. This will ensure that clients will connect and authenticate with the same server each time. Otherwise, you may be forced to reauthenticate if you get directed to a new server. To enable sticky sessions, you&amp;rsquo;ll want to enable session affinity on the Gate service created above.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">GATE_SVC&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&amp;lt;spin-gate/spin-gate-public&amp;gt; &lt;span style="color:#6272a4"># spin-gate&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>kubectl -n &lt;span style="color:#f1fa8c">${&lt;/span>&lt;span style="color:#8be9fd;font-style:italic">NAMESPACE&lt;/span>&lt;span style="color:#f1fa8c">}&lt;/span> patch service/&lt;span style="color:#8be9fd;font-style:italic">$GATE_SVC&lt;/span> --patch &lt;span style="color:#f1fa8c">&amp;#39;{&amp;#34;spec&amp;#34;: {&amp;#34;sessionAffinity&amp;#34;: &amp;#34;ClientIP&amp;#34;}}&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For more details about session affinity, see the Kubernetes documentation on &lt;a href="https://kubernetes.io/docs/concepts/services-networking/service/">Services&lt;/a>.&lt;/p>
&lt;h2 id="exposing-armory-on-eks-with-an-internal-load-balancer">Exposing Armory on EKS with an internal Load balancer&lt;/h2>
&lt;p>In this option the goal is to use AWS ALB&amp;rsquo;s of type &lt;code>internal&lt;/code> for exposing Armory only within an organization&amp;rsquo;s private VPC. This consists of 3 steps: configuring Kubernetes services of type &lt;code>NodePort&lt;/code>, creating AWS internal ALB&amp;rsquo;s and updating Armory with final DNS names.&lt;/p>
&lt;h3 id="step-1-create-kubernetes-nodeport-services">Step 1: Create Kubernetes NodePort services&lt;/h3>
&lt;p>A &lt;code>NodePort&lt;/code> Kubernetes service opens the same port (automatically chosen) on all EKS worker nodes, and forwards requests to internal pods. In this case we&amp;rsquo;ll be creating two services: one for Deck (Armory&amp;rsquo;s UI) and one for Gate (Armory&amp;rsquo;s API).&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiversion&lt;/span>: spinnaker.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ... &lt;span style="color:#6272a4"># rest of config omitted for brevity&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">expose&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">type&lt;/span>: service
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">service&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">type&lt;/span>: NodePort
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ... &lt;span style="color:#6272a4"># rest of config omitted for brevity&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Assuming that Armory is installed in &lt;code>spinnaker&lt;/code> namespace:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl -n spinnaker apply -f spinnakerservice.yml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>After a few seconds you can view which ports were opened in EKS worker nodes, you&amp;rsquo;ll need them in the next step:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">DECK_PORT&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#ff79c6">$(&lt;/span>kubectl get service spin-deck -o &lt;span style="color:#8be9fd;font-style:italic">jsonpath&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#39;{.spec.ports[0].nodePort}&amp;#39;&lt;/span>&lt;span style="color:#ff79c6">)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">GATE_PORT&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#ff79c6">$(&lt;/span>kubectl get service spin-gate -o &lt;span style="color:#8be9fd;font-style:italic">jsonpath&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#39;{.spec.ports[0].nodePort}&amp;#39;&lt;/span>&lt;span style="color:#ff79c6">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="step-2-create-aws-internal-load-balancers">Step 2: Create AWS internal load balancers&lt;/h3>
&lt;p>We&amp;rsquo;ll describe how to create these load balancers from AWS console, but you can use any preferred method for provisioning infrastructure. We&amp;rsquo;ll create a Load Balancer for Deck and other for Gate.&lt;/p>
&lt;p>Navigate to AWS EC2 management console, in &lt;code>Load Balancers&lt;/code> section, and click on &lt;code>Create New Load Balancer&lt;/code>&lt;/p>
&lt;figure>
&lt;img src="/images/configure_ingress_new_lb.png"/>
&lt;/figure>
&lt;p>We&amp;rsquo;ll be creating a new Application Load Balancer:&lt;/p>
&lt;figure>
&lt;img src="/images/configure_ingress_create_alb.png"/>
&lt;/figure>
&lt;p>Make sure to select &lt;code>internal&lt;/code> scheme, and if you have a SSL certificate available, use &lt;code>HTTPS&lt;/code> protocol:&lt;/p>
&lt;figure>
&lt;img src="/images/configure_ingress_alb_1.png"/>
&lt;/figure>
&lt;p>Select the VPC and subnets where EKS worker nodes live:&lt;/p>
&lt;figure>
&lt;img src="/images/configure_ingress_alb_2.png"/>
&lt;/figure>
&lt;p>If you selected &lt;code>HTTPS&lt;/code> for the protocol, you can configure here the ACM certificate:&lt;/p>
&lt;figure>
&lt;img src="/images/configure_ingress_alb_ssl.png"/>
&lt;/figure>
&lt;p>In the next screen you can either select an existing security group or create a new one for your load balancer:&lt;/p>
&lt;figure>
&lt;img src="/images/configure_ingress_sg.png"/>
&lt;/figure>
&lt;p>Now you want to create a new target group that points to &lt;code>DECK_PORT&lt;/code> or &lt;code>GATE_PORT&lt;/code>, taken from the NodePort created in the previous step:&lt;/p>
&lt;figure>
&lt;img src="/images/configure_ingress_tg.png"/>
&lt;/figure>
&lt;p>Finally, you need to select all EKS worker nodes to be registered with the load balancer target, review, and save the changes:&lt;/p>
&lt;figure>
&lt;img src="/images/configure_ingress_register_targets.png"/>
&lt;/figure>
&lt;p>If for some reason you get &lt;code>Unhealthy&lt;/code> status in the target group you created, make sure that EKS worker nodes security groups allow traffic to the target ports, at least from Load Balancer&amp;rsquo;s security groups.&lt;/p>
&lt;p>Finally repeat the same steps for creating Gate Load balancer.&lt;/p>
&lt;h3 id="step-3-update-armory-configuration">Step 3: Update Armory configuration&lt;/h3>
&lt;p>Armory needs to know which url&amp;rsquo;s are used to access it. After you have updated your DNS with the Load Balancers CNAME&amp;rsquo;s created in the previous step, the next step is to update Armory configuration:&lt;/p>
&lt;p>Update and apply the &lt;code>SpinnakerService&lt;/code> manifest:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiversion&lt;/span>: spinnaker.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">security&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">apiSecurity&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">overrideBaseUrl&lt;/span>: https://spinnaker-gate.armory.io &lt;span style="color:#6272a4"># Specify your DNS name for Gate with https scheme&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">uiSecurity&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">overrideBaseUrl&lt;/span>: https://spinnaker.armory.io &lt;span style="color:#6272a4"># Specify your DNS name for Deck with https scheme&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ... &lt;span style="color:#6272a4"># rest of config omitted for brevity&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Assuming that Armory is installed in &lt;code>spinnaker&lt;/code> namespace:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl -n spinnaker apply -f spinnakerservice.yml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="exposing-armory-on-gke-with-ingress">Exposing Armory on GKE with Ingress&lt;/h2>
&lt;h3 id="setting-up-http-load-balancing-with-ingress">Setting up HTTP Load Balancing with Ingress&lt;/h3>
&lt;p>GKE has a “built-in” ingress controller and that&amp;rsquo;s what we will use.&lt;/p>
&lt;p>First create a file called basic-ingress.yaml and paste it the following&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiVersion&lt;/span>: extensions/v1beta1
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: Ingress
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: basic-ingress
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">rules&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">host&lt;/span>: demo.armory.io
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">http&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">paths&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">backend&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">serviceName&lt;/span>: spin-deck
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">servicePort&lt;/span>: &lt;span style="color:#bd93f9">80&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">path&lt;/span>: /
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">host&lt;/span>: gate.demo.armory.io
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">http&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">paths&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> - &lt;span style="color:#ff79c6">backend&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">serviceName&lt;/span>: spin-gate
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">servicePort&lt;/span>: &lt;span style="color:#bd93f9">80&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">path&lt;/span>: /
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Then apply this
&lt;code>kubectl apply -f basic-ingress.yaml&lt;/code>&lt;/p>
&lt;p>Find out the external IP address of the load balancer serving your application by running:
&lt;code>kubectl get ingress basic-ingress&lt;/code>&lt;/p>
&lt;p>Output:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>NAME HOSTS ADDRESS PORTS AGE
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>basic-ingress demo.armory.io, gate.demo.armory.io 203.0.113.12 80 2m
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Note: It may take a few minutes for GKE to allocate an external IP address and set up forwarding rules until the load balancer is ready to serve your application. In the meanwhile, you may get errors such as HTTP 404 or HTTP 500 until the load balancer configuration is propagated across the globe.&lt;/p>
&lt;p>You need to update your DNS records to have the demo.armory.io host point to the IP address generated.&lt;/p>
&lt;p>Now tell Armory about its external endpoints:&lt;/p>
&lt;p>Update and apply the &lt;code>SpinnakerService&lt;/code> manifest:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiversion&lt;/span>: spinnaker.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">config&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">security&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">apiSecurity&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">overrideBaseUrl&lt;/span>: http://gate.demo.armory.io &lt;span style="color:#6272a4"># Specify your DNS name for Gate&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">uiSecurity&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">overrideBaseUrl&lt;/span>: http://demo.armory.io &lt;span style="color:#6272a4"># Specify your DNS name for Deck&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ... &lt;span style="color:#6272a4"># rest of config omitted for brevity&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Assuming that Armory is installed in &lt;code>spinnaker&lt;/code> namespace:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl -n spinnaker apply -f spinnakerservice.yml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>After doing that you can visit &lt;a href="http://demo.armory.io/">http://demo.armory.io/&lt;/a> to view Armory.&lt;/p>
&lt;h3 id="secure-with-ssl-on-gke">Secure with SSL on GKE&lt;/h3>
&lt;p>To enable SSL and configure your certificates you can follow this guide:
&lt;a href="https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-multi-ssl">https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-multi-ssl&lt;/a>&lt;/p>
&lt;h2 id="httphttps-redirects">HTTP/HTTPS Redirects&lt;/h2>
&lt;p>You must enable HTTP/HTTPS redirects when your Armory deployment fits the following description:&lt;/p>
&lt;ul>
&lt;li>TLS encryption for Deck (UI) and Gate (API) for Armory&lt;/li>
&lt;li>A load balancer (service, ingress, etc.) in front of your Deck/Gate that terminates TLS and forwards communications to the Armory microservices.&lt;/li>
&lt;/ul>
&lt;p>To enable redirects, complete the following steps:&lt;/p>
&lt;p>Update the &lt;code>SpinnakerService&lt;/code> manifest with the following:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">apiversion&lt;/span>: spinnaker.io/v1alpha2
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">kind&lt;/span>: SpinnakerService
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">metadata&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">name&lt;/span>: spinnaker
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">spec&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">spinnakerConfig&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">profiles&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">gate&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">server&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">tomcat&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">protocolHeader&lt;/span>: X-Forwarded-Proto
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">remoteIpHeader&lt;/span>: X-Forwarded-For
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">internalProxies&lt;/span>: .*
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">httpsServerPort&lt;/span>: X-Forwarded-Port
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ... &lt;span style="color:#6272a4"># rest of config omitted for brevity&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Assuming that Armory is installed in &lt;code>spinnaker&lt;/code> namespace:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl -n spinnaker apply -f spinnakerservice.yml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Finally, clear your cache.&lt;/p>
&lt;p>For an alternative solution, see the following Knowledge Base article: &lt;a href="https://kb.armory.io/troubleshooting/https-redirects/">Troubleshooting http/https redirects with authentication&lt;/a>.&lt;/p></description></item></channel></rss>