-
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
Common structs for Helm #3161
Common structs for Helm #3161
Conversation
Integration test results for 241c4d3: success 🎉 |
Thanks for putting this together. Per slack convo, I removed some of the redundant nested variables from Here's the list of structs that correspond to the YAML in my // top level variables
type InjectValues struct {
Namespace string
ClusterDomain string
HighAvailability bool
Proxy *Proxy
ProxyInit *ProxyInit
}
type Proxy struct {
Capabilities *Capabilities
Component string
DisableIdentity bool
DisableTap bool
EnableExternalProfile bool
Image *Image
Identity *Identity
LogLevel string
MountPaths []*MountPath
Ports *Ports
Resources *Resources
UID string
}
type ProxyInit struct {
Capabilities *Capabilities
IgnoreInboundPorts string
IgnoreOutboundPorts string
Image *Image
MountPaths []*MountPath
Resources *Resources
}
type Capabilities struct {
Add []string
Drop []string
}
type Image struct {
Name string
Version string
PullPolicy string
}
type Identity struct {
Issuer struct {
CrtPEM string
}
TrustDomain string
}
type MountPath struct {
Name string
MountPath string
}
type Resources struct {
CPU Constraints
Memory Constraints
}
type Constraints struct {
Limit string
Request string
}
type Ports struct {
Admin int
Control int
Inbound int
Outbound int
} LMK if this works. |
Signed-off-by: Ivan Sim <[email protected]>
Signed-off-by: Ivan Sim <[email protected]>
Looks great @ihcsim 👍
|
Integration test results for 273eef1: fail 😕 |
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 just a couple questions 🚢 👍
// ProxyInit contains the fields to set the proxy-init container | ||
ProxyInit struct { | ||
Capabilities *Capabilities | ||
IgnoreInboundPorts string |
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.
can/should this be an array?
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.
yeah we might. WDYT @ihcsim ?
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.
The value of this variable eventually gets mapped into the args
of the proxy-init container. From a rendering perspective, I think it should remain as string. Otherwise, won't we end up with something like:
initContainers:
- args:
...
- --inbound-ports-to-ignore
- [4190,4191]
- --outbound-ports-to-ignore
- ["443"]
I made a mistake in the |
273eef1
to
db6db72
Compare
I've just pushed the changes according to the previous message. I've also changed the name of |
Signed-off-by: Alejandro Pedraza <[email protected]>
db6db72
to
241bb7f
Compare
Integration test results for 241bb7f: success 🎉 |
Signed-off-by: Ivan Sim <[email protected]>
* Updated controller template with proxy partials * Declare dependency in requirements.yaml * Add partial template for proxy's metadata * Add proxy-init partial template * Script to lint Helm charts and update their dependencies * Update partials chart Chart.yaml * Add proxy-init and resource partial templates * Replace hard coded namespace variable in proxy env var * Ignore chart dependencies .tgz files * Add missing fields and re-order YAML elements to match CLI output * Reuse control plane's resource partial template in 'partials' chart * Set the proxy's destination service address env var * Add Grafana's template * Update api version of controller RBAC * Add Heartbeat template * Remove duplicated resources partial template * Add remainder control plane components templates * Add template for the 'linkerd-config' config map * Add debug container template * Update proxy partial with 'disable-identity' and 'disable-tap' variables Note that these are inject-only variables. Also added the LINKERD2_PROXY_TAP_SVC_NAME env var. * Add validation conditions to ensure identity and tap aren't disabled for control plane components * Add partials for service account token mount path and security context capabilities * Change proxy and proxy-init templates to use global scope Some of the nested variables are removed from values.yaml to ensure changes made to root-level variables are propagated directly into the partial templates. The previous approach of using YAML anchors in the values.yaml to share common values can get out-of-sync when values are changed via the Helm's `--set` option. * Update templates and values file to match #3161 * Perform a dry run installation if there is a local Tiller * Reorder JSON elements in linkerd-config * Re-adjust nested partials indentation to work with inject 'patch' chart Previously, the partials will render their content as an element in the list. While it works for installation, the toJson function in the 'inject' patch code ends up converting it into a JSON list, instead of the expected JSON object. * Trap the last fail command in the Helm shell script * Add the identity trust anchor * Address Thomas' feedback on handling HA All the HA-related variables are moved to values-ha.yaml * Convert ignore ports string to JSON list in linkerd-config Also fixed some indentation issues. * Add values-ha.yaml * Include the service account token mount path only if identity is enabled * Fixed malformed JSON in linkerd-config config map * Rename chart to 'linkerd2' * Add NOTES.txt * Fix incorrect variable path in proxy template * Remove fake TLS assets * Add 'required' constraint to identity trust anchors variable * Update tap templates per #3167 * Bump default version to edge-19.8.1 due to dependency on RSA support Signed-off-by: Ivan Sim <[email protected]>
* Updated controller template with proxy partials * Declare dependency in requirements.yaml * Add partial template for proxy's metadata * Add proxy-init partial template * Script to lint Helm charts and update their dependencies * Update partials chart Chart.yaml * Add proxy-init and resource partial templates * Replace hard coded namespace variable in proxy env var * Ignore chart dependencies .tgz files * Add missing fields and re-order YAML elements to match CLI output * Reuse control plane's resource partial template in 'partials' chart * Set the proxy's destination service address env var * Add Grafana's template * Update api version of controller RBAC * Add Heartbeat template * Remove duplicated resources partial template * Add remainder control plane components templates * Add template for the 'linkerd-config' config map * Add debug container template * Update proxy partial with 'disable-identity' and 'disable-tap' variables Note that these are inject-only variables. Also added the LINKERD2_PROXY_TAP_SVC_NAME env var. * Add validation conditions to ensure identity and tap aren't disabled for control plane components * Add partials for service account token mount path and security context capabilities * Change proxy and proxy-init templates to use global scope Some of the nested variables are removed from values.yaml to ensure changes made to root-level variables are propagated directly into the partial templates. The previous approach of using YAML anchors in the values.yaml to share common values can get out-of-sync when values are changed via the Helm's `--set` option. * Update templates and values file to match #3161 * Perform a dry run installation if there is a local Tiller * Reorder JSON elements in linkerd-config * Re-adjust nested partials indentation to work with inject 'patch' chart Previously, the partials will render their content as an element in the list. While it works for installation, the toJson function in the 'inject' patch code ends up converting it into a JSON list, instead of the expected JSON object. * Trap the last fail command in the Helm shell script * Add the identity trust anchor * Address Thomas' feedback on handling HA All the HA-related variables are moved to values-ha.yaml * Convert ignore ports string to JSON list in linkerd-config Also fixed some indentation issues. * Add values-ha.yaml * Include the service account token mount path only if identity is enabled * Fixed malformed JSON in linkerd-config config map * Rename chart to 'linkerd2' * Add NOTES.txt * Fix incorrect variable path in proxy template * Remove fake TLS assets * Add 'required' constraint to identity trust anchors variable * Update tap templates per #3167 * Bump default version to edge-19.8.1 due to dependency on RSA support Signed-off-by: Ivan Sim <[email protected]>
This PR adds
pkg/inject/template-values.go
which contains the structsneeded to set the helm variables during injection. They can also be
leveraged during installation:
Signed-off-by: Alejandro Pedraza [email protected]