mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-17 07:03:31 +00:00
Add an alternative TokenSource to the GCE CloudProvider.
This commit is contained in:
@@ -300,6 +300,16 @@ grains:
|
||||
cbr-cidr: ${MASTER_IP_RANGE}
|
||||
cloud: gce
|
||||
EOF
|
||||
if ! [[ -z "${PROJECT_ID:-}" ]] && ! [[ -z "${TOKEN_URL:-}" ]]; then
|
||||
cat <<EOF >/etc/gce.conf
|
||||
[global]
|
||||
token-url = ${TOKEN_URL}
|
||||
project-id = ${PROJECT_ID}
|
||||
EOF
|
||||
cat <<EOF >>/etc/salt/minion.d/grains.conf
|
||||
cloud_config: /etc/gce.conf
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
function salt-node-role() {
|
||||
|
@@ -9,7 +9,12 @@
|
||||
{% if grains.cloud is defined -%}
|
||||
{% set cloud_provider = "--cloud_provider=" + grains.cloud -%}
|
||||
|
||||
{% if grains.cloud == 'aws' -%}
|
||||
{% if grains.cloud == 'gce' -%}
|
||||
{% if grains.cloud_config is defined -%}
|
||||
{% set cloud_config = "--cloud_config=" + grains.cloud_config -%}
|
||||
{% endif -%}
|
||||
|
||||
{% elif grains.cloud == 'aws' -%}
|
||||
{% set cloud_config = "--cloud_config=/etc/aws.conf" -%}
|
||||
{% endif -%}
|
||||
|
||||
@@ -26,7 +31,6 @@
|
||||
{% set publicAddressOverride = "--public_address_override=" + grains.publicAddressOverride -%}
|
||||
{% endif -%}
|
||||
|
||||
|
||||
{% if grains.etcd_servers is defined -%}
|
||||
{% set etcd_servers = "--etcd_servers=http://" + grains.etcd_servers + ":4001" -%}
|
||||
{% elif grains.cloud == 'gce' -%}
|
||||
|
@@ -19,7 +19,12 @@
|
||||
{% if grains.cloud is defined -%}
|
||||
{% set cloud_provider = "--cloud_provider=" + grains.cloud -%}
|
||||
|
||||
{% if grains.cloud == 'aws' -%}
|
||||
{% if grains.cloud == 'gce' -%}
|
||||
{% if grains.cloud_config is defined -%}
|
||||
{% set cloud_config = "--cloud_config=" + grains.cloud_config -%}
|
||||
{% endif -%}
|
||||
|
||||
{% elif grains.cloud == 'aws' -%}
|
||||
{% set cloud_config = "--cloud_config=/etc/aws.conf" -%}
|
||||
{% set machines = "--machines=" + ','.join(salt['mine.get']('roles:kubernetes-pool', 'network.ip_addrs', expr_form='grain').keys()) -%}
|
||||
|
||||
|
Reference in New Issue
Block a user