Spinnaker Configuration File Precedence

Many Linux services handle configuration files as follows:

/etc/sudoers        ## The main config file
/etc/sudoers.d    ## A directory for customizations. Add more files here, as you wish.

That’s it! Very concise.

Conversely, Spinnaker has a quagmire of different config files in various different locations. It is helpful to understand how they operate.

When each of the services come up, they will load the config files in this order (I’ll use the Rosco service as the example):

/opt/rosco/config/rosco.yml
/opt/spinnaker/config/spinnaker.yml
/opt/spinnaker/config/spinnaker-local.yml
/opt/spinnaker/config/rosco.yml
/opt/spinnaker/config/rosco-local.yml

The later files override the earlier ones. /opt/rosco/config/rosco.yml has the lowest precedence, and /opt/spinnaker/config/rosco-local.yml has the highest precedence.

Next, which are auto-generated by halyard?

/opt/rosco/config/rosco.yml
/opt/spinnaker/config/spinnaker.yml          ## This file was autogenerated, and _will_ be overwritten by Halyard.
/opt/spinnaker/config/spinnaker-local.yml
/opt/spinnaker/config/rosco.yml                   ## This file was autogenerated, and _will_ be overwritten by Halyard.
/opt/spinnaker/config/rosco-local.yml

Therefore, the -local.yml versions are the place for customizations.

When customizing the files though, they should not be edited in the above mentioned location. Rather, in the /home/ubuntu/.hal/ directory, followed by running “hal deploy apply”, which copies them into place.
(By the way, check the contents of /opt/spinnaker/config/halyard-user , to see if it’s ubuntu or a different account)

So, let’s review the files again from that perspective.

FINAL LOCATIONPLACE TO EDIT THE FILES
/opt/rosco/config/packer/aws-ebs.json/home/ubuntu/.hal/default/profiles/rosco/packer/aws-ebs.json
/opt/rosco/config/rosco.yml/home/ubuntu/.hal/default/profiles/rosco/rosco.yml
/opt/spinnaker/config/spinnaker.yml/home/ubuntu/.hal/default/profiles/spinnaker.yml
/opt/spinnaker/config/spinnaker-local.yml/home/ubuntu/.hal/default/profiles/spinnaker-local.yml
/opt/spinnaker/config/rosco.yml/home/ubuntu/.hal/default/profiles/rosco.yml
/opt/spinnaker/config/rosco-local.yml/home/ubuntu/.hal/default/profiles/rosco-local.yml

Interestingly, they can all be created and then edited in /home/ubuntu/.hal/, even if they should not be, because some of the files are managed by halyard.

Prefer to create and then edit the -local.yml versions of the files since those are meant for customization.

Leave a Reply

Your email address will not be published. Required fields are marked *