2017-11-11 19:14:21 +08:00
|
|
|
[Unit]
|
|
|
|
Description=Kubernetes API Server
|
|
|
|
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
|
|
|
After=network.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
ExecStart={{ bin_dir }}/kube-apiserver \
|
2018-11-19 18:47:37 +08:00
|
|
|
--admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota,NodeRestriction,MutatingAdmissionWebhook,ValidatingAdmissionWebhook \
|
2018-06-09 22:19:20 +08:00
|
|
|
--bind-address={{ inventory_hostname }} \
|
2017-11-11 19:14:21 +08:00
|
|
|
--insecure-bind-address=127.0.0.1 \
|
|
|
|
--authorization-mode=Node,RBAC \
|
|
|
|
--kubelet-https=true \
|
2018-10-06 10:21:04 +08:00
|
|
|
--kubelet-client-certificate={{ ca_dir }}/admin.pem \
|
|
|
|
--kubelet-client-key={{ ca_dir }}/admin-key.pem \
|
2017-11-11 19:14:21 +08:00
|
|
|
--anonymous-auth=false \
|
2019-03-14 23:51:04 +08:00
|
|
|
{% if BASIC_AUTH_ENABLE == "yes" %}
|
2017-11-11 19:14:21 +08:00
|
|
|
--basic-auth-file={{ ca_dir }}/basic-auth.csv \
|
2019-03-14 23:51:04 +08:00
|
|
|
{% endif %}
|
2017-11-11 19:14:21 +08:00
|
|
|
--service-cluster-ip-range={{ SERVICE_CIDR }} \
|
|
|
|
--service-node-port-range={{ NODE_PORT_RANGE }} \
|
|
|
|
--tls-cert-file={{ ca_dir }}/kubernetes.pem \
|
|
|
|
--tls-private-key-file={{ ca_dir }}/kubernetes-key.pem \
|
|
|
|
--client-ca-file={{ ca_dir }}/ca.pem \
|
|
|
|
--service-account-key-file={{ ca_dir }}/ca-key.pem \
|
|
|
|
--etcd-cafile={{ ca_dir }}/ca.pem \
|
|
|
|
--etcd-certfile={{ ca_dir }}/kubernetes.pem \
|
|
|
|
--etcd-keyfile={{ ca_dir }}/kubernetes-key.pem \
|
|
|
|
--etcd-servers={{ ETCD_ENDPOINTS }} \
|
|
|
|
--enable-swagger-ui=true \
|
2018-04-08 09:39:59 +08:00
|
|
|
--endpoint-reconciler-type=lease \
|
2017-11-11 19:14:21 +08:00
|
|
|
--allow-privileged=true \
|
|
|
|
--audit-log-maxage=30 \
|
|
|
|
--audit-log-maxbackup=3 \
|
|
|
|
--audit-log-maxsize=100 \
|
|
|
|
--audit-log-path=/var/lib/audit.log \
|
|
|
|
--event-ttl=1h \
|
2018-06-17 10:46:25 +08:00
|
|
|
--requestheader-client-ca-file={{ ca_dir }}/ca.pem \
|
2018-07-05 15:46:42 +08:00
|
|
|
--requestheader-allowed-names= \
|
2018-06-17 10:46:25 +08:00
|
|
|
--requestheader-extra-headers-prefix=X-Remote-Extra- \
|
|
|
|
--requestheader-group-headers=X-Remote-Group \
|
|
|
|
--requestheader-username-headers=X-Remote-User \
|
2018-06-17 13:07:57 +08:00
|
|
|
--proxy-client-cert-file={{ ca_dir }}/aggregator-proxy.pem \
|
|
|
|
--proxy-client-key-file={{ ca_dir }}/aggregator-proxy-key.pem \
|
2018-06-17 10:46:25 +08:00
|
|
|
--enable-aggregator-routing=true \
|
2018-07-27 17:27:42 +08:00
|
|
|
--runtime-config=batch/v2alpha1=true \
|
2017-11-11 19:14:21 +08:00
|
|
|
--v=2
|
|
|
|
Restart=on-failure
|
|
|
|
RestartSec=5
|
|
|
|
Type=notify
|
|
|
|
LimitNOFILE=65536
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|