support CoreDNS use host network and config dns port (#10617)
parent
f46910eac3
commit
bc5b38a771
|
@ -16,6 +16,8 @@ coredns_ordinal_suffix: ""
|
||||||
coredns_deployment_nodeselector: "kubernetes.io/os: linux"
|
coredns_deployment_nodeselector: "kubernetes.io/os: linux"
|
||||||
coredns_default_zone_cache_block: |
|
coredns_default_zone_cache_block: |
|
||||||
cache 30
|
cache 30
|
||||||
|
coredns_host_network: false
|
||||||
|
coredns_port: 53
|
||||||
# coredns_additional_configs adds any extra configuration to coredns
|
# coredns_additional_configs adds any extra configuration to coredns
|
||||||
# coredns_additional_configs: |
|
# coredns_additional_configs: |
|
||||||
# whoami
|
# whoami
|
||||||
|
|
|
@ -34,7 +34,7 @@ data:
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
.:53 {
|
.:{{ coredns_port }} {
|
||||||
{% if coredns_additional_configs is defined %}
|
{% if coredns_additional_configs is defined %}
|
||||||
{{ coredns_additional_configs | indent(width=8, first=False) }}
|
{{ coredns_additional_configs | indent(width=8, first=False) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -24,6 +24,7 @@ spec:
|
||||||
annotations:
|
annotations:
|
||||||
createdby: 'kubespray'
|
createdby: 'kubespray'
|
||||||
spec:
|
spec:
|
||||||
|
hostNetwork: {{ coredns_host_network | default(false) }}
|
||||||
securityContext:
|
securityContext:
|
||||||
seccompProfile:
|
seccompProfile:
|
||||||
type: RuntimeDefault
|
type: RuntimeDefault
|
||||||
|
@ -75,10 +76,10 @@ spec:
|
||||||
- name: config-volume
|
- name: config-volume
|
||||||
mountPath: /etc/coredns
|
mountPath: /etc/coredns
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 53
|
- containerPort: {{ coredns_port }}
|
||||||
name: dns
|
name: dns
|
||||||
protocol: UDP
|
protocol: UDP
|
||||||
- containerPort: 53
|
- containerPort: {{ coredns_port }}
|
||||||
name: dns-tcp
|
name: dns-tcp
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
- containerPort: 9153
|
- containerPort: 9153
|
||||||
|
|
|
@ -20,9 +20,11 @@ spec:
|
||||||
- name: dns
|
- name: dns
|
||||||
port: 53
|
port: 53
|
||||||
protocol: UDP
|
protocol: UDP
|
||||||
|
targetPort: "dns"
|
||||||
- name: dns-tcp
|
- name: dns-tcp
|
||||||
port: 53
|
port: 53
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
targetPort: "dns-tcp"
|
||||||
- name: metrics
|
- name: metrics
|
||||||
port: 9153
|
port: 9153
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
|
Loading…
Reference in New Issue