-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add linkerd-config-overrides secret #4911
Conversation
@@ -141,7 +141,7 @@ identity: | |||
# control plane annotation - do not edit | |||
crtExpiryAnnotation: linkerd.io/identity-issuer-expiry | |||
|
|||
issuanceLifetime: 86400s | |||
issuanceLifetime: 24h0m0s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how go serializes this duration. By formatting it this way in the chart values.yaml, we avoid spuriously detecting it as overridden.
@@ -13,7 +13,7 @@ import ( | |||
"k8s.io/helm/pkg/timeconv" | |||
) | |||
|
|||
const versionPlaceholder = "{version}" | |||
const versionPlaceholder = "linkerdVersionValue" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that this was missed in #4373
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch 👍
pkg/charts/linkerd2/values.go
Outdated
@@ -91,6 +91,7 @@ type ( | |||
IdentityTrustDomain string `json:"identityTrustDomain"` | |||
PrometheusURL string `json:"prometheusUrl"` | |||
GrafanaURL string `json:"grafanaUrl"` | |||
LinkerdVersion string `json:"linkerdVersion"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this field was missing to begin with.
|
||
// Tree is a structured representation of a string keyed tree document such as | ||
// yaml or json. | ||
type Tree map[string]interface{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You down with ADT? Yeah you know me!
You down with ADT? Yeah you know me!
You down with ADT? Yeah you know me!
Who's down with ADT? NOT GOLANG
Ref #4914 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Tested this out with various different overridden configurations i.e ha
, addons-config
, etc and works very well! 👍
pkg/tree/tree.go
Outdated
return string(bytes), nil | ||
} | ||
|
||
// String returns a yaml represetation of the Tree or an error string if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: representation
pkg/tree/tree.go
Outdated
return diff, nil | ||
} | ||
|
||
// Prune removes all empty subtress. A subtree is considered empty if it does |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: subtrees
Signed-off-by: Alex Leong <[email protected]>
Signed-off-by: Alex Leong <[email protected]>
…ration test Signed-off-by: Alex Leong <[email protected]>
Signed-off-by: Alex Leong <[email protected]>
Signed-off-by: Alex Leong <[email protected]>
87da5e3
to
c776584
Compare
Signed-off-by: Alex Leong <[email protected]>
A conflict between #4911 and #4737 caused unit test to be broken. #4737 added a new test to `upgrade_test.go` and the changes in #4911 updated all of these test to ignore differences in the config overrides secret. Since these two PRs merged in parallel, the new test was missing this update. Update the new test to also ignore differences in the config overrides secret as the other ones do. Signed-off-by: Alex Leong <[email protected]>
This PR adds a new secret to the output of
linkerd install
calledlinkerd-config-overrides
. This is the first step towards simplifying the configuration of the linkerd install and upgrade flow through the CLI. This secret contains the subset of the values.yaml which have been overridden. In other words, the subset of values which differ from their default values. The idea is that this will give us a simpler way to produce thelinkerd upgrade
output while still persisting options set during install. This will eventually replace thelinkerd-config
configmap entirely.This PR only adds and populates the new secret. The secret is not yet read or used anywhere. Subsequent PRs will update individual control plane components to accept their configuration through flags and will update the
linkerd upgrade
flow to use this secret instead of thelinkerd-config
configmap.This secret is only generated by the CLI and is not present or required when installing or upgrading with Helm.
Here are sample contents of the secret, base64 decoded. Note that identity tls context is saved as an override so that it can be persisted across updates. Since these fields contain private key material, this object must be a secret. This secret is only used for upgrades and thus only the CLI needs to be able to read it. We will not create any RBAC bindings to grant service accounts access to this secret.