-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s.yaml
42 lines (38 loc) · 872 Bytes
/
k8s.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
30
31
32
33
34
35
36
37
38
39
40
41
42
---
- hosts: all
become: yes
tasks:
- name: Install necessary packages
apt:
name: "{{ packages }}"
state: present
vars:
packages:
- ca-certificates
- software-properties-common
- curl
- name: Add k8s apt key
apt_key:
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
state: present
- name: Add k8s APT repository
apt_repository:
repo: deb http://apt.kubernetes.io/ kubernetes-xenial main
state: present
filename: kubernetes
- name: Install k8s packages
apt:
name: "{{ packages }}"
state: present
vars:
packages:
- kubeadm
- kubelet
- hosts: masters
become: yes
tasks:
- name: Install kubectl
apt:
name: kubectl
state: present
force: yes