mirror of
https://github.com/optim-enterprises-bv/terraform-talos.git
synced 2025-11-02 03:08:34 +00:00
Save
This commit is contained in:
3
hetzner/.gitignore
vendored
3
hetzner/.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
_cfgs/
|
_cfgs/
|
||||||
controlplane-*.yaml
|
|
||||||
templates/controlplane.yaml
|
templates/controlplane.yaml
|
||||||
|
controlplane-*.yaml
|
||||||
|
worker-*.yaml
|
||||||
*.patch
|
*.patch
|
||||||
|
|||||||
46
hetzner/deployments/test-as.yaml
Normal file
46
hetzner/deployments/test-as.yaml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
apiVersion: scheduling.k8s.io/v1
|
||||||
|
kind: PriorityClass
|
||||||
|
metadata:
|
||||||
|
name: overprovisioning
|
||||||
|
value: -1
|
||||||
|
globalDefault: false
|
||||||
|
description: "Priority class used by overprovisioning."
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: overprovisioning
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
run: overprovisioning
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
run: overprovisioning
|
||||||
|
spec:
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: node.kubernetes.io/instance-type
|
||||||
|
operator: Exists
|
||||||
|
podAntiAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- topologyKey: kubernetes.io/hostname
|
||||||
|
labelSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: run
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- overprovisioning
|
||||||
|
priorityClassName: overprovisioning
|
||||||
|
containers:
|
||||||
|
- name: reserve-resources
|
||||||
|
image: k8s.gcr.io/pause
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "700m"
|
||||||
40
hetzner/deployments/test-csi.yaml
Normal file
40
hetzner/deployments/test-csi.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: csi-pvc
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
|
storageClassName: hcloud-volumes
|
||||||
|
---
|
||||||
|
kind: Pod
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: csi-app
|
||||||
|
spec:
|
||||||
|
tolerations:
|
||||||
|
- effect: NoExecute
|
||||||
|
operator: Exists
|
||||||
|
- effect: NoSchedule
|
||||||
|
operator: Exists
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: node.kubernetes.io/instance-type
|
||||||
|
operator: Exists
|
||||||
|
containers:
|
||||||
|
- name: my-frontend
|
||||||
|
image: alpine
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: "/data"
|
||||||
|
name: my-csi-volume
|
||||||
|
command: [ "sleep", "1000000" ]
|
||||||
|
volumes:
|
||||||
|
- name: my-csi-volume
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: csi-pvc
|
||||||
@@ -43,7 +43,7 @@ data "openstack_networking_subnet_v2" "controlplane_public" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_compute_instance_v2" "controlplane" {
|
resource "openstack_compute_instance_v2" "controlplane" {
|
||||||
count = 1
|
count = 0
|
||||||
name = "master-${count.index + 1}"
|
name = "master-${count.index + 1}"
|
||||||
image_id = openstack_images_image_v2.talos[count.index].id
|
image_id = openstack_images_image_v2.talos[count.index].id
|
||||||
flavor_name = "s1-2"
|
flavor_name = "s1-2"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ locals {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "openstack_compute_instance_v2" "worker" {
|
resource "openstack_compute_instance_v2" "worker" {
|
||||||
count = 1
|
count = 0
|
||||||
name = "worker-${count.index + 1}"
|
name = "worker-${count.index + 1}"
|
||||||
image_id = openstack_images_image_v2.talos[count.index].id
|
image_id = openstack_images_image_v2.talos[count.index].id
|
||||||
flavor_name = "s1-2"
|
flavor_name = "s1-2"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ resource "openstack_networking_subnet_v2" "core" {
|
|||||||
cidr = cidrsubnet(var.vpc_main_cidr, 8, count.index * 4)
|
cidr = cidrsubnet(var.vpc_main_cidr, 8, count.index * 4)
|
||||||
no_gateway = true
|
no_gateway = true
|
||||||
allocation_pool {
|
allocation_pool {
|
||||||
start = cidrhost(cidrsubnet(var.vpc_main_cidr, 8, count.index * 4), 11)
|
start = cidrhost(cidrsubnet(var.vpc_main_cidr, 8, count.index * 4), 100)
|
||||||
end = cidrhost(cidrsubnet(var.vpc_main_cidr, 8, count.index * 4), -7)
|
end = cidrhost(cidrsubnet(var.vpc_main_cidr, 8, count.index * 4), -7)
|
||||||
}
|
}
|
||||||
ip_version = 4
|
ip_version = 4
|
||||||
@@ -35,7 +35,7 @@ resource "openstack_networking_subnet_v2" "private" {
|
|||||||
network_id = data.openstack_networking_network_v2.main[count.index].id
|
network_id = data.openstack_networking_network_v2.main[count.index].id
|
||||||
cidr = cidrsubnet(var.vpc_main_cidr, 8, 1 + count.index * 4)
|
cidr = cidrsubnet(var.vpc_main_cidr, 8, 1 + count.index * 4)
|
||||||
allocation_pool {
|
allocation_pool {
|
||||||
start = cidrhost(cidrsubnet(var.vpc_main_cidr, 8, 1 + count.index * 4), 11)
|
start = cidrhost(cidrsubnet(var.vpc_main_cidr, 8, 1 + count.index * 4), 100)
|
||||||
end = cidrhost(cidrsubnet(var.vpc_main_cidr, 8, 1 + count.index * 4), -7)
|
end = cidrhost(cidrsubnet(var.vpc_main_cidr, 8, 1 + count.index * 4), -7)
|
||||||
}
|
}
|
||||||
ip_version = 4
|
ip_version = 4
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ resource "null_resource" "controlplane_machineconfig" {
|
|||||||
type = "controlplane"
|
type = "controlplane"
|
||||||
ipv4_local = "192.168.10.11"
|
ipv4_local = "192.168.10.11"
|
||||||
ipv4_vip = "192.168.10.10"
|
ipv4_vip = "192.168.10.10"
|
||||||
nodeSubnets = "${var.vpc_main_cidr},!192.168.10.10/32"
|
nodeSubnets = "${var.vpc_main_cidr}"
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ variable "hcloud_token" {
|
|||||||
|
|
||||||
variable "talos_version" {
|
variable "talos_version" {
|
||||||
type = string
|
type = string
|
||||||
default = "v0.13.0"
|
default = "v0.13.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
|
|||||||
Reference in New Issue
Block a user