|
| 1 | +# KEP-2595: Expanded DNS Configuration |
| 2 | + |
| 3 | +<!-- toc --> |
| 4 | +- [Release Signoff Checklist](#release-signoff-checklist) |
| 5 | +- [Summary](#summary) |
| 6 | +- [Motivation](#motivation) |
| 7 | + - [Goals](#goals) |
| 8 | + - [Non-Goals](#non-goals) |
| 9 | +- [Proposal](#proposal) |
| 10 | + - [User Stories (Optional)](#user-stories-optional) |
| 11 | + - [Story 1](#story-1) |
| 12 | + - [Story 2](#story-2) |
| 13 | + - [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional) |
| 14 | + - [Risks and Mitigations](#risks-and-mitigations) |
| 15 | +- [Design Details](#design-details) |
| 16 | + - [Test Plan](#test-plan) |
| 17 | + - [Graduation Criteria](#graduation-criteria) |
| 18 | + - [Alpha](#alpha) |
| 19 | + - [Alpha -> Beta Graduation](#alpha---beta-graduation) |
| 20 | + - [Beta -> GA Graduation](#beta---ga-graduation) |
| 21 | + - [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy) |
| 22 | + - [Version Skew Strategy](#version-skew-strategy) |
| 23 | +- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire) |
| 24 | + - [Feature Enablement and Rollback](#feature-enablement-and-rollback) |
| 25 | + - [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning) |
| 26 | + - [Monitoring Requirements](#monitoring-requirements) |
| 27 | + - [Dependencies](#dependencies) |
| 28 | + - [Scalability](#scalability) |
| 29 | + - [Troubleshooting](#troubleshooting) |
| 30 | +- [Implementation History](#implementation-history) |
| 31 | +- [Drawbacks](#drawbacks) |
| 32 | +- [Alternatives](#alternatives) |
| 33 | +- [Infrastructure Needed (Optional)](#infrastructure-needed-optional) |
| 34 | +<!-- /toc --> |
| 35 | + |
| 36 | +## Release Signoff Checklist |
| 37 | + |
| 38 | +Items marked with (R) are required *prior to targeting to a milestone / release*. |
| 39 | + |
| 40 | +- [x] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR) |
| 41 | +- [x] (R) KEP approvers have approved the KEP status as `implementable` |
| 42 | +- [x] (R) Design details are appropriately documented |
| 43 | +- [x] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors) |
| 44 | +- [x] (R) Graduation criteria is in place |
| 45 | +- [x] (R) Production readiness review completed |
| 46 | +- [x] (R) Production readiness review approved |
| 47 | +- [ ] "Implementation History" section is up-to-date for milestone |
| 48 | +- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io] |
| 49 | +- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes |
| 50 | + |
| 51 | +[kubernetes.io]: https://kubernetes.io/ |
| 52 | +[kubernetes/enhancements]: https://git.k8s.io/enhancements |
| 53 | +[kubernetes/kubernetes]: https://git.k8s.io/kubernetes |
| 54 | +[kubernetes/website]: https://git.k8s.io/website |
| 55 | + |
| 56 | +## Summary |
| 57 | + |
| 58 | +Allow kubernetes to have expanded DNS(Domain Name System) configuration. |
| 59 | + |
| 60 | +## Motivation |
| 61 | + |
| 62 | +Kubernetes today limits DNS configuration according to [the obsolete |
| 63 | +criteria](https://access.redhat.com/solutions/58028). As recent DNS resolvers |
| 64 | +allow an arbitrary number of search paths, a new feature gate |
| 65 | +`ExpandedDNSConfig` will be introduced. With this feature, kubernetes allows |
| 66 | +more DNS search paths and longer list of DNS search paths to keep up with recent |
| 67 | +DNS resolvers. |
| 68 | + |
| 69 | +Confirmed that expanded DNS configuration is supported by |
| 70 | +- `glibc 2.17-323` |
| 71 | +- `glibc 2.28` |
| 72 | +- `musl libc 1.22` |
| 73 | +- `pure Go 1.10 resolver` |
| 74 | +- `pure Go 1.16 resolver` |
| 75 | + |
| 76 | +### Goals |
| 77 | + |
| 78 | +- Make `kube-apiserver` allow expanded DNS configuration when validating Pod's |
| 79 | +or PodTemplate's `DNSConfig` |
| 80 | +- Make `kubelet` allow expanded DNS configuration when validating |
| 81 | +[`resolvConf`](https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration) |
| 82 | +- Make `kubelet` allow expanded DNS configuration when validating actual DNS |
| 83 | +resolver configuration composed of `cluster domain suffixes`(e.g. |
| 84 | + default.svc.cluster.local, svc.cluster.local, cluster.local), kubelet's |
| 85 | +`resolvConf` and Pod's `DNSConfig` |
| 86 | + |
| 87 | +### Non-Goals |
| 88 | + |
| 89 | +- Remove limitation on DNS search paths completely |
| 90 | +- Let cluster administrators limit the number of search paths or the length of |
| 91 | +DNS search path list to an arbitrary number |
| 92 | + |
| 93 | +## Proposal |
| 94 | + |
| 95 | +- Expand `MaxDNSSearchPaths` to 32 |
| 96 | +- Expand `MaxDNSSearchListChars` to 2048 |
| 97 | + |
| 98 | +### User Stories (Optional) |
| 99 | + |
| 100 | +#### Story 1 |
| 101 | + |
| 102 | +#### Story 2 |
| 103 | + |
| 104 | +### Notes/Constraints/Caveats (Optional) |
| 105 | + |
| 106 | +This enhancement relaxes the validation of `Pod` and `PodTemplate`. Once the |
| 107 | +feature is activated, it must be carefully disabled. Otherwise, the objects left |
| 108 | +over from the previous version which have the expanded DNS configuration can be |
| 109 | +problematic. |
| 110 | + |
| 111 | +### Risks and Mitigations |
| 112 | + |
| 113 | +There may be some environments(DNS resolver or others) that break without |
| 114 | +current limitations. At this point, it is fair to open a bug, so they can fix it. |
| 115 | + |
| 116 | +## Design Details |
| 117 | + |
| 118 | +- Declare and define `MaxDNSSearchPathsExpanded` to `32` and |
| 119 | +`MaxDNSSearchListCharsExpanded` to `2048` |
| 120 | +- Add the feature gate `ExpandedDNSConfig` (see [Feature Enablement and |
| 121 | +Rollback](#feature-enablement-and-rollback)) |
| 122 | +- If the feature gate `ExpandedDNSConfig` is enabled, replace |
| 123 | +`MaxDNSSearchPaths` with `MaxDNSSearchPathsExpanded` and replace |
| 124 | +`MaxDNSSearchListChars` with `MaxDNSSearchListCharsExpanded` to allow expanded |
| 125 | +DNS configuration |
| 126 | + |
| 127 | +### Test Plan |
| 128 | + |
| 129 | +- Add unit tests of validating expanded DNS config |
| 130 | + |
| 131 | +### Graduation Criteria |
| 132 | + |
| 133 | +#### Alpha |
| 134 | + |
| 135 | +- Implement the feature |
| 136 | +- Add appropriate unit tests |
| 137 | + |
| 138 | +#### Alpha -> Beta Graduation |
| 139 | + |
| 140 | +- Address feedback from alpha |
| 141 | +- Sufficient testing |
| 142 | + |
| 143 | +#### Beta -> GA Graduation |
| 144 | + |
| 145 | +- Address feedback from beta |
| 146 | +- Sufficient number of users using the feature |
| 147 | +- Close on any remaining open issues & bugs |
| 148 | + |
| 149 | +### Upgrade / Downgrade Strategy |
| 150 | + |
| 151 | +N/A |
| 152 | + |
| 153 | +### Version Skew Strategy |
| 154 | + |
| 155 | +In clusters with older kubelets, old kubelets with `resolvConf` configured to |
| 156 | +exceed bounds throw warnings but do not fail. Eventually, old kubelets truncate |
| 157 | +the overage and apply the actual DNS resolver configuration. |
| 158 | + |
| 159 | +In clusters with a replicated control plane, all kube-apiservers should enable |
| 160 | +or disable the expanded DNS configuration feature. |
| 161 | + |
| 162 | +## Production Readiness Review Questionnaire |
| 163 | + |
| 164 | +### Feature Enablement and Rollback |
| 165 | + |
| 166 | +- **How can this feature be enabled / disabled in a live cluster?** |
| 167 | + - [x] Feature gate (also fill in values in `kep.yaml`) |
| 168 | + - Feature gate name: `ExpandedDNSConfig` |
| 169 | + - Components depending on the feature gate: |
| 170 | + - `kubelet` |
| 171 | + - `kube-apiserver` |
| 172 | + - [ ] Other |
| 173 | + - Describe the mechanism: |
| 174 | + - Will enabling / disabling the feature require downtime of the control |
| 175 | + plane? |
| 176 | + - Will enabling / disabling the feature require downtime or reprovisioning |
| 177 | + of a node? (Do not assume `Dynamic Kubelet Config` feature is enabled). |
| 178 | + |
| 179 | +- **Does enabling the feature change any default behavior?** |
| 180 | + |
| 181 | +Enabling this feature allows kubernetes to have objects(Pod or PodTemplate) with |
| 182 | +the expanded DNS configuration. |
| 183 | + |
| 184 | +- **Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?** |
| 185 | + |
| 186 | +Yes, the feature can be disabled by disabling the feature gate. |
| 187 | + |
| 188 | +Once the feature is disabled, kube-apiserver will reject the pod having expanded |
| 189 | +DNS configuration and kubelet will create a resolver configuration excluding the |
| 190 | +overage. |
| 191 | + |
| 192 | +- **What happens if we reenable the feature if it was previously rolled back?** |
| 193 | + |
| 194 | +New objects with expanded DNS configuration will be accepted by the apiserver |
| 195 | +and new Pods with expanded configuration will be created by the kubelet. |
| 196 | + |
| 197 | +- **Are there any tests for feature enablement/disablement?** |
| 198 | + |
| 199 | +We will add unit tests. |
| 200 | + |
| 201 | +### Rollout, Upgrade and Rollback Planning |
| 202 | + |
| 203 | +- **How can a rollout fail? Can it impact already running workloads?** |
| 204 | + |
| 205 | +If a kubelet starts with invalid `resolvConf`, new workloads will fail DNS |
| 206 | +lookups. |
| 207 | + |
| 208 | +- **What specific metrics should inform a rollback?** |
| 209 | + |
| 210 | +If new workloads start to fail DNS lookups due to a corrupted resolv.conf, or |
| 211 | +due to older resolver libraries, that would be an indication to rollback the |
| 212 | +enablement. |
| 213 | + |
| 214 | +- **Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?** |
| 215 | + |
| 216 | +We will do test. |
| 217 | + |
| 218 | +- **Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?** |
| 219 | + |
| 220 | +No |
| 221 | + |
| 222 | +### Monitoring Requirements |
| 223 | + |
| 224 | +- **How can an operator determine if the feature is in use by workloads?** |
| 225 | + |
| 226 | +There is no metric to indicate the enablement. The operator has to check if |
| 227 | +there are objects or DNS resolver configuration files with expanded |
| 228 | +configuration to determine if the feature is in use. |
| 229 | + |
| 230 | +- **What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?** |
| 231 | + - [ ] Metrics |
| 232 | + - Metric name: |
| 233 | + - [Optional] Aggregation method: |
| 234 | + - Components exposing the metric: |
| 235 | + - [x] Other (treat as last resort) |
| 236 | + - Success of DNS lookups |
| 237 | + |
| 238 | +- **What are the reasonable SLOs (Service Level Objectives) for the above SLIs?** |
| 239 | + |
| 240 | +DNS lookups should not fail as before the feature was enabled. |
| 241 | + |
| 242 | +- **Are there any missing metrics that would be useful to have to improve observability of this feature?** |
| 243 | + |
| 244 | +TBD |
| 245 | + |
| 246 | +### Dependencies |
| 247 | + |
| 248 | +- **Does this feature depend on any specific services running in the cluster?** |
| 249 | + |
| 250 | +No |
| 251 | + |
| 252 | +### Scalability |
| 253 | + |
| 254 | +- **Will enabling / using this feature result in any new API calls?** |
| 255 | + |
| 256 | +No |
| 257 | + |
| 258 | +- **Will enabling / using this feature result in introducing new API types?** |
| 259 | + |
| 260 | +No |
| 261 | + |
| 262 | +- **Will enabling / using this feature result in any new calls to the cloud provider?** |
| 263 | + |
| 264 | +No |
| 265 | + |
| 266 | +- **Will enabling / using this feature result in increasing size or count of the existing API objects?** |
| 267 | + |
| 268 | +The sum of the lengths of `PodSpec.DNSConfig.Searches` can be increased to 2048. |
| 269 | + |
| 270 | +- **Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs?** |
| 271 | + |
| 272 | +The DNS lookup time can be increased, but it will be negligible. |
| 273 | + |
| 274 | +- **Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?** |
| 275 | + |
| 276 | +No |
| 277 | + |
| 278 | +### Troubleshooting |
| 279 | + |
| 280 | +- **How does this feature react if the API server and/or etcd is unavailable?** |
| 281 | + |
| 282 | +N/A |
| 283 | + |
| 284 | +- **What are other known failure modes?** |
| 285 | + |
| 286 | +N/A |
| 287 | + |
| 288 | +- **What steps should be taken if SLOs are not being met to determine the problem?** |
| 289 | + |
| 290 | +If DNS lookups fail, you can check error messages. And then, validate the |
| 291 | +kubelet's `resolvConf` if it is corrupted or use newer DNS resolver libraries if |
| 292 | +they are too old. |
| 293 | + |
| 294 | +## Implementation History |
| 295 | + |
| 296 | +- 2021-03-26: [Initial |
| 297 | +discussion at #100583](https://github.com/kubernetes/kubernetes/pull/100583) |
| 298 | + |
| 299 | +## Drawbacks |
| 300 | + |
| 301 | +## Alternatives |
| 302 | + |
| 303 | +- Remove the limitation of DNS search paths completely |
| 304 | +- Make `MaxDNSSearchPaths` and `MaxDNSSearchListChars` configurable |
| 305 | + |
| 306 | +## Infrastructure Needed (Optional) |
0 commit comments