Experimental flag guard infrastructure#1426
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nikkithurmond Assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/assign @vaikas-google |
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: knative-serving |
There was a problem hiding this comment.
Delete this? Why redeclare the namespace?
There was a problem hiding this comment.
You can't create the config-map if the namespace doesn't exist. I can delete it, but I was opting for as few steps as possible to use the experiments. This way, you just run ko apply -f config/experiments/
Without it, you will need to manually create the namespace yourself before doing so.
| - name: config-experiments | ||
| configMap: | ||
| name: config-experiments | ||
| optional: true |
There was a problem hiding this comment.
Why optional? Why not just empty as needed?
There was a problem hiding this comment.
If it isn't optional, the configmap needs to exist. That means I need to declare an empty configMap in /config. If I call ko apply -f config/experiments/ then ko apply -f config, the experiments will be overwritten by the empty map.
I experimented with using kubectl patch, but it doesn't work very elegantly for configmaps.
Adds dedicated experimental flag guarding. This will pave the way for
making an e2e test dashboard that can continuously test our experiments
without the need to turn them on at HEAD.
To use:
* Create a flag in config/experiments/config-experiments.yaml. For
instance,
data:
autoscaler.enable-my-experiment: "true"
Then, in the binary you would like to flag guard:
var (
experimentalFlagSet = k8sflag.NewFlagSet("/etc/config-experiments")
enableMyExperiment =
experimentalFlagSet.Bool("enable-my-experiment", false)
...
)
...
<existing code path>
# If my experiment is enabled, run my new code path
if enableMyExperiment.Get() {
<new code path>
}
...
That's it. To enable experiments, simply run ko apply -f
config/experiments/config-experiments.yaml before running ko apply -f
config/
* Adding new configMap, config-experiments
* Mounting a new optional volume for the new configMap.
fba32e9 to
d0b2770
Compare
|
/retest |
|
@nikkithurmond: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
tl;dr Please bias towards If you follow the pattern I've been using as I refactor our existing
|
|
@mattmoor I knew we were moving away from k8sflag, I just wasn't sure if it was done yet. I don't believe anything would change about this PR, though, correct? The only thing that would be different is my PR description? |
|
Looking over your change, it looks like it would be different. That's fair, I'll scrap this work. |
|
I think the main thing is that we'd want a typed |
Adds dedicated experimental flag guarding. This will pave the way for
making an e2e test dashboard that can continuously test our experiments
without the need to turn them on at HEAD.
To use:
Create a flag in config/experiments/config-experiments.yaml. For
instance,
Then, in the binary you would like to flag guard:
That's it. To enable experiments, simply run
ko apply -f config/experiments/config-experiments.yamlbefore runningko apply -f config/Proposed Changes
Release Note