38 lines
1.5 KiB
Plaintext
38 lines
1.5 KiB
Plaintext
{% set daemon_args = "$DAEMON_ARGS" -%}
|
|
{% if grains['os_family'] == 'RedHat' -%}
|
|
{% set daemon_args = "" -%}
|
|
{% endif -%}
|
|
{# TODO(azure-maintainer): add support for distributing kubeconfig with token to kube-proxy #}
|
|
{# so it can use https #}
|
|
{% if grains['cloud'] is defined and grains['cloud'] == 'azure' -%}
|
|
{% set api_servers = "--master=http://" + ips[0][0] -%}
|
|
{% set api_servers_with_port = api_servers + ":7080" -%}
|
|
{% set kubeconfig = "" -%}
|
|
{% else -%}
|
|
{% set kubeconfig = "--kubeconfig=/var/lib/kube-proxy/kubeconfig" -%}
|
|
{% if grains.api_servers is defined -%}
|
|
{% set api_servers = "--master=https://" + grains.api_servers -%}
|
|
{% else -%}
|
|
{% set ips = salt['mine.get']('roles:kubernetes-master', 'network.ip_addrs', 'grain').values() -%}
|
|
{% set api_servers = "--master=https://" + ips[0][0] -%}
|
|
{% endif -%}
|
|
|
|
# TODO: remove nginx for other cloud providers.
|
|
{% if grains['cloud'] is defined and grains.cloud in [ 'aws', 'gce', 'vagrant' ] %}
|
|
{% set api_servers_with_port = api_servers -%}
|
|
{% else -%}
|
|
{% set api_servers_with_port = api_servers + ":6443" -%}
|
|
{% endif -%}
|
|
|
|
{% endif -%}
|
|
|
|
{% set test_args = "" -%}
|
|
{% if pillar['kubeproxy_test_args'] is defined -%}
|
|
{% set test_args=pillar['kubeproxy_test_args'] %}
|
|
{% endif -%}
|
|
|
|
DAEMON_ARGS="{{daemon_args}} {{api_servers_with_port}} {{kubeconfig}} {{pillar['log_level']}}"
|
|
|
|
# test_args has to be kept at the end, so they'll overwrite any prior configuration
|
|
DAEMON_ARGS="$DAEMON_ARGS + {{test_args}}"
|