Reload on Github Push¶
After following this guide, the Honeydipper daemon should not pull from config repo as often as before, and it can reload when there is any change to the remote repo.
- Github Integration in Honeydipper
- Config webhook in Github repo
- Configure a reloading rule
- Reduce the polling interval
Github Integration in Honeydipper¶
Create a yaml file in your config repo to store the settings for github integration, and make sure it is loaded through
init.yaml. See the github integration reference for detail on how to config.
# integrations.yaml --- systems: ... github: token: ENC[gcloud-kms,xxxxxx..] oauth_token: ENC[gcloud-kms,xxxxxx...]
By configuring the github integration, we enabled a webhook at certain url (by default,
/github/push, see your infrastructure configuration for the url host and port). As of now, the Honeydipper webhook driver doesn’t support authentication using signature header, so we use a token to authenticate requests coming from github.
Config webhook in Github repo¶
Go to your config repo in github, click
webhooks, then add a
webhook with the webhook url. For example,
Make sure you select “Pushes” to be sent to the configured webhook.
Configure a reloading rule¶
Create a yaml file in your config repo to store a rule, and make sure it is loaded through
includes in one of previously loaded yaml file. The rule should look like below
# reload_on_gitpush.yaml --- rules: - when: source: system: github trigger: push do: if_match: - git_repo: myorg/myconfig git_ref: refs/heads/master call_workflow: reload
Your repository name and branch name may differ.
After the rule is loaded into the Honeydipper daemon, you should be able to see from the logs, or the slack channel where the daemon is configured to set the status, that the daemon reloads configuration when there is new push to your repo. The
if_match in the
takes a list, so if you want to watch for more than one repo, just add them into the list.