Custom role for control plane

This commit is contained in:
Paul-Henri Froidmont 2018-08-01 11:10:51 +02:00
parent 44a7d1684f
commit 126143e7e1
18 changed files with 1445 additions and 5 deletions

View file

@ -0,0 +1,23 @@
#jinja2: trim_blocks:False
{%- macro cluster_hosts() -%}
{%- for host in groups['k8s_etcd'] -%}
https://{{hostvars[host]['ansible_' + k8s_interface].ipv4.address}}:{{etcd_client_port}}{% if not loop.last %},{% endif %}
{%- endfor -%}
{%- endmacro -%}
{%- set x=k8s_apiserver_settings.__setitem__('etcd-servers',cluster_hosts()) -%}
[Unit]
Description=Kubernetes API Server
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
[Service]
ExecStart={{k8s_bin_dir}}/kube-apiserver \
{%- for setting in k8s_apiserver_settings|sort %}
--{{setting}}={{k8s_apiserver_settings[setting]}} {% if not loop.last %}\{% endif %}
{%- endfor %}
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,15 @@
#jinja2: trim_blocks:False
[Unit]
Description=Kubernetes Controller Manager
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
[Service]
ExecStart={{k8s_bin_dir}}/kube-controller-manager \
{%- for setting in k8s_controller_manager_settings|sort %}
--{{setting}}={{k8s_controller_manager_settings[setting]}} {% if not loop.last %}\{% endif %}
{%- endfor %}
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,15 @@
#jinja2: trim_blocks:False
[Unit]
Description=Kubernetes Scheduler
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
[Service]
ExecStart={{k8s_bin_dir}}/kube-scheduler \
{%- for setting in k8s_scheduler_settings|sort %}
--{{setting}}={{k8s_scheduler_settings[setting]}} {% if not loop.last %}\{% endif %}
{%- endfor %}
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target