What To Expect
This guide should include:
- Configuration changes needed to configure the 1-click app/resource provisioning feature
Armory’s 1-click app/resource provisioning feature allows you to bootstrap a brand new application and provision the following resources for the app with the click of a button:
- Github Repo
- Spinnaker application
- Loadbalancer (service) in the Kubernetes cluster where the app will be deployed
- DNS name for the app
The above is just a sample list of steps that will happen during app provisioning. This list is extensible through configuration (explained later).
Steps to follow to configure 1-click app creation:
- Enable the Armory Platform, by setting the following feature flags in
features: armoryPlatform: enabled: true uiEnabled: true
- If this is on the AWS EC2 installation of spinnaker, set the following environment variables in your
dev.envdepending on where you are running the platform):
- Create a new file:
config/platform-local.ymlwith the following contents:
github: apiCredentialsPath: /opt/spinnaker/credentials/github-creds.txt organization: armory-io # your github Org oneClick: templatesConfigPath: /config/oneclick-local.yml # the config file for the oneclick template (optional) lbNamespace: default # The K8s namespace where the Loadbalancer is created
Note: The contents of the file
/opt/spinnaker/credentials/github-creds.txtshould be of the format:
username:tokenfor the github API. You can create a personal access token (in GitHub) that has read/write access in the org where the new application will be created.
With the above config changes, once you redeploy Armory spinnaker, you should see a navbar on top that looks like this:
Clicking on the
Create App button on the top right corner should bring up a modal that will allow you to select a template, enter an application name to provision the app:
By default, the 1-Click App Creation performs the following tasks:
createPipeline: This step creates a Deploy pipeline in spinnaker for the new app. If the spinnaker application doesn’t exist, it creates the application first before creating the pipeline. This pipeline is copied over from a template pipeline that is already in spinnaker and defaults to
oneclickgotemplateapp in spinnker. The default app to copy from can be overwritten in the configs (explained below)
createLoadBalancer: This step creates a load balancer in the Kubernetes cluster where the app will be deployed. (If deploying to a non-Kubernetes cloud provider, this step should be disabled in the configs)
createGithubRepo: This step creates a repo in github to bootstrap the app. Ideally this repo follows a widly adopted project structure (such as this for Golang). It has a
Jenkinsfilewhich triggers of a build of the repo on every check-in. That build can push an artifact to a repository (like docker hub), which can be the trigger for the Deploy pipeline created above (in the
createPipelinestep). Additionally, this repo can also have a
dinghyfilePipelines-as-code to create a custom pipeline instead of using the one created above.
createGoogleDNSEntry: This step creates a DNS entry (in GCP for the alpha version) for the app that is deployed.
The follwing is a sample
config/oneclick-local.yml template that can be used to customize/override defaults. Points to note:
- We’re skipping the
createLoadBalanceraction in the yaml file.
basePipelineAppis the app in spinnaker where the deploy pipeline is copied over from (the dashes
-in the name are ignored since spinnaker doesn’t allow them in app names).
repoURLfield is the template repo on which the app is based.
namefield is used for the name of the template to copy from (usually same as
imagefield controls what image is displayed in the modal while choosing templates. (leave it as
gopherin the alpha version)
templates: - actions: - createPipeline - createGithubRepo - createGoogleDNSEntry basePipelineApp: oneclick-go-template image: gopher name: oneclick-go-template repoURL: "https://github.com/armory-io/oneclick-go-template" githubOrg: "armory-io"