Linkerd Add-On Model #4832
Unanswered
Pothulapati
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Present
Currently, Add-Ons are separate charts under
charts/linkerd2/add-ons
and are marked as dependencies for thelinkerd2
charts in requirements.yaml which makes the Helm install possible (as sub-charts are also loaded and generated first). As components in sub-charts also would want to inject proxy containers, they further take a dependency onpartials
charts. This is done like this instead of having a inject annotation because the proxy injector and add-ons are installed at the same time, and this could cause the injection to fail.For the CLI to support add-on installation, we use
AddOn
interface and add-ons have to implement that, which they do in the same folder. and these add-on types (most of which aremap[string]interface{}
so that we don't have to add a go field every time we add a new configuration field in yaml and the relevant use-case in helm templates, Example: #4761. But they can be concrete types too ) are part of theValues
struct which is loaded fromlinkerd2/values.yaml
Regarding the format of
values.yaml
, With Helm, Everything underglobal
is passed to all charts making proxy container, etc possible for add-ons. And Values under<addon-name>:
are passed to sub-charts thus allowing the default values to be overridden automatically. Default values are under./charts/add-ons/<add-on>/values.yaml
.With the CLI, The same mechanism is done by passing the
Values
, and add-on specific field to the chart during generation here.As once add-ons are installed, we need a way to store the overridden configuration for upgrades, We use the
linkerd-config-addons
for this and each add-on gets its on field and the overridden configuration is directly placed here. There are also fields underglobal
here which have fields likeprometheusUrl
, etc which are used to define a external prom instance whenlinkerd-prometheus
is disabled.linkerd-config-addons
is also used for the check command to perform checks based on the add-on configuration. These checks can be found here.Workflows
With this above context, Let's understand some work-flows
Install
--addon-config
flag, to pass add-on configuration to theinstall
command. Example Configurationlinkerd2
chart is loaded normally, andadd-on
charts are loaded at this point here.parseAddOnValues()
is used to get only the enabled add-ons. And these charts are rendered later in the same flow.Upgrade
Values
struct here--addon-config
to do the same and this configuration is merged hereUsers can also skip getting getting the configmap by using
--addon-overwrite
which means the cm is skipped and going to the default, or to some configuration when combined with--addon-config
.Adding a new Add-On
/charts/add-ons/
and add it as a dependency tolinkerd2
chart.struct
and implement theAdd-On
Interface underpkg/charts/
, and this field should be a sub-field underValues
struct.parseAddOnValues
to know about the add-on and add it to the return list if its enabled. _(This could've been automated and was later removed as it used reflection and was confusing.).linkerd-config-addons
to print the new add-on field.Problems with the current flow
global
, and vice-versa by using the<add-on>
field invalues.yaml
but there is no way for add-ons to share configuration details between them i.e Values underprometheus:
are not visible in thegrafana
chart. This was pretty important for thedashboard
add-on as it needs to know if grafana and jaeger are present, This was solved by mountinglinkerd-config-addons
intolinkerd-web
but a more general approach would be useful.linkerd-config-addons
is rendered differently in Helm and CLI. In Helm, the default values are merged and printed. But as Helm does not uselinkerd-config-addons
for upgrades, This did not make any difference.Pull Requests
Tracing
Grafana
Prometheus
Miscellaneous
Beta Was this translation helpful? Give feedback.
All reactions