We have a lot of servers in our network with fqnds that can only be resolved by nameservers in our private network.
How can I configure our k3s/awx cluster to forward lookup requests for fqdns matching ‘*.example.abc’ (for example) to our internal nameservers?
I’m very new to all things kubernetes so an answer that details the changes that need to be made to the existing configuration would be much appreciated.
My understanding is that changing the dnsPolicy setting from ‘ClusterFirst’ to ‘Default’ will cause the cluster to inherit the dns configuration of the host.
How can I do that?
Hi,
I had a similar issue and I ended up using a custom pod spec to set the dnsConfig section when my execution pod starts. You can specify how to configure your DNS setup
Here’s an example of the dnsConfig Spec options . My custom Pod spec just needs to add a searches to the dnsCOnfig so that i didnt needt to use FQDN for my hosts:
You can override the pod spec by finding the default container group (under instance groups - name Default) and then edit the definition. Maybe try:
apiVersion: v1
kind: Pod
metadata:
namespace: mynamespace
spec:
serviceAccountName: myserviceaccountname
containers:
image: ‘myimage’
name: worker
args:
ansible-runner
worker
‘–private-data-dir=/runner’
resources:
requests:
cpu: 250m
memory: 100Mi
dnsPolicy: “Default” You can force specific nameservers too, for example in a new containergroup, and then configure your jobs that need the alternative nameservers to use the new containergroup apiVersion: v1
kind: Pod
metadata:
namespace: mynamespace
spec:
serviceAccountName: myserviceaccountname
containers: