-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yaml
29 lines (24 loc) · 795 Bytes
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
- name: Create cluster
shell: kubeadm init --pod-network-cidr={{ pod_cidr }} --skip-phases=addon/kube-proxy --cri-socket=unix:///var/run/crio/crio.sock
register: kubeadm_output
- debug:
var: kubeadm_output.stdout_lines
- name: Get Kubernetes join information from kubeadm init output
shell: kubeadm token create --print-join-command
register: join_command
- name: Set fact with command output
set_fact:
cluster_join_command: "{{ join_command.stdout }}"
- name: Add KUBECONFIG to root user's environment
lineinfile:
dest: /root/.bashrc
line: 'export KUBECONFIG=/etc/kubernetes/admin.conf'
create: yes
state: present
- name: Add alias k for kubectl
lineinfile:
dest: /root/.bashrc
line: 'alias k="kubectl"'
create: yes
state: present