Spinnaker : Getting started guide — Part 2 (Adding AWS as provider)
Configuring Spinnaker to use AWS
Well finally after 10 min you got your Spinnaker installed. Unlike other applications it is just not installation to get you started. You have to go through the pain of configuring it.
What exactly do I mean by configuring. For the sake of example let us hypothetically set a goal
Goal
- Configuring Spinnaker to use AWS and
- Launch an EC2.
What you need to gather
- An S3 bucket ( Example : spinnaker-nag123 )
- An AWS Account ( Example : 112233374870 )
- Create two IAM Roles,
- BaseIAMRole
- spinnakerManaged
TBD : Create scripts to create the above IAM Roles. For now instructions for creating the above roles is present in the Armory docs
Instructions
Assuming you got your Spinnaker app up and running based on the Part 1.
- ssh to your EC2 instance where you installed Spinnaker
- Copy the below file to deploy/spinnaker/basic/spinnakerservice.yml
apiVersion: spinnaker.io/v1alpha2
kind: SpinnakerService
metadata:
name: spinnaker
spec:
spinnakerConfig:
service-settings:
rosco:
env:
SPINNAKER_AWS_DEFAULT_REGION: "us-east-1"
SPINNAKER_AWS_DEFAULT_ACCOUNT: "12345"
profiles:
gate:
server:
servlet:
context-path: /api/v1
service-settings:
gate:
healthEndpoint: /api/v1/health
config:
security:
apiSecurity:
ssl:
enabled: false
overrideBaseUrl: https://spinnaker.corp.nag.com/api/v1
corsAccessPattern: https://spinnaker.corp.nag.com
uiSecurity:
ssl:
enabled: false
overrideBaseUrl: https://spinnaker.corp.nag.com
version: 1.29.2 # the version of Spinnaker to be deployed
persistentStorage:
persistentStoreType: s3
s3:
bucket: nag-spinnaker123 # Change to a unique name. Spinnaker stores application and pipeline definitions here
rootFolder: front50
providers:
aws:
accessKeyId: "AKIA"
secretAccessKey: "xercsdss"
defaultAssumeRole: role/DevSpinnakerManagedRole
enabled: true
accounts:
- name: dev1
environment: dev
regions:
- name: us-east-1
accountId : '12345'
assumeRole: role/DevSpinnakerManagedRole
primaryAccount: dev1
defaultRegions:
- name: us-east-1
defaults:
iamRole: BaseIAMRole
3. Navigate to this directory as
cd spinnaker-operator/deploy/spinnaker/basic
4. Execute the following command
kubectl -n spinnaker apply -f .
Note :
- For the VPC Subnets to show up in Spinnaker. You should plan to tag them with a value
immutable_metadata={“purpose”:”example-purpose”}
More info : Configure AWS Networking for Spinnaker
2. Ensure your healthcheck is set for the app as cloudprovider https://www.armory.io/blog/my-pipeline-is-stuck-on-wait-for-up-instances/
Testing
- Navigate to your spinnaker instance and ensure you are able to deploy an instance.