You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. highly unlikely to be instance-specific (e.g. cloud provider, node lease
169
+
duration)
156
170
157
-
### Separate config object for instance-specific config
171
+
Today, the "sharable" configuration Kinds may contain (2) or (3); in Kubelet
172
+
we have been careful to keep (1) out of the configuration schema (as mentioned
173
+
above).
158
174
159
-
The proposal is this: Add a new Kind for instance-specific config, and put
160
-
instance-specific parameters in that object.
175
+
This KEP proposes that components use a separate, instance-specific Kind,
176
+
to clearly identify and separate parameters that are instance-specific from
177
+
parameters that are sharable. It also proposes that components have a way
178
+
to define the same field in both instance-specific and sharable Kinds, and
179
+
define a merge such that the instance-specific field overrides the sharable
180
+
field. This gives us some flexibility if we miscategorize fields, or discover
181
+
an instance-specific use-case for a sharable field.
161
182
162
-
This is relatively simple and isolates the parameters so that they can be
163
-
dealt with separately. ComponentConfig files containing only sharable parameters
164
-
can continue to be shared via a single ConfigMap. Files containing only
165
-
instance-specific parameters can be provided to components via other means,
166
-
such as the node startup scripts or an init container that inserts values from
167
-
the Pod's Downward API.
183
+
### Separate Kind for instance-specific config
168
184
169
-
### Why not just keep using flags for instance-specific parameters?
185
+
First, add a new instance-specific ComponentConfig Kind in each component's
186
+
config API. This gives us a clear structure to separate instance-specific and
187
+
sharable fields. This KEP proposes a new flag, `--instance-config`, for this
188
+
new Kind.
170
189
171
-
Flags have various problems, outlined in the [Versioned Component Configuration Files](https://docs.google.com/document/d/1FdaEJUEh091qf5B98HM6_8MS764iXrxxigNIdwHYW9c)
172
-
doc.
190
+
ComponentConfig files containing only sharable parameters can continue to be
191
+
shared via a single ConfigMap. Files containing only instance-specific
192
+
parameters can be provided to components via other means, such as the node
193
+
startup scripts or an init container that inserts values from the Pod's Downward
194
+
API.
173
195
174
-
Leaving some parameters as flags while the rest are exposed via ComponentConfig
175
-
results in an inconsistent API surface, and an inconsistent API versioning
176
-
policy. Why fix only part of the problem when we can fix the whole thing?
196
+
### Case-by-case merge if fields are miscategorized
177
197
178
-
### Why not just auto-detect?
198
+
Second, allow instance-specific configs to override shared config when the same
199
+
field is specified in both.
179
200
180
-
One alternative that has been proposed in the past is to find a way to
181
-
auto-detect values of instance-specific parameters and simply eliminate them
182
-
from the configuration workflow. This is a great idea in theory, because it
183
-
solves the problem by removing work for users, but it may be difficult in
184
-
practice. For example, on a machine with multiple network cards, which IP should
185
-
the kubelet use?
186
-
187
-
Implementing the two-object approach does not prevent us from finding ways to
188
-
auto-detect instance specific config in the future. It is worth noting that the
189
-
_possibility_ of someday being able to auto-detect these has led to some
190
-
hesitation to make a firm decision today. We have delayed for too long already,
191
-
and a firm decision is needed to move forward.
192
-
193
-
### Risks and Mitigations
194
-
195
-
This creates an additional bucket for config parameters. We must be vigilant
196
-
that only parameters that are truly instance-specific are added to the
197
-
instance-specific Kind. We can provide warnings to developers via comments
198
-
and tests to deter adding parameters to the instance-specific Kind that should
199
-
instead be in the sharable Kind.
200
-
201
-
For users deploying Pod templates, this solution can make the template more
202
-
verbose. In the future, we can explore more elegant ways of generating files
203
-
with instance-specific parameters correctly substituted. This proposal argues
204
-
that the extra verbosity is worth the benefit of a consistent, versioned API for
205
-
configuring core components.
206
-
207
-
## Design Details
208
-
209
-
ComponentConfig APIs are currently defined as a separate API group for each
210
-
component, usually containing a single top-level Kind for configuring that
211
-
component. The naming convention for the API group is `{component}.config.k8s.io`,
212
-
and the convention for the Kind is `{Component}Configuration`. This KEP proposes
213
-
that the naming convention for the new Kind be `{Component}InstanceConfiguration`.
214
-
215
-
The canonical flag for providing a ComponentConfig file to a component is
216
-
`--config`. This KEP proposes that the canonical flag for providing an
217
-
instance-specific config file be `--instance-config`, and that the
218
-
instance-specific object not initially be permitted as part of a yaml stream
219
-
in the `--config` file (and vice-versa). This is for the sake of a simple
220
-
implementation and can be enabled in the future, if we decide it is useful.
221
-
222
-
As with sharable ComponentConfig parameters, command line flags for
223
-
instance-specific parameters should continue to function and take precedence
224
-
over values from the config file so that backwards compatibility is maintained.
201
+
Additional implementation details are included in the Design Details section.
0 commit comments