-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework/improve conditions #64
Comments
Proposal: conditions:
modes: [dev, test, deploy] # (ktd up | ktd test | kubetools deploy)
clusters:
not: []
match: ['*']
namespaces:
not: []
match: ['*'] Essentially just a more explicit version of the current ones. |
|
Yeah this is a weird one really,
You're absolutely right, doesn't quite work!
Interesting! So maybe we need to focus the conditions around the 'mode'. So, as default (everywhere/always): conditions:
dev: true
test: true
deploy: true Then limiting to clusters/namespaces could be: conditions:
deploy:
- ['production', 'A']
- ['backup', 'B'] And finally the case where we want to deploy a dependency in all namespaces on the staging cluster but not elsewhere: conditions:
deploy:
- ['staging', '*'] This then removes the need for "not" matching because (I think?) everything can be achieved using the tuples with wildcard support. |
One question - is defaulting everything to Regarding backwards compatibility: it will be trivial to detect the old version |
Definitely
unless otherwise specified explicitely |
Instead of: conditions:
deploy:
- ['production', 'A']
- ['backup', 'B'] I'd rather go explicit: conditions:
deploy:
- env: 'production'
namespace: 'A'
- env: 'backup'
namespace: 'B' Which opens up to negations and wildcards nicely: conditions:
deploy:
# namespace B in any environment but production
- not_env: 'production'
namespace: 'B'
# Any namespace in backup environment
- env: 'backup' # Absence of `namespace` means `'*'` And also opens backwards-compatible evolutions if later adding other conditions than |
I like that a lot, definitely pro the explicitness! One thing - we should sort out this mess of |
Also, a thought for differentiating this from old configs: name: my-project
configVersion: 1
requireKubetools: '~=12.0' # optional, replacement for minKubetoolsVersion |
As far as |
I think more is better in this case, but with consistency with
Now this poses a few issues:
Answers to these questions will define to what extent multiple users of a same cluster can customise their |
Spot on,
There isn't really any concept of a "cluster name" - https://stackoverflow.com/questions/38242062/how-to-get-kubernetes-cluster-name-from-k8s-api. So this all ends up being entirely dependent on the deployment environment, which means it's flexible but... complex! Agree w/adding all three envvars, gives all the information to the underlying app and maximum flexibility! As for the conditions, |
Current conditions - these can control where deployments/dependencies/upgrades all run/exist:
Ideally this should be less complex and less gotchas between combinations!
The text was updated successfully, but these errors were encountered: