2017-11-11 19:14:21 +08:00
|
|
|
|
[Unit]
|
|
|
|
|
Description=Kubernetes Kube-Proxy Server
|
|
|
|
|
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
|
|
|
|
|
After=network.target
|
|
|
|
|
|
|
|
|
|
[Service]
|
2019-08-25 23:19:30 +08:00
|
|
|
|
# kube-proxy 根据 --cluster-cidr 判断集群内部和外部流量,指定 --cluster-cidr 或 --masquerade-all 选项后,kube-proxy 会对访问 Service IP 的请求做 SNAT
|
2017-11-11 19:14:21 +08:00
|
|
|
|
WorkingDirectory=/var/lib/kube-proxy
|
|
|
|
|
ExecStart={{ bin_dir }}/kube-proxy \
|
2018-06-09 22:19:20 +08:00
|
|
|
|
--bind-address={{ inventory_hostname }} \
|
2019-08-25 23:19:30 +08:00
|
|
|
|
--cluster-cidr={{ CLUSTER_CIDR }} \
|
2018-06-09 22:19:20 +08:00
|
|
|
|
--hostname-override={{ inventory_hostname }} \
|
2017-11-11 19:14:21 +08:00
|
|
|
|
--kubeconfig=/etc/kubernetes/kube-proxy.kubeconfig \
|
|
|
|
|
--logtostderr=true \
|
2018-07-09 17:43:12 +08:00
|
|
|
|
--proxy-mode={{ PROXY_MODE }}
|
2019-07-19 13:47:10 +08:00
|
|
|
|
Restart=always
|
2017-11-11 19:14:21 +08:00
|
|
|
|
RestartSec=5
|
|
|
|
|
LimitNOFILE=65536
|
|
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
WantedBy=multi-user.target
|