Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Add scheduled task of reloading proxy Acls from dynamoDB table. #25

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mengxuzhao
Copy link
Collaborator

@mengxuzhao mengxuzhao commented Jan 31, 2021

Add feature of loading proxy rules from DynamoDB:

  1. Add a new flag ddbconfig for receiving name of DynamoDB table storing proxy configurations. If the flag is set, a background task scheduled every minute will reload proxy configurations from the DynamoDB table by doing a full table scan. If the flag is not set, then proxy configurations will be reloaded from local configuration directory every minute.
  2. Initial proxy configurations are still loaded from local configuration directory during proxy bootstrapping process.LoadConfigFromDirectory now takes an extra optional argument flagging if the process is an initial configuration loading or reloading. If reloading fails, initial configurations remain unchanged.
  3. DynamoDB table and configuration items will be created in infrastructure codebase, which is not within the scope of inkfish. The table will contain two columns: ConfigName (key) and ConfigBody (base64 encoded string of proxy configuration).

Integration testing

  1. Initial proxy configuration loading succeeds.
  2. Minutely proxy configuration reloading succeeds.
  3. Changes of proxy configuration are picked up correctly after configuration reloading.
    Note: bsycorp/inkfish@sha256:29d9ca858e4ee196c6f297569362239f3ddffa484e232cebf71044b0dc40acd4 is built from this branch and tested.

Options LocalDir + DDB

  1. Option 1: Commit 8f7e1ab
    -- DDB tables of proxy rules at apps level are created from TF codes in apps repos, which is independent from infra codes.
    -- Inkfish startup flag -ddb-config takes a DDB table name regex (e.g. -ddb-config ${var.env_label}[^0-9]+proxy-rules) to discover all matching DDB tables for the current environment.
    -- For each proxy config reloading process, the list of all DDB tables having table name matching the name regex will be scanned.

@mengxuzhao mengxuzhao requested a review from bls January 31, 2021 22:32
@mengxuzhao mengxuzhao linked an issue Feb 1, 2021 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic rule reloading from external store
2 participants