2017-06-27 06:55:39 +02:00
|
|
|
---
|
|
|
|
systemd:
|
|
|
|
units:
|
|
|
|
- name: docker.service
|
|
|
|
enable: true
|
|
|
|
- name: locksmithd.service
|
2017-06-27 07:22:28 +02:00
|
|
|
mask: true
|
2017-06-27 06:55:39 +02:00
|
|
|
- name: wait-for-dns.service
|
|
|
|
enable: true
|
|
|
|
contents: |
|
|
|
|
[Unit]
|
|
|
|
Description=Wait for DNS entries
|
|
|
|
Wants=systemd-resolved.service
|
|
|
|
Before=kubelet.service
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
|
|
|
RemainAfterExit=true
|
|
|
|
ExecStart=/bin/sh -c 'while ! /usr/bin/grep '^[^#[:space:]]' /etc/resolv.conf > /dev/null; do sleep 1; done'
|
|
|
|
[Install]
|
|
|
|
RequiredBy=kubelet.service
|
|
|
|
- name: kubelet.service
|
|
|
|
enable: true
|
|
|
|
contents: |
|
|
|
|
[Unit]
|
|
|
|
Description=Kubelet via Hyperkube ACI
|
2017-09-25 03:04:48 +02:00
|
|
|
Wants=rpc-statd.service
|
2017-06-27 06:55:39 +02:00
|
|
|
[Service]
|
|
|
|
EnvironmentFile=/etc/kubernetes/kubelet.env
|
2017-09-14 06:48:05 +02:00
|
|
|
Environment="RKT_RUN_ARGS=--uuid-file-save=/var/cache/kubelet-pod.uuid \
|
2017-06-27 06:55:39 +02:00
|
|
|
--volume=resolv,kind=host,source=/etc/resolv.conf \
|
|
|
|
--mount volume=resolv,target=/etc/resolv.conf \
|
|
|
|
--volume var-lib-cni,kind=host,source=/var/lib/cni \
|
|
|
|
--mount volume=var-lib-cni,target=/var/lib/cni \
|
2017-09-14 06:48:05 +02:00
|
|
|
--volume opt-cni-bin,kind=host,source=/opt/cni/bin \
|
|
|
|
--mount volume=opt-cni-bin,target=/opt/cni/bin \
|
2017-06-27 06:55:39 +02:00
|
|
|
--volume var-log,kind=host,source=/var/log \
|
2017-10-20 10:00:08 +02:00
|
|
|
--mount volume=var-log,target=/var/log \
|
2017-10-25 06:34:29 +02:00
|
|
|
--hosts-entry=host \
|
|
|
|
--insecure-options=image"
|
2017-09-14 06:48:05 +02:00
|
|
|
ExecStartPre=/bin/mkdir -p /opt/cni/bin
|
2017-06-27 06:55:39 +02:00
|
|
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests
|
|
|
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d
|
|
|
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/checkpoint-secrets
|
|
|
|
ExecStartPre=/bin/mkdir -p /etc/kubernetes/inactive-manifests
|
|
|
|
ExecStartPre=/bin/mkdir -p /var/lib/cni
|
|
|
|
ExecStartPre=/usr/bin/bash -c "grep 'certificate-authority-data' /etc/kubernetes/kubeconfig | awk '{print $2}' | base64 -d > /etc/kubernetes/ca.crt"
|
2017-09-14 06:48:05 +02:00
|
|
|
ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/cache/kubelet-pod.uuid
|
2017-06-27 06:55:39 +02:00
|
|
|
ExecStart=/usr/lib/coreos/kubelet-wrapper \
|
2017-09-14 06:48:05 +02:00
|
|
|
--allow-privileged \
|
2017-06-27 06:55:39 +02:00
|
|
|
--anonymous-auth=false \
|
2017-09-14 06:48:05 +02:00
|
|
|
--client-ca-file=/etc/kubernetes/ca.crt \
|
|
|
|
--cluster_dns=${k8s_dns_service_ip} \
|
|
|
|
--cluster_domain=cluster.local \
|
2017-06-27 06:55:39 +02:00
|
|
|
--cni-conf-dir=/etc/kubernetes/cni/net.d \
|
|
|
|
--exit-on-lock-contention \
|
2017-09-14 06:48:05 +02:00
|
|
|
--kubeconfig=/etc/kubernetes/kubeconfig \
|
|
|
|
--lock-file=/var/run/lock/kubelet.lock \
|
|
|
|
--network-plugin=cni \
|
2017-06-27 06:55:39 +02:00
|
|
|
--node-labels=node-role.kubernetes.io/master \
|
2017-09-14 06:48:05 +02:00
|
|
|
--pod-manifest-path=/etc/kubernetes/manifests \
|
2017-06-27 06:55:39 +02:00
|
|
|
--register-with-taints=node-role.kubernetes.io/master=:NoSchedule \
|
2017-09-14 06:48:05 +02:00
|
|
|
--require-kubeconfig
|
|
|
|
ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid
|
2017-06-27 06:55:39 +02:00
|
|
|
Restart=always
|
|
|
|
RestartSec=10
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
- name: bootkube.service
|
|
|
|
contents: |
|
|
|
|
[Unit]
|
|
|
|
Description=Bootstrap a Kubernetes cluster
|
|
|
|
ConditionPathExists=!/opt/bootkube/init_bootkube.done
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
|
|
|
RemainAfterExit=true
|
|
|
|
WorkingDirectory=/opt/bootkube
|
|
|
|
ExecStart=/opt/bootkube/bootkube-start
|
|
|
|
ExecStartPost=/bin/touch /opt/bootkube/init_bootkube.done
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
storage:
|
|
|
|
files:
|
|
|
|
- path: /etc/kubernetes/kubeconfig
|
|
|
|
filesystem: root
|
|
|
|
mode: 0644
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Config
|
|
|
|
clusters:
|
|
|
|
- name: local
|
|
|
|
cluster:
|
|
|
|
server: ${kubeconfig_server}
|
|
|
|
certificate-authority-data: ${kubeconfig_ca_cert}
|
|
|
|
users:
|
|
|
|
- name: kubelet
|
|
|
|
user:
|
|
|
|
client-certificate-data: ${kubeconfig_kubelet_cert}
|
|
|
|
client-key-data: ${kubeconfig_kubelet_key}
|
|
|
|
contexts:
|
|
|
|
- context:
|
|
|
|
cluster: local
|
|
|
|
user: kubelet
|
|
|
|
- path: /etc/kubernetes/kubelet.env
|
|
|
|
filesystem: root
|
|
|
|
mode: 0644
|
|
|
|
contents:
|
|
|
|
inline: |
|
2017-10-25 06:34:29 +02:00
|
|
|
KUBELET_IMAGE_URL=docker://gcr.io/google_containers/hyperkube
|
|
|
|
KUBELET_IMAGE_TAG=v1.8.2
|
2017-06-27 06:55:39 +02:00
|
|
|
- path: /etc/sysctl.d/max-user-watches.conf
|
|
|
|
filesystem: root
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
fs.inotify.max_user_watches=16184
|
|
|
|
- path: /opt/bootkube/bootkube-start
|
|
|
|
filesystem: root
|
|
|
|
mode: 0544
|
|
|
|
user:
|
|
|
|
id: 500
|
|
|
|
group:
|
|
|
|
id: 500
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
#!/bin/bash
|
|
|
|
# Wrapper for bootkube start
|
|
|
|
set -e
|
|
|
|
# Move experimental manifests
|
2017-09-05 06:14:05 +02:00
|
|
|
[ -d /opt/bootkube/assets/manifests-* ] && mv /opt/bootkube/assets/manifests-*/* /opt/bootkube/assets/manifests && rm -rf /opt/bootkube/assets/manifests-*
|
2017-06-27 06:55:39 +02:00
|
|
|
[ -d /opt/bootkube/assets/experimental/manifests ] && mv /opt/bootkube/assets/experimental/manifests/* /opt/bootkube/assets/manifests && rm -r /opt/bootkube/assets/experimental/manifests
|
|
|
|
[ -d /opt/bootkube/assets/experimental/bootstrap-manifests ] && mv /opt/bootkube/assets/experimental/bootstrap-manifests/* /opt/bootkube/assets/bootstrap-manifests && rm -r /opt/bootkube/assets/experimental/bootstrap-manifests
|
|
|
|
BOOTKUBE_ACI="$${BOOTKUBE_ACI:-quay.io/coreos/bootkube}"
|
2017-10-20 10:00:08 +02:00
|
|
|
BOOTKUBE_VERSION="$${BOOTKUBE_VERSION:-v0.8.0}"
|
2017-06-27 06:55:39 +02:00
|
|
|
BOOTKUBE_ASSETS="$${BOOTKUBE_ASSETS:-/opt/bootkube/assets}"
|
|
|
|
exec /usr/bin/rkt run \
|
|
|
|
--trust-keys-from-https \
|
|
|
|
--volume assets,kind=host,source=$${BOOTKUBE_ASSETS} \
|
|
|
|
--mount volume=assets,target=/assets \
|
|
|
|
--volume bootstrap,kind=host,source=/etc/kubernetes \
|
|
|
|
--mount volume=bootstrap,target=/etc/kubernetes \
|
|
|
|
$${RKT_OPTS} \
|
|
|
|
$${BOOTKUBE_ACI}:$${BOOTKUBE_VERSION} \
|
|
|
|
--net=host \
|
|
|
|
--dns=host \
|
|
|
|
--exec=/bootkube -- start --asset-dir=/assets "$@"
|
|
|
|
passwd:
|
|
|
|
users:
|
|
|
|
- name: core
|
|
|
|
ssh_authorized_keys:
|
|
|
|
- "${ssh_authorized_keys}"
|