@@ -21,7 +21,7 @@ defaults for running production workload.
21
21
- configure Openstack Swift or S3-like backend for automated etcd snapshots
22
22
- smooth updates & agent nodes autoremoval with pod draining
23
23
- bundled with Openstack Cloud Controller and Cinder CSI
24
- - Cilium networking (network policy support and no Kube -proxy)
24
+ - Cilium networking (network policy support and no kube -proxy)
25
25
- highly-available through load balancers
26
26
- out of the box support for volume snapshot and Velero
27
27
@@ -38,89 +38,44 @@ defaults for running production workload.
38
38
## Getting started
39
39
40
40
``` bash
41
- cat << EOF > cluster.tf
42
- provider "openstack" {
43
- tenant_name = "PCP-XXXXXXX"
44
- user_name = "PCU-XXXXXXX"
45
- password = "XXXXXXXXXXX"
46
- auth_url = "https://api.pub1.infomaniak.cloud/identity"
47
- region = "dc3-a"
48
- }
49
-
50
- module "rke2" {
51
- source = "zifeo/rke2/openstack"
52
-
53
- name = "k8s"
54
-
55
- floating_pool = "ext-floating1"
56
- rules_ssh_cidr = "0.0.0.0/0"
57
- rules_k8s_cidr = "0.0.0.0/0"
58
-
59
- bootstrap = true
60
- servers = [
61
- {
62
- name = "server-a"
63
-
64
- flavor_name = "a2-ram4-disk0"
65
- image_name = "Ubuntu 20.04 LTS Focal Fossa"
66
- system_user = "ubuntu"
67
- boot_volume_size = 8
68
-
69
- rke2_version = "v1.25.3+rke2r1"
70
- rke2_volume_size = 16
71
- }
72
- ]
73
-
74
- agents = [
75
- {
76
- name = "pool-a"
77
- nodes_count = 1
78
-
79
- flavor_name = "a2-ram4-disk0"
80
- image_name = "Ubuntu 20.04 LTS Focal Fossa"
81
- system_user = "ubuntu"
82
- boot_volume_size = 8
83
-
84
- rke2_version = "v1.25.3+rke2r1"
85
- rke2_volume_size = 16
86
- }
87
- ]
88
- }
89
-
90
- terraform {
91
- required_providers {
92
- openstack = {
93
- source = "terraform-provider-openstack/openstack"
94
- }
95
- }
96
- }
41
+ git clone
[email protected] :zifeo/terraform-openstack-rke2.git
&& cd terraform-openstack-rke2/examples/single-server
42
+ cat << EOF > terraform.tfvars
43
+ project=PCP-XXXXXXXX
44
+ username=PCU-XXXXXXXX
45
+ password=XXXXXXXX
97
46
EOF
98
47
99
48
terraform init
100
- terraform apply
101
- # or, on upgrade, to process node by node
49
+ terraform apply # approx 2-3 mins
50
+ kubectl --kubeconfig single-server.rke2.yaml get nodes
51
+ # NAME STATUS ROLES AGE VERSION
52
+ # k8s-pool-a-1 Ready <none> 119s v1.21.5+rke2r2
53
+ # k8s-server-1 Ready control-plane,etcd,master 2m22s v1.21.5+rke2r2
54
+
55
+ # on upgrade, process node pool by node pool
102
56
terraform apply -target=' module.rke2.module.servers["server-a"]'
103
57
# for servers, apply on the majority of nodes, then for the remaining ones
104
58
# this ensures the load balancer routes are updated as well
105
59
terraform apply -target=' module.rke2.openstack_lb_members_v2.k8s'
106
60
```
107
61
108
- See [ examples] ( ./examples ) for more options.
62
+ See [ examples] ( ./examples ) for more options or this
63
+ [ article] ( https://zifeo.com/articles/230617-low-cost-k8s ) for a step-by-step
64
+ tutorial.
109
65
110
66
Note: it requires [ rsync] ( https://rsync.samba.org ) and
111
- [ yq] ( https://github.com/mikefarah/yq ) to generate remote kube config file. You
112
- can disable this behaviour by setting ` ff_write_kubeconfig=false ` and fetch
67
+ [ yq] ( https://github.com/mikefarah/yq ) to generate remote kubeconfig file. You
68
+ can disable this behavior by setting ` ff_write_kubeconfig=false ` and fetch
113
69
yourself ` /etc/rancher/rke2/rke2.yaml ` on server nodes.
114
70
115
71
## Infomaniak OpenStack
116
72
117
- A stable, performent and fully-equiped Kubernetes cluster in Switzerland for as
73
+ A stable, performant and fully equipped Kubernetes cluster in Switzerland for as
118
74
little as CHF 26.90/month (at the time of writing):
119
75
120
- - nginx-ingress with floating ip (perfect under Cloudflare proxy)
121
- - persistence through cinder-csi storage classes (retain, delete)
122
- - 1 server 1cpu/2go (= master)
123
- - 1 agent 1cpu/2go (= worker)
76
+ - load-balancer with floating IP (perfect under Cloudflare proxy)
77
+ - 1 server 2cpu/4Go (= master)
78
+ - 1 agent 2cpu/4Go (= worker)
124
79
125
80
| Flavour | CHF/month |
126
81
| ---------------------------------------------------------------------------------- | --------- |
@@ -129,34 +84,12 @@ little as CHF 26.90/month (at the time of writing):
129
84
| 3x2cpu/4go HA servers with 1x4cpu/16Go worker | ~ 50.— |
130
85
| 3x2cpu/4go HA servers with 3x4cpu/16Go workers | ~ 85.— |
131
86
132
- ``` bash
133
- git clone
[email protected] :zifeo/terraform-openstack-rke2.git
&& cd terraform-openstack-rke2/examples/single-server
134
- cat << EOF > terraform.tfvars
135
- tenant_name = "PCP-XXXXXXX"
136
- user_name = "PCU-XXXXXXX"
137
- password = "XXXXXXXXXXX"
138
- EOF
139
- terraform init
140
- terraform apply # approx 2-3mins
141
- kubectl --kubeconfig rke2.yaml get nodes
142
- # NAME STATUS ROLES AGE VERSION
143
- # k8s-pool-a-1 Ready <none> 119s v1.21.5+rke2r2
144
- # k8s-server-1 Ready control-plane,etcd,master 2m22s v1.21.5+rke2r2
145
- helm install wordpress --values wordpress.yaml --namespace default bitnami/wordpress
146
- kubectl --kubeconfig rke2.yaml get pods -n default
147
- # NAME READY STATUS RESTARTS AGE
148
- # wordpress-7474ddb77f-w6c86 1/1 Running 0 102s
149
- # wordpress-mariadb-0 1/1 Running 0 102s
150
- curl -s $( terraform output -raw floating_ip) -H ' host: wordpress.local' | grep Welcome
151
- # <p>Welcome to WordPress. This is your first post. Edit or delete it, then start writing!</p>
152
- ```
153
-
154
87
See their technical [ documentation] ( https://docs.infomaniak.cloud ) and
155
88
[ pricing] ( https://www.infomaniak.com/fr/hebergement/public-cloud/tarifs ) .
156
89
157
90
## More on RKE2 & OpenStack
158
91
159
- [ RKE2 cheatsheet ] ( https://gist.github.com/superseb/3b78f47989e0dbc1295486c186e944bf )
92
+ [ RKE2 cheat sheet ] ( https://gist.github.com/superseb/3b78f47989e0dbc1295486c186e944bf )
160
93
161
94
```
162
95
# alias already set on the nodes
0 commit comments