|
1 | 1 | # Getting Started with kOps on Hetzner Cloud |
2 | 2 |
|
3 | | -**WARNING**: Hetzner Cloud support on kOps is currently in **beta**, which means it is in good shape and could be used for production. |
4 | | -However, it is not as rigorously tested as the stable cloud providers and there are some features that might be missing. |
| 3 | +**WARNING**: Hetzner Cloud support on kOps is currently in **BETA**, which means it is in good shape and could be used for production. |
| 4 | +However, it is not as rigorously tested as the stable cloud providers, and there are some features that might be missing. |
5 | 5 |
|
6 | 6 | ## Requirements |
7 | 7 | * kOps version >= 1.24 |
8 | 8 | * kubectl version >= 1.23 |
9 | 9 | * Hetzner Cloud [account](https://accounts.hetzner.com/login) |
10 | | -* Hetzner Cloud [token](https://docs.hetzner.cloud/#authentication) |
| 10 | +* Hetzner Cloud [API token](https://docs.hetzner.cloud/reference/cloud#description/authentication) |
| 11 | +* Hetzner Cloud [S3 credentials](https://docs.hetzner.com/storage/object-storage/faq/s3-credentials/) |
11 | 12 | * SSH public and private keys |
12 | | -* S3 compatible object storage (like [MinIO](https://docs.min.io/minio/baremetal/security/minio-identity-management/user-management.html)) |
13 | 13 |
|
14 | 14 | ## Environment Variables |
15 | 15 |
|
16 | 16 | It is important to set the following environment variables: |
17 | 17 | ```bash |
18 | 18 | export HCLOUD_TOKEN=<token> |
19 | | -export S3_ENDPOINT=<endpoint> |
20 | 19 | export S3_ACCESS_KEY_ID=<acces-key> |
21 | 20 | export S3_SECRET_ACCESS_KEY=<secret-key> |
22 | | -export KOPS_STATE_STORE=s3://<bucket-name> |
| 21 | +export S3_ENDPOINT=https://fsn1.your-objectstorage.com |
| 22 | +export KOPS_STATE_STORE=hos://<bucket-name> |
23 | 23 | ``` |
24 | 24 |
|
25 | | -Some S3 compatible stores may also require to set the region: |
| 25 | +Some S3 compatible stores may also require setting the region: |
26 | 26 | ```bash |
27 | 27 | export S3_REGION=<region> |
28 | 28 | ``` |
29 | 29 |
|
30 | 30 | ## Creating a Single Master Cluster |
31 | 31 |
|
32 | | -In the following examples, `example.k8s.local` is a [gossip-based DNS ](../gossip.md) cluster name. |
33 | | - |
34 | 32 | ```bash |
35 | | -# create a ubuntu 20.04 + calico cluster in fsn1 |
36 | | -kops create cluster --name=my-cluster.example.k8s.local \ |
37 | | - --ssh-public-key=~/.ssh/id_rsa.pub --cloud=hetzner --zones=fsn1 \ |
38 | | - --image=ubuntu-20.04 --networking=calico --network-cidr=10.10.0.0/16 |
39 | | -kops update cluster my-cluster.example.k8s.local --yes |
40 | | - |
41 | | -# create a ubuntu 20.04 + calico cluster in fsn1 with CPU optimized servers |
42 | | -kops create cluster --name=my-cluster.example.k8s.local \ |
43 | | - --ssh-public-key=~/.ssh/id_rsa.pub --cloud=hetzner --zones=fsn1 \ |
44 | | - --image=ubuntu-20.04 --networking=calico --network-cidr=10.10.0.0/16 \ |
45 | | - --node-size cpx31 |
46 | | -kops update cluster --name=my-cluster.example.k8s.local --yes |
| 33 | +# create a ubuntu 24.04 + Cilium cluster in fsn1 |
| 34 | +kops create cluster --name=my.k8s \ |
| 35 | + --ssh-public-key=~/.ssh/id_ed25519.pub --cloud=hetzner --zones=fsn1 \ |
| 36 | + --image=ubuntu-24.04 --networking=calico --network-cidr=10.10.0.0/16 \ |
| 37 | + --control-plane-size cx23 --node-size cx23 |
| 38 | +kops update cluster my.k8s --yes |
47 | 39 |
|
48 | 40 | # update a cluster |
49 | | -kops update cluster --name=my-cluster.example.k8s.local |
50 | | -kops update cluster --name=my-cluster.example.k8s.local --yes |
51 | | -kops rolling-update cluster --name=my-cluster.example.k8s.local |
52 | | -kops rolling-update cluster --name=my-cluster.example.k8s.local --yes |
| 41 | +kops update cluster --name=my.k8s |
| 42 | +kops update cluster --name=my.k8s --yes |
| 43 | +kops rolling-update cluster --name=my.k8s |
| 44 | +kops rolling-update cluster --name=my.k8s --yes |
53 | 45 |
|
54 | 46 | # validate a cluster |
55 | | -kops validate cluster --name=my-cluster.example.k8s.local |
| 47 | +kops validate cluster --name=my.k8s |
56 | 48 |
|
57 | 49 | # delete a cluster |
58 | | -kops delete cluster --name=my-cluster.example.k8s.local |
59 | | -kops delete cluster --name=my-cluster.example.k8s.local --yes |
| 50 | +kops delete cluster --name=my.k8s |
| 51 | +kops delete cluster --name=my.k8s --yes |
60 | 52 |
|
61 | 53 | # export kubecfg |
62 | 54 | # See https://kops.sigs.k8s.io/cli/kops_export_kubeconfig/#examples. |
|
0 commit comments