Change to tofu-creation for all machines in cluster. Rename k8sm to k8sc as in controller.
This commit is contained in:
parent
b14a26a107
commit
f76aa8648d
6 changed files with 57 additions and 41 deletions
23
README.md
23
README.md
|
@ -3,12 +3,27 @@
|
|||
* `tofu apply` to create machines
|
||||
* change hostname to be fqdn with hostnamectl, changing with a running cluster will break the cluster
|
||||
* register dns with `knotctl add -z rut.sunet.se -n internal-sto4-test-k8sm-1.rut.sunet.se. -d 2001:6b0:6c::449 -r AAAA`
|
||||
* ./prepare-iaas-debian ${each host}
|
||||
* ./add-host -b {each host}
|
||||
* ./edit-secrets ${each controller host}
|
||||
|
||||
```
|
||||
---
|
||||
+microk8s_secrets:
|
||||
+ kube-system:
|
||||
+ cloud-config:
|
||||
+ - key: cloud.conf
|
||||
+ value: >
|
||||
+ ENC[PKCS7,MIID7gYJKoZIhvcNAQcDoIID3zCCA9sCAQAxggKSMIICjgIBAD
|
||||
+ B2MF4xCzAJBgNVBAYTAlNFMQ4wDAYDVQQKDAVTVU5FVDEOMAwGA1UECwwFRV
|
||||
+ lBTUwxLzAtBgNVBAMMJmludGVybmFsLXN0bzQtdGVzdC1rOHNtLTIucnV0Ln
|
||||
```
|
||||
* Add to cosmos-rules:
|
||||
|
||||
|
||||
```
|
||||
|
||||
'^internal-sto4-test-k8sm-[0-9].rut.sunet.se$':
|
||||
'^internal-sto4-test-k8sc-[0-9].rut.sunet.se$':
|
||||
rut::infra_ca_rp:
|
||||
sunet::microk8s::node:
|
||||
channel: 1.28/stable
|
||||
|
@ -33,14 +48,14 @@
|
|||
|
||||
```
|
||||
NAME STATUS ROLES AGE VERSION
|
||||
internal-sto4-test-k8sm-2.rut.sunet.se NotReady <none> 16d v1.28.7
|
||||
internal-sto4-test-k8sc-2.rut.sunet.se NotReady <none> 16d v1.28.7
|
||||
internal-sto4-test-k8sw-5.rut.sunet.se Ready <none> 15m v1.28.7
|
||||
internal-sto4-test-k8sw-1.rut.sunet.se Ready <none> 15m v1.28.7
|
||||
internal-sto4-test-k8sw-2.rut.sunet.se Ready <none> 14m v1.28.7
|
||||
internal-sto4-test-k8sm-3.rut.sunet.se Ready <none> 16d v1.28.7
|
||||
internal-sto4-test-k8sc-3.rut.sunet.se Ready <none> 16d v1.28.7
|
||||
internal-sto4-test-k8sw-3.rut.sunet.se Ready <none> 18m v1.28.7
|
||||
internal-sto4-test-k8sw-4.rut.sunet.se Ready <none> 16m v1.28.7
|
||||
internal-sto4-test-k8sw-0.rut.sunet.se Ready <none> 21m v1.28.7
|
||||
internal-sto4-test-k8sm-1.rut.sunet.se Ready <none> 16d v1.28.7
|
||||
internal-sto4-test-k8sc-1.rut.sunet.se Ready <none> 16d v1.28.7
|
||||
```
|
||||
* **Profit**
|
|
@ -3,7 +3,7 @@
|
|||
sunet::server:
|
||||
rut:
|
||||
|
||||
'^internal-sto4-test-k8sm-[0-9].rut.sunet.se$':
|
||||
'^internal-sto4-test-k8sc-[0-9].rut.sunet.se$':
|
||||
rut::infra_ca_rp:
|
||||
sunet::microk8s::node:
|
||||
channel: 1.28/stable
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
../README
|
|
@ -1,27 +0,0 @@
|
|||
---
|
||||
microk8s_secrets:
|
||||
kube-system:
|
||||
cloud-config:
|
||||
- key: cloud.conf
|
||||
value: >
|
||||
ENC[PKCS7,MIIDnAYJKoZIhvcNAQcDoIIDjTCCA4kCAQAxggKSMIICjgIBAD
|
||||
B2MF4xCzAJBgNVBAYTAlNFMQ4wDAYDVQQKDAVTVU5FVDEOMAwGA1UECwwFRV
|
||||
lBTUwxLzAtBgNVBAMMJmludGVybmFsLXN0bzQtdGVzdC1rOHNtLTMucnV0Ln
|
||||
N1bmV0LnNlAhQ4cBxUJngNK2mgQCgsgt7W7xOvFDANBgkqhkiG9w0BAQEFAA
|
||||
SCAgCDpZQbfLm3N8RBM6v3eXIhpBMQ4YjPnEA9GwiX3+T22AzJRprHQcpXtT
|
||||
IsfUz9fyOyZsG4WhhscPsqf9YeB24+F8tQFRxyJxryhd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||||
}
|
||||
|
||||
resource "openstack_compute_instance_v2" "worker-nodes" {
|
||||
count = var.instance_count
|
||||
name = "${var.worker_name}-${count.index}.${var.dns_suffix}"
|
||||
flavor_id = "${var.instance_type}"
|
||||
resource "openstack_compute_instance_v2" "controller-nodes" {
|
||||
count = var.controller_instance_count
|
||||
name = "${var.controller_name}-${count.index}.${var.dns_suffix}"
|
||||
flavor_name = "${var.controller_instance_type}"
|
||||
key_pair = "mifr-yubi"
|
||||
security_groups = ["microk8s", "Allow SSH from SUNET jumphosts", "Allow ssh from the world"]
|
||||
|
||||
block_device {
|
||||
uuid = "5d24aca9-11be-4de1-9770-4a097d68f361"
|
||||
source_type = "image"
|
||||
volume_size = 20
|
||||
boot_index = 0
|
||||
destination_type = "volume"
|
||||
delete_on_termination = true
|
||||
}
|
||||
|
||||
network {
|
||||
name = "public"
|
||||
}
|
||||
}
|
||||
resource "openstack_compute_instance_v2" "worker-nodes" {
|
||||
count = var.worker_instance_count
|
||||
name = "${var.worker_name}-${count.index}.${var.dns_suffix}"
|
||||
flavor_name = "${var.worker_instance_type}"
|
||||
key_pair = "mifr-yubi"
|
||||
security_groups = ["microk8s", "Allow SSH from SUNET jumphosts", "Allow ssh from the world"]
|
||||
|
||||
|
|
15
vars.tf
15
vars.tf
|
@ -1,13 +1,22 @@
|
|||
variable "instance_count" {
|
||||
variable "worker_instance_count" {
|
||||
default = "6"
|
||||
}
|
||||
variable "controller_instance_count" {
|
||||
default = "3"
|
||||
}
|
||||
|
||||
variable "instance_type" {
|
||||
default = "e2677a72-f9ab-44ce-b808-58ab3414bac6"
|
||||
variable "controller_instance_type" {
|
||||
default = "b2.c2r4"
|
||||
}
|
||||
variable "worker_instance_type" {
|
||||
default = "b2.c4r16"
|
||||
}
|
||||
variable "worker_name" {
|
||||
default = "internal-sto4-test-k8sw"
|
||||
}
|
||||
variable "controller_name" {
|
||||
default = "internal-sto4-test-k8sc"
|
||||
}
|
||||
variable "dns_suffix" {
|
||||
default = "rut.sunet.se"
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue