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

Prevent CoreDNS from rewriting it's configmap on restart #2214

Closed
VictorRobellini opened this issue Sep 8, 2020 · 7 comments
Closed

Prevent CoreDNS from rewriting it's configmap on restart #2214

VictorRobellini opened this issue Sep 8, 2020 · 7 comments

Comments

@VictorRobellini
Copy link

VictorRobellini commented Sep 8, 2020

I'm currently using k3s in my Lab to host different services. The situation is that I want to expose my services via LB. I've replaced the included LB with metallb. Being able to share my services via L2 is great but what's even better is that I can utilize the k8s_external extension in CoreDNS. This allows me to create a dedicated subdomain that hosts all of my Kubernetes services. All services automatically get resolved to the subdomain (service name = "A" record) via CoreDNS. With an externally accessible CoreDNS and LAN DHCP setting search domains, it's now easier than ever to interact with my services. All it requires is some DNS config on my non-K3s DNS servers and to add a single line to the CoreDNS config map... long and short resolvable names for all the services!

The problem is that whenever I restart my system or the k3s services, the configmap gets reverted back to its original state. I imagine that I could "--disable coredns" and install it myself, but staying as close to the k3s distribution is a much better long term plan.

@pavanfhw
Copy link

@VictorRobellini did you make any progress on this?

@brandond
Copy link
Member

For personal use I do just copy the coredns manifest to another file with a unique name, and start k3s with --disable coredns. We don't currently have a good way to customize configuration of resources other than the Traefik helm chart.

@VictorRobellini
Copy link
Author

I used --disable coredns and just installed it manually.

@stale
Copy link

stale bot commented Jul 30, 2021

This repository uses a bot to automatically label issues which have not had any activity (commit/comment/label) for 180 days. This helps us manage the community issues better. If the issue is still relevant, please add a comment to the issue so the bot can remove the label and we know it is still valid. If it is no longer relevant (or possibly fixed in the latest release), the bot will automatically close the issue in 14 days. Thank you for your contributions.

@stale stale bot added the status/stale label Jul 30, 2021
@stale stale bot closed this as completed Aug 14, 2021
@m-bers
Copy link

m-bers commented Mar 22, 2022

@VictorRobellini did you just manually configure NodeHosts as described in this comment?

I'm trying to do almost the exact same thing as you but with Klipper instead of MetalLB but I want to be able to add nodes dynamically and this workaround feels pretty fragile.

@VictorRobellini
Copy link
Author

@m-bers, I've never messed with that option, it wasn't needed to get my system up and running. I redeployed about 2 months ago and k8s_external was all I needed.

@m-bers
Copy link

m-bers commented Mar 23, 2022

I actually got my setup working today by creating another server block in coredns-custom, in case anyone else finds it useful:

apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns-custom
  namespace: kube-system
data:
  external.server: |
    cluster.external:53 {
      kubernetes
      k8s_external cluster.external
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants