Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Fix DNS lookup failure error for host URLs #449

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
hostNetwork and dnsPolicy options configurable
  • Loading branch information
Federico Bevione authored and Federico Bevione committed Feb 17, 2020
commit 1753ba78a6d7b5f471f217d5108d8b423f7fa01a
4 changes: 2 additions & 2 deletions metricbeat/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ spec:
initContainers:
{{ tpl .Values.extraInitContainers . | indent 6 }}
{{- end }}
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
hostNetwork: {{ .Values.hostNetwork | default false }}
dnsPolicy: {{ .Values.dnsPolicy | default "ClusterFirst" }}
containers:
- name: "metricbeat"
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
Expand Down
22 changes: 22 additions & 0 deletions metricbeat/tests/metricbeat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,28 @@ def test_defaults():
} in volumes


def test_override_the_default_host_network_option():
config = """
hostNetwork: true
"""
r = helm_template(config)
assert (
r["daemonset"][name]["spec"]["template"]["spec"]["hostNetwork"]
== True
)


def test_override_the_default_dns_policy_option():
config = """
dnsPolicy: ClusterFirstWithHostNet
"""
r = helm_template(config)
assert (
r["daemonset"][name]["spec"]["template"]["spec"]["dnsPolicy"]
== "ClusterFirstWithHostNet"
)


def test_adding_a_extra_container():
config = """
extraContainers: |
Expand Down
3 changes: 3 additions & 0 deletions metricbeat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ nodeSelector: {}

affinity: {}

hostNetwork: false
dnsPolicy: "ClusterFirst"

# This is the PriorityClass settings as defined in
# https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
priorityClassName: ""
Expand Down