Skip to content
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

[Enhancement] Edit CoreDNS ConfigMap on disk for more reliability #814

Merged
merged 3 commits into from
Oct 22, 2021

Conversation

iwilltry42
Copy link
Member

@iwilltry42 iwilltry42 commented Oct 22, 2021

Goal

  • add host entries to the existing NodeHosts section of the CoreDNS configmap
    • host.k3d.internal -> docker host reference
    • k3d nodes (K3s node containers) -> also managed by the K3s node controller
    • k3d helper nodes (serverlb, registry, etc.)
    • other containers in the same docker network

Current Way

  • basically kubectl patch configmap ...
  • problems: has to wait for cluster to be ready
    • coredns configmap must be present
    • API Server must be responsive
  • impact: fails to create cluster in some cases, even with lots of retries

New Way

  • wait for coredns.yaml to be written to disk
  • read coredns.yaml from disk, modify the configmap included to add our entries to NodeHosts
  • let the K3s controller re-deploy the configmap (very fast)
  • let CoreDNS auto-reload the config (up to 30s due to the default reload interval)
  • benefits: more reliable, no retries needed, no need to wait for other parts of K3s to be up and running

Future

This is still hacky, so we're hoping for an alternative solution soon, e.g. similar to this: https://github.com/k3s-io/k3s/pull/743/files

References

fixes #786
potentially fixes #805

@iwilltry42 iwilltry42 added this to the v5.0.2 milestone Oct 22, 2021
@iwilltry42 iwilltry42 self-assigned this Oct 22, 2021
@iwilltry42 iwilltry42 added this to In progress in Networking via automation Oct 22, 2021
@iwilltry42 iwilltry42 changed the title [ENhancement] Edit CoreDNS ConfigMap on disk for more reliability [Enhancement] Edit CoreDNS ConfigMap on disk for more reliability Oct 22, 2021
@iwilltry42 iwilltry42 merged commit 7113694 into main Oct 22, 2021
Networking automation moved this from In progress to Done Oct 22, 2021
@iwilltry42 iwilltry42 deleted the fix/coredns-infile branch October 22, 2021 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
1 participant