* Add controlled rollout proposal * Rename Enabled to Get
2.5 KiB
Controlled Rollout proposal
Why
New features are great, everybody loves them. However, new features come by the hand of new code. New code can have bugs or it can have performance regressions.
Features aren't perfect for all users. Sometimes they are perfect for some users and not others. Sometimes they are perfect for some hosts and not others.
Rolling out a feature shouldn't always be a binary choice: enabled/disabled. In an ideal world, all features would be enabled by default, everybody would love them all, and they would work flawlessly for all possible use cases.
We are in the real world, though, which is not ideal. So we should give people running Fleet tools to rollout features slowly, so that they can update infrastructure if needed, or only use a feature within the scope that is useful for them.
This is a proposal on how this tool could look like and work.
How
We would create a new type of boolean value in our AppConfig
called RolloutBoolean
.
RolloutBoolean
will have a function Get(h *fleet.Host) bool
. So instead of doing this:
if ac.HostSettings.EnableHostUsers {
...
}
We would do:
if ac.HostSettings.EnableHostUsers.Get(host) {
...
}
In yaml terms, this is what RolloutBoolean
would be able to parse:
- Regular true/false, 0/1, yes/no values
---
apiVersion: v1
kind: config
spec:
host_settings:
enable_software_inventory: false
- Only enable a feature for certain teams:
---
apiVersion: v1
kind: config
spec:
host_settings:
enable_software_inventory:
default: false
overrides:
teams:
- team1: true
- team2: true
- Enabled for all except a specified team:
---
apiVersion: v1
kind: config
spec:
host_settings:
enable_software_inventory:
default: true
overrides:
teams:
- team1: false
- Enabled only for specific hosts:
---
apiVersion: v1
kind: config
spec:
host_settings:
enable_software_inventory:
default: false
overrides:
host_ids:
- 3214: true
- Enabled for hosts on a specific platform (as reported by osquery, not in terms of label membership):
---
apiVersion: v1
kind: config
spec:
host_settings:
enable_software_inventory:
default: false
overrides:
platforms:
- linux: true
The Get(h *Host) bool
function will use the provided host to define whether the feature is enabled or not based on
how it's defined in the configuration.