You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/install/linode-kubernetes-engine.md
+63-27Lines changed: 63 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,38 +5,53 @@ date: 2024-07-23
5
5
tags: [Installation]
6
6
---
7
7
8
-
This guide walks through the process of installing and configuring SpinKube on Linode Kubernetes Engine (LKE).
8
+
This guide walks through the process of installing and configuring SpinKube on Linode Kubernetes
9
+
Engine (LKE).
9
10
10
11
## Prerequisites
11
12
12
-
This guide assumes that you have an Akamai Linode account that is configured and has sufficient permissions for creating a new LKE cluster.
13
+
This guide assumes that you have an Akamai Linode account that is configured and has sufficient
14
+
permissions for creating a new LKE cluster.
13
15
14
16
You will also need recent versions of `kubectl` and `helm` installed on your system.
15
17
16
18
## Creating an LKE Cluster
17
19
18
-
LKE has a managed control plane, so you only need to create the pool of worker nodes. In this tutorial, we will create a 2-node LKE cluster using the smallest available worker nodes. This should be fine for installing SpinKube and running up to around 100 Spin apps.
20
+
LKE has a managed control plane, so you only need to create the pool of worker nodes. In this
21
+
tutorial, we will create a 2-node LKE cluster using the smallest available worker nodes. This should
22
+
be fine for installing SpinKube and running up to around 100 Spin apps.
19
23
20
-
You may prefer to run a larger cluster if you plan on mixing containers and Spin apps, because containers consume substantially more resources than Spin apps do.
24
+
You may prefer to run a larger cluster if you plan on mixing containers and Spin apps, because
25
+
containers consume substantially more resources than Spin apps do.
21
26
22
-
In the Linode web console, click on `Kubernetes` in the right-hand navigation, and then click `Create Cluster`.
27
+
In the Linode web console, click on `Kubernetes` in the right-hand navigation, and then click
28
+
`Create Cluster`.
23
29
24
30

25
31
26
32
You will only need to make a few choices on this screen. Here's what we have done:
27
-
* We named the cluster `spinkube-lke-1`. You should name it according to whatever convention you prefer
33
+
* We named the cluster `spinkube-lke-1`. You should name it according to whatever convention you
34
+
prefer
28
35
* We chose the `Chicago, IL (us-ord)` region, but you can choose any region you prefer
29
36
* The latest supported Kubernetes version is `1.30`, so we chose that
30
-
* For this testing cluster, we chose `No` on `HA Control Plane` because we do not need high availability
31
-
* In `Add Node Pools`, we added two `Dedicated 4 GB` simply to show a cluster running more than one node. Two nodes is sufficient for Spin apps, though you may prefer the more traditional 3 node cluster. Click `Add` to add these, and ignore the warning about minimum sizes.
37
+
* For this testing cluster, we chose `No` on `HA Control Plane` because we do not need high
38
+
availability
39
+
* In `Add Node Pools`, we added two `Dedicated 4 GB` simply to show a cluster running more than one
40
+
node. Two nodes is sufficient for Spin apps, though you may prefer the more traditional 3 node
41
+
cluster. Click `Add` to add these, and ignore the warning about minimum sizes.
32
42
33
43
Once you have set things to your liking, press `Create Cluster`.
34
44
35
-
This will take you to a screen that shows the status of the cluster. Initially, you will want to wait for all of your `Node Pool` to start up. Once all of the nodes are online, download the `kubeconfig` file, which will be named something like `spinkube-lke-1-kubeconfig.yaml`.
45
+
This will take you to a screen that shows the status of the cluster. Initially, you will want to
46
+
wait for all of your `Node Pool` to start up. Once all of the nodes are online, download the
47
+
`kubeconfig` file, which will be named something like `spinkube-lke-1-kubeconfig.yaml`.
36
48
37
-
> The `kubeconfig` file will have the credentials for connecting to your new LKE cluster. Do not share that file or put it in a public place.
49
+
> The `kubeconfig` file will have the credentials for connecting to your new LKE cluster. Do not
50
+
> share that file or put it in a public place.
38
51
39
-
For all of the subsequent operations, you will want to use the `spinkube-lke-1-kubeconfig.yaml` as your main Kubernetes configuration file. The best way to do that is to set the environment variable `KUBECONFIG` to point to that file:
52
+
For all of the subsequent operations, you will want to use the `spinkube-lke-1-kubeconfig.yaml` as
53
+
your main Kubernetes configuration file. The best way to do that is to set the environment variable
This shows us our cluster config. You should be able to cross-reference the `lkeNNNNNN` version with what you see on your Akamai Linode dashboard.
85
+
This shows us our cluster config. You should be able to cross-reference the `lkeNNNNNN` version with
86
+
what you see on your Akamai Linode dashboard.
71
87
72
88
## Install SpinKube Using Helm
73
89
74
-
At this point, [install SpinKube with Helm](installing-with-helm). As long as your `KUBECONFIG` environment variable is pointed at the correct cluster, the installation method documented there will work.
90
+
At this point, [install SpinKube with Helm](installing-with-helm). As long as your `KUBECONFIG`
91
+
environment variable is pointed at the correct cluster, the installation method documented there
92
+
will work.
75
93
76
94
Once you are done following the installation steps, return here to install a first app.
77
95
78
96
## Creating a First App
79
97
80
-
We will use the `spin kube` plugin to scaffold out a new app. If you run the following command and the `kube` plugin is not installed, you will first be prompted to install the plugin. Choose `yes` to install.
98
+
We will use the `spin kube` plugin to scaffold out a new app. If you run the following command and
99
+
the `kube` plugin is not installed, you will first be prompted to install the plugin. Choose `yes`
100
+
to install.
81
101
82
-
We'll point to an existing Spin app, a [Hello World program written in Rust](https://github.com/fermyon/spin/tree/main/examples/http-rust), compiled to Wasm, and stored in GitHub Container Registry (GHCR):
102
+
We'll point to an existing Spin app, a [Hello World program written in
103
+
Rust](https://github.com/fermyon/spin/tree/main/examples/http-rust), compiled to Wasm, and stored in
> Note that Spin apps, which are WebAssembly, can be [stored in most container registries](https://developer.fermyon.com/spin/v2/registry-tutorial) even though they are not Docker containers.
110
+
> Note that Spin apps, which are WebAssembly, can be [stored in most container
111
+
> registries](https://developer.fermyon.com/spin/v2/registry-tutorial) even though they are not
112
+
> Docker containers.
89
113
90
114
This will write the following to `hello-world.yaml`:
spinapp.core.spinoperator.dev/spin-rust-hello created
108
132
```
109
133
110
-
With SpinKube, SpinApps will be deployed as `Pod` resources, so we can see the app using `kubectl get pods`:
134
+
With SpinKube, SpinApps will be deployed as `Pod` resources, so we can see the app using `kubectl
135
+
get pods`:
111
136
112
137
```console
113
-
$ kubectl get pods
138
+
$ kubectl get pods
114
139
NAME READY STATUS RESTARTS AGE
115
140
spin-rust-hello-f6d8fc894-7pq7k 1/1 Running 0 54s
116
141
spin-rust-hello-f6d8fc894-vmsgh 1/1 Running 0 54s
@@ -120,7 +145,9 @@ Status is listed as `Running`, which means our app is ready.
120
145
121
146
## Making An App Public with a NodeBalancer
122
147
123
-
By default, Spin apps will be deployed with an internal service. But with Linode, you can provision a [NodeBalancer](https://www.linode.com/docs/products/networking/nodebalancers/) using a `Service` object. Here is a `hello-world-service.yaml` that provisions a `nodebalancer` for us:
148
+
By default, Spin apps will be deployed with an internal service. But with Linode, you can provision
149
+
a [NodeBalancer](https://www.linode.com/docs/products/networking/nodebalancers/) using a `Service`
150
+
object. Here is a `hello-world-service.yaml` that provisions a `nodebalancer` for us:
124
151
125
152
```yaml
126
153
apiVersion: v1
@@ -143,9 +170,11 @@ spec:
143
170
sessionAffinity: None
144
171
```
145
172
146
-
When LKE receives a `Service` whose `type` is `LoadBalancer`, it will provision a NodeBalancer for you.
173
+
When LKE receives a `Service` whose `type` is `LoadBalancer`, it will provision a NodeBalancer for
174
+
you.
147
175
148
-
> You can customize this for your app simply by replacing all instances of `spin-rust-hello` with the name of your app.
176
+
> You can customize this for your app simply by replacing all instances of `spin-rust-hello` with
177
+
> the name of your app.
149
178
150
179
We can create the NodeBalancer by running `kubectl apply` on the above file:
The `EXTERNAL-IP` field tells us what the NodeBalancer is using as a public IP. We can now test this out over the Internet using `curl` or by entering the URL `http://172.234.210.123/hello` into your browser.
195
+
The `EXTERNAL-IP` field tells us what the NodeBalancer is using as a public IP. We can now test this
196
+
out over the Internet using `curl` or by entering the URL `http://172.234.210.123/hello` into your
197
+
browser.
166
198
167
199
```console
168
-
$ curl 172.234.210.123/hello
200
+
$ curl 172.234.210.123/hello
169
201
Hello world from Spin!
170
202
```
171
203
@@ -176,10 +208,14 @@ To delete this sample app, we will first delete the NodeBalancer, and then delet
176
208
```console
177
209
$ kubectl delete service spin-rust-hello-nodebalancer
> If you delete the NodeBalancer out of the Linode console, it will not automatically delete the `Service` record in Kubernetes, which will cause inconsistencies. So it is best to use `kubectl delete service` to delete your NodeBalancer.
215
+
> If you delete the NodeBalancer out of the Linode console, it will not automatically delete the
216
+
> `Service` record in Kubernetes, which will cause inconsistencies. So it is best to use `kubectl
217
+
> delete service` to delete your NodeBalancer.
184
218
185
-
If you are also done with your LKE cluster, the easiest way to delete it is to log into the Akamai Linode dashboard, navigate to `Kubernetes`, and press the `Delete` button. This will destroy all of your worker nodes and deprovision the control plane.
219
+
If you are also done with your LKE cluster, the easiest way to delete it is to log into the Akamai
220
+
Linode dashboard, navigate to `Kubernetes`, and press the `Delete` button. This will destroy all of
221
+
your worker nodes and deprovision the control plane.
0 commit comments