** Please be patient while the chart is being deployed **

Watch the Node Exporter DaemonSet status using the command:

    kubectl get ds -w --namespace {{ .Release.Namespace }} -l app.kubernetes.io/name={{ template "node-exporter.name" . }},app.kubernetes.io/instance={{ .Release.Name }}

Node Exporter can be accessed via port "{{ .Values.service.port }}" on the following DNS name from within your cluster:

    {{ template "node-exporter.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local

To access Node Exporter from outside the cluster execute the following commands:

{{- if contains "LoadBalancer" .Values.service.type }}

    NOTE: It may take a few minutes for the LoadBalancer IP to be available.
    Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "node-exporter.fullname" . }}'

{{- $port:=.Values.service.port | toString }}

    export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "node-exporter.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
    echo "URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/"

{{- else if contains "ClusterIP"  .Values.service.type }}

    echo "URL: http://127.0.0.1:9100/"
    kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "node-exporter.fullname" . }} 9100:{{ .Values.service.port }}

{{- else if contains "NodePort" .Values.service.type }}

    export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "node-exporter.fullname" . }})
    export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
    echo "URL: http://$NODE_IP:$NODE_PORT/"

{{- end }}

{{- include "node-exporter.validateValues" . }}
{{- include "node-exporter.checkRollingTags" . }}
