Merge "kubeadm: fix issue about obtaining k8s config"

This commit is contained in:
Zuul 2018-03-09 06:44:05 +00:00 committed by Gerrit Code Review
commit 77a5711155
2 changed files with 3 additions and 3 deletions

View File

@ -27,11 +27,9 @@
join_str: "{{ kubeadm_init.stdout | regex_search('kubeadm join(.*)$') }}"
- name: Prepare kube config
shell: mkdir -p {{ item }}/.kube && cp -a /etc/kubernetes/admin.conf {{ item }}/.kube/config && chmod 755 {{ item }}/.kube/config
shell: mkdir -p {{ item }}/.kube && cp -a /etc/kubernetes/admin.conf {{ item }}/.kube/config && chmod 644 {{ item }}/.kube/config
with_items:
- "{{ ansible_env.HOME }}"
- /home/ubuntu
- /opt/stack/new
- name: Allow pod on master
shell: kubectl taint nodes --all node-role.kubernetes.io/master-

View File

@ -28,6 +28,8 @@ sudo apt-add-repository --yes ppa:ansible/ansible && sudo apt-get update -y -qq
ansible-playbook ${WORK_DIR}/tools/gate/kubeadm/playbook/deploy_k8s.yaml
# waits until kubectl can access the api server
mkdir -p ${HOME}/.kube
sudo cp /etc/kubernetes/admin.conf ${HOME}/.kube/config
sudo chown $(id -u):$(id -g) ${HOME}/.kube/config
end=$(($(date +%s) + 600))
READY="False"