Set initial kubeadm token if specified in kubeadm init (#5057)

Change-Id: I7fd94ec6d195af60d237b3cfe91668ca1f707d26
This commit is contained in:
Matthew Mosesohn 2019-08-15 12:26:33 +03:00 committed by Kubernetes Prow Robot
parent fc456ff0cd
commit 771ce96e6d
2 changed files with 12 additions and 0 deletions

View file

@ -1,5 +1,11 @@
apiVersion: kubeadm.k8s.io/v1beta1 apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration kind: InitConfiguration
{% if kubeadm_token is defined %}
bootstrapTokens:
- token: "{{ kubeadm_token }}"
description: "kubespray kubeadm bootstrap token"
ttl: "24h"
{% endif %}
localAPIEndpoint: localAPIEndpoint:
advertiseAddress: {{ ip | default(fallback_ips[inventory_hostname]) }} advertiseAddress: {{ ip | default(fallback_ips[inventory_hostname]) }}
bindPort: {{ kube_apiserver_port }} bindPort: {{ kube_apiserver_port }}

View file

@ -1,5 +1,11 @@
apiVersion: kubeadm.k8s.io/v1beta2 apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration kind: InitConfiguration
{% if kubeadm_token is defined %}
bootstrapTokens:
- token: "{{ kubeadm_token }}"
description: "kubespray kubeadm bootstrap token"
ttl: "24h"
{% endif %}
localAPIEndpoint: localAPIEndpoint:
advertiseAddress: {{ ip | default(fallback_ips[inventory_hostname]) }} advertiseAddress: {{ ip | default(fallback_ips[inventory_hostname]) }}
bindPort: {{ kube_apiserver_port }} bindPort: {{ kube_apiserver_port }}