@@ -5,25 +5,32 @@ aliases:
5
5
- ../../../cloud-platforms/digitalocean
6
6
---
7
7
8
- ## Creating a Cluster via the CLI
8
+ ## Creating a Talos Linux Cluster on Digital Ocean via the CLI
9
9
10
- In this guide we will create an HA Kubernetes cluster with 1 worker node.
10
+ In this guide we will create an HA Kubernetes cluster with 1 worker node, in the NYC region .
11
11
We assume an existing [ Space] ( https://www.digitalocean.com/docs/spaces/ ) , and some familiarity with DigitalOcean.
12
12
If you need more information on DigitalOcean specifics, please see the [ official DigitalOcean documentation] ( https://www.digitalocean.com/docs/ ) .
13
13
14
14
### Create the Image
15
15
16
- First, download the DigitalOcean image from a Talos release.
17
- Extract the archive to get the ` disk.raw ` file, compress it using ` gzip ` to ` disk.raw.gz ` .
16
+ Download the DigitalOcean image ` digital-ocean-amd64.raw.gz ` from the [ latest Talos release] ( https://github.com/siderolabs/talos/releases/latest/ ) .
17
+
18
+ > Note: the minimum version of Talos required to support Digital Ocean is v1.3.3.
18
19
19
20
Using an upload method of your choice (` doctl ` does not have Spaces support), upload the image to a space.
21
+ (It's easy to drag the image file to the space using DigitalOcean's web console.)
22
+
23
+ * Note:* Make sure you upload the file as ` public ` .
24
+
20
25
Now, create an image using the URL of the uploaded image:
21
26
22
27
``` bash
28
+ export REGION=nyc3
29
+
23
30
doctl compute image create \
24
31
--region $REGION \
25
32
--image-description talos-digital-ocean-tutorial \
26
- --image-url https://talos-tutorial .$REGION .digitaloceanspaces.com/disk .raw.gz \
33
+ --image-url https://$SPACENAME .$REGION .digitaloceanspaces.com/digital-ocean-amd64 .raw.gz \
27
34
Talos
28
35
```
29
36
@@ -41,45 +48,46 @@ doctl compute load-balancer create \
41
48
--forwarding-rules entry_protocol:tcp,entry_port:443,target_protocol:tcp,target_port:6443
42
49
```
43
50
51
+ Note the returned ID of the load balancer.
52
+
44
53
We will need the IP of the load balancer.
45
54
Using the ID of the load balancer, run:
46
55
47
56
``` bash
48
57
doctl compute load-balancer get --format IP < load balancer ID>
49
58
```
50
59
51
- Save it, as we will need it in the next step .
60
+ Note that it may take a few minutes before the load balancer is provisioned, so repeat this command until it returns with the IP address .
52
61
53
62
### Create the Machine Configuration Files
54
63
55
- #### Generating Base Configurations
56
-
57
- Using the DNS name of the loadbalancer created earlier, generate the base configuration files for the Talos machines:
64
+ Using the IP address (or DNS name, if you have created one) of the loadbalancer, generate the base configuration files for the Talos machines.
65
+ Also note that the load balancer forwards port 443 to port 6443 on the associated nodes, so we should use 443 as the port in the config definition:
58
66
59
67
``` bash
60
- $ talosctl gen config talos-k8s-digital-ocean-tutorial https://< load balancer IP or DNS> :< port >
68
+ $ talosctl gen config talos-k8s-digital-ocean-tutorial https://< load balancer IP or DNS> :443
61
69
created controlplane.yaml
62
70
created worker.yaml
63
71
created talosconfig
64
72
```
65
73
66
- At this point, you can modify the generated configs to your liking.
67
- Optionally, you can specify ` --config-patch ` with RFC6902 jsonpatch which will be applied during the config generation.
74
+ ### Create the Droplets
75
+
76
+ #### Create a dummy SSH key
68
77
69
- #### Validate the Configuration Files
78
+ > Although SSH is not used by Talos, DigitalOcean requires that an SSH key be associated with a droplet during creation.
79
+ > We will create a dummy key that can be used to satisfy this requirement.
70
80
71
81
``` bash
72
- $ talosctl validate --config controlplane.yaml --mode cloud
73
- controlplane.yaml is valid for cloud mode
74
- $ talosctl validate --config worker.yaml --mode cloud
75
- worker.yaml is valid for cloud mode
82
+ doctl compute ssh-key create --public-key " ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDbl0I1s/yOETIKjFr7mDLp8LmJn6OIZ68ILjVCkoN6lzKmvZEqEm1YYeWoI0xgb80hQ1fKkl0usW6MkSqwrijoUENhGFd6L16WFL53va4aeJjj2pxrjOr3uBFm/4ATvIfFTNVs+VUzFZ0eGzTgu1yXydX8lZMWnT4JpsMraHD3/qPP+pgyNuI51LjOCG0gVCzjl8NoGaQuKnl8KqbSCARIpETg1mMw+tuYgaKcbqYCMbxggaEKA0ixJ2MpFC/kwm3PcksTGqVBzp3+iE5AlRe1tnbr6GhgT839KLhOB03j7lFl1K9j1bMTOEj5Io8z7xo/XeF2ZQKHFWygAJiAhmKJ dummy@dummy.local" dummy
83
+
76
84
```
77
85
78
- ### Create the Droplets
86
+ Note the ssh key ID that is returned - we will use it in creating the droplets.
79
87
80
88
#### Create the Control Plane Nodes
81
89
82
- Run the following commands, to give ourselves three total control plane nodes:
90
+ Run the following commands to create three control plane nodes:
83
91
84
92
``` bash
85
93
doctl compute droplet create \
@@ -89,7 +97,7 @@ doctl compute droplet create \
89
97
--enable-private-networking \
90
98
--tag-names talos-digital-ocean-tutorial-control-plane \
91
99
--user-data-file controlplane.yaml \
92
- --ssh-keys < ssh key fingerprint > \
100
+ --ssh-keys < ssh key ID > \
93
101
talos-control-plane-1
94
102
doctl compute droplet create \
95
103
--region $REGION \
@@ -98,7 +106,7 @@ doctl compute droplet create \
98
106
--enable-private-networking \
99
107
--tag-names talos-digital-ocean-tutorial-control-plane \
100
108
--user-data-file controlplane.yaml \
101
- --ssh-keys < ssh key fingerprint > \
109
+ --ssh-keys < ssh key ID > \
102
110
talos-control-plane-2
103
111
doctl compute droplet create \
104
112
--region $REGION \
@@ -107,12 +115,11 @@ doctl compute droplet create \
107
115
--enable-private-networking \
108
116
--tag-names talos-digital-ocean-tutorial-control-plane \
109
117
--user-data-file controlplane.yaml \
110
- --ssh-keys < ssh key fingerprint > \
118
+ --ssh-keys < ssh key ID > \
111
119
talos-control-plane-3
112
120
```
113
121
114
- > Note: Although SSH is not used by Talos, DigitalOcean still requires that an SSH key be associated with the droplet.
115
- > Create a dummy key that can be used to satisfy this requirement.
122
+ Note the droplet ID returned for the first control plane node.
116
123
117
124
#### Create the Worker Nodes
118
125
@@ -125,7 +132,7 @@ doctl compute droplet create \
125
132
--size s-2vcpu-4gb \
126
133
--enable-private-networking \
127
134
--user-data-file worker.yaml \
128
- --ssh-keys < ssh key fingerprint > \
135
+ --ssh-keys < ssh key ID > \
129
136
talos-worker-1
130
137
```
131
138
@@ -157,3 +164,9 @@ At this point we can retrieve the admin `kubeconfig` by running:
157
164
``` bash
158
165
talosctl --talosconfig talosconfig kubeconfig .
159
166
```
167
+
168
+ We can also watch the cluster bootstrap via:
169
+
170
+ ``` bash
171
+ talosctl --talosconfig talosconfig health
172
+ ```
0 commit comments