#!/bin/bash

HOSTNAME="$(hostname -f)"


# Setting --hostname-override is a workaround for https://github.com/kubernetes/kubeadm/issues/653
# Setting --cloud-provider is a workaround for https://github.com/kubernetes/kubeadm/issues/620
/bin/cat > /etc/systemd/system/kubelet.service.d/10-hostname.conf <<EOF
[Service]
Environment="KUBELET_EXTRA_ARGS= --hostname-override=${HOSTNAME} --cloud-provider=aws"
EOF
systemctl daemon-reload

#!/bin/bash

HOSTNAME="$(hostname -f)"


# Setting --hostname-override is a workaround for https://github.com/kubernetes/kubeadm/issues/653
# Setting --cloud-provider is a workaround for https://github.com/kubernetes/kubeadm/issues/620
# Setting --authentication-token-webhook allows authenticated Prometheus access to the Kubelet metrics endpoint
# (see https://github.com/coreos/prometheus-operator/blob/master/contrib/kube-prometheus/docs/kube-prometheus-on-kubeadm.md)
/bin/cat > /etc/systemd/system/kubelet.service.d/10-hostname.conf <<EOF
[Service]
Environment="KUBELET_EXTRA_ARGS= --hostname-override=${HOSTNAME} --cloud-provider=aws --authentication-token-webhook=true"
EOF
systemctl daemon-reload

Tweak some settings for better Prometheus metrics access.
Tweak some settings for better Prometheus metrics access.

These are essentially the changes documented in https://github.com/coreos/prometheus-operator/blob/master/contrib/kube-prometheus/docs/kube-prometheus-on-kubeadm.md.

Signed-off-by: Matt Moyer <008a35542a21e53a065e010240fafe9ee9f69136@heptio.com>
