-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloud_init_k0s.yaml
66 lines (62 loc) · 3.84 KB
/
cloud_init_k0s.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#cloud-config
package_update: true
package_upgrade: true
packages:
- curl
- sudo
- openssh-client
write_files:
# This key is well known and only for educational purposes
- path: /opt/id_lerncloud
permissions: '0600'
encoding: b64
content: |
LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb3dJQkFBS0NBUUVBMUI2SmRaZ2J6K1RjSHR3YzI2YXVCckIwMHNQZXFZVnkyZHUyajRrWGE4NFowTm96Ckx1SkVvTC9jUmJKNldZQWJFR3ZPQklYU1VER2MvQkRucm9iMkxpYlpvUUZjd0x6WTQwV3BQbTZjU3ozVnBhTWQKYVN5VTdvWENLbjAwMG53V0NXQWV2RlVRRnlkdmFIRUFlNnArMmc0K2dyc043UFNNbDZHaW9jbStKK3lQTWlONgo5Rk45RFFIREk4cjFkeTJEbDhmeVVHMS9qNDFiQ1RNNmRqWmF3dTdKOC9JSEVpc1ZMUy8zaGRJUGxwd3UrWXJvClFXeW16VDYrMEQveUxSMmdJZlU3K1d0NXNnU3pXVU9la29KMGdvSmt0QkZGWGpEYkR2RjJtaXE5aDlzZWVmZGkKQ0tNKzJFY2krTUpUcG85K1cwS0hNSFdvWFRnaFNPNTAvWDYrbndJREFRQUJBb0lCQUZXa0xxT0gwbExSZC80TgpxS2tXVnRUa2tZWTNCc015MmZnVHVWV2lhQTVpbkJHeXgwOTZrM0xEZzgrd0M2M3ZCdjVPU0ZPVEpDSzBwVWt3CkdocGc2eXdmQzJieUFkemZZa0lBY2lCKzBDT2d4NDJrbWM5STdLaVE0Si8vQlVDbVVNOWdPNGlXWDNTNXUwVlQKdW5vemtCdk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dDMDNsUnUybDdYTFpsNmJ6Z0lESXJYVTVFUWV0SnBEWFBBQjYxL3hIUk93cQoxNzR4UW5OMmdzQUFnNUlnZk14dWlxRFpoR3ZCOFhYZmJMdEVWQ2QyMHorMW1BbFlzcFhtZkNETC9yZHpxQlJHCklBenBBb0dCQUpQRThTQWFacG13ZGo4RWZONUo5L3BPN3dRUUJxVWVnVktZRGxrMG1xRlh0US9VZzJmYlg1VmcKWVN2dHpKTUN6ZDFOcWt3eTVSSTZQaS9JVFNwQ3BWSUpGWWxLamtwdm9LQzZObXlURW45bjU4Wkw5VjhNbk1jOAo3OEdYcEZNOGtrVVp4RGQwRHkxREt2bW5DSEJDR2EvVGdUK1pUNUtvL2xBUlBNenBqVWVmCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
- path: /opt/k0s.yaml
permissions: '0644'
content: |
---
apiVersion: k0sctl.k0sproject.io/v1beta1
kind: Cluster
metadata:
name: cloud-hf-06
spec:
hosts:
- ssh:
address: cloud-hf-06-c1
user: ubuntu
port: 22
keyPath: /opt/id_lerncloud
role: controller
- ssh:
address: cloud-hf-06-c2
user: ubuntu
port: 22
keyPath: /opt/id_lerncloud
role: controller
- ssh:
address: cloud-hf-06-w1
user: ubuntu
port: 22
keyPath: /opt/id_lerncloud
role: worker
- ssh:
address: cloud-hf-06-w2
user: ubuntu
port: 22
keyPath: /opt/id_lerncloud
role: worker
- ssh:
address: cloud-hf-06-w3
user: ubuntu
port: 22
keyPath: /opt/id_lerncloud
role: worker
...
runcmd:
- echo "Starting Cloud-init script" >> /var/log/cloud-init-debug.log
- while ! ping -c 1 -W 1 8.8.8.8; do sleep 1; done
- echo "Network is up" >> /var/log/cloud-init-debug.log
- curl -sSLf https://github.com/k0sproject/k0sctl/releases/latest/download/k0sctl-linux-amd64 -o /usr/local/bin/k0sctl
- sudo chmod +x /usr/local/bin/k0sctl
- sudo k0sctl apply --config /opt/k0s.yaml