Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions metricbeat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ helm install --name metricbeat elastic/metricbeat --set imageTag=7.6.0
| `clusterRoleRules` | Configurable [cluster role rules](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole) that Metricbeat uses to access Kubernetes resources. | see [values.yaml](https://github.com/elastic/helm-charts/tree/master/metricbeat/values.yaml) |
| `podAnnotations` | Configurable [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) applied to all Metricbeat pods | `{}` |
| `podSecurityContext` | Configurable [podSecurityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) for Metricbeat pod execution environment | `runAsUser: 0`<br>`privileged: false` |
| `hostNetworking` | Use host networking in the daemonset so that hostname is reported correctly. **NOTE**: daemonset only | false
| `dnsPolicy` | Configurable [dnsPolicy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/) **NOTE**: daemonset only | `ClusterFirst`
| `livenessProbe` | Parameters to pass to [liveness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/) checks for values such as timeouts and thresholds. | `failureThreshold: 3`<br>`initialDelaySeconds: 10`<br>`periodSeconds: 10`<br>`successThreshold: 3`<br>`timeoutSeconds: 5` |
| `readinessProbe` | Parameters to pass to [readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/) checks for values such as timeouts and thresholds. | `failureThreshold: 3`<br>`initialDelaySeconds: 10`<br>`periodSeconds: 10`<br>`successThreshold: 3`<br>`timeoutSeconds: 5` |
| `resources` | Allows you to set the [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) for the `DaemonSet` | `requests.cpu: 100m`<br>`requests.memory: 100Mi`<br>`limits.cpu: 1000m`<br>`limits.memory: 200Mi` |
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ spec:
initContainers:
{{ tpl .Values.extraInitContainers . | indent 6 }}
{{- end }}
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