Verified Commit 81a2caa3 authored by Hugo's avatar Hugo
Browse files

multi env + noschedule on ingress

parent 6fae1dd9
name: ada-lovelace-beta
sshKeys: ["3245559"]
location: "fsn1"
network:
id: 1116209
zone: eu-central
cloudCidr: 10.0.3.0/24
# dedicatedCidr: 10.0.2.0/24
# vSwitchId:
api:
lbType: lb11
privateIp: 10.0.3.5
ingress:
lbType: lb11
privateIp: 10.0.3.6
ports:
80: "32080"
443: "32443"
nodes:
c1:
type: vm
role: controller
serverType: cx21
privateIp: 10.0.3.11
ingress: false
volumes: {}
c2:
type: vm
role: controller
serverType: cx21
privateIp: 10.0.3.12
ingress: false
volumes: {}
c3:
type: vm
role: controller
serverType: cx21
privateIp: 10.0.3.13
ingress: false
volumes: {}
w1:
type: vm
role: worker
serverType: cpx21
privateIp: 10.0.3.21
ingress: false
volumes:
vol1:
size: 10
vg: true
vol2:
size: 10
vg: false
w2:
type: vm
role: worker
serverType: cpx21
privateIp: 10.0.3.22
ingress: false
volumes:
vol1:
size: 10
vg: true
vol2:
size: 10
vg: false
w3:
type: vm
role: worker
serverType: cpx21
privateIp: 10.0.3.23
ingress: false
volumes:
vol1:
size: 10
vg: true
vol2:
size: 10
vg: false
w4:
type: vm
role: worker
serverType: cpx21
privateIp: 10.0.3.24
ingress: false
volumes:
vol1:
size: 10
vg: true
vol2:
size: 10
vg: false
i1:
type: vm
role: worker
serverType: cx21
privateIp: 10.0.3.25
ingress: true
volumes: {}
i2:
type: vm
role: worker
serverType: cx21
privateIp: 10.0.3.26
ingress: true
volumes: {}
......@@ -5,6 +5,8 @@ network:
id: 1116209
zone: eu-central
cloudCidr: 10.0.1.0/24
# dedicatedCidr: 10.0.2.0/24
# vSwitchId:
api:
lbType: lb11
privateIp: 10.0.1.5
......@@ -39,7 +41,7 @@ nodes:
w1:
type: vm
role: worker
serverType: cx21
serverType: cpx21
privateIp: 10.0.1.21
ingress: false
volumes:
......@@ -52,7 +54,7 @@ nodes:
w2:
type: vm
role: worker
serverType: cx21
serverType: cpx21
privateIp: 10.0.1.22
ingress: false
volumes:
......@@ -65,9 +67,9 @@ nodes:
w3:
type: vm
role: worker
serverType: cx21
serverType: cpx21
privateIp: 10.0.1.23
ingress: true
ingress: false
volumes:
vol1:
size: 10
......@@ -78,9 +80,9 @@ nodes:
w4:
type: vm
role: worker
serverType: cx21
serverType: cpx21
privateIp: 10.0.1.24
ingress: true
ingress: false
volumes:
vol1:
size: 10
......@@ -88,3 +90,17 @@ nodes:
vol2:
size: 10
vg: false
w5:
type: vm
role: worker
serverType: cx21
privateIp: 10.0.1.25
ingress: true
volumes: {}
w6:
type: vm
role: worker
serverType: cx21
privateIp: 10.0.1.26
ingress: true
volumes: {}
......@@ -5,9 +5,14 @@
file:
path: k0sctl.yaml
state: absent
- name: remove kubeconfig
file:
path: kubeconfig
state: absent
- name: run terraform
community.general.terraform:
project_path: "terraform/"
state: absent
workspace: "{{ lookup('env', 'ENV') }}"
variables:
hcloud_token: "{{ lookup('env', 'HCLOUD_TOKEN') }}"
......@@ -11,8 +11,12 @@ kind: StorageClass
metadata:
name: openebs-lvm
allowVolumeExpansion: true
volumeBindingMode: WaitForFirstConsumer
parameters:
fstype: "xfs"
volgroup: "vg-k8s"
provisioner: local.csi.openebs.io
allowedTopologies:
- matchLabelExpressions:
- key: openebs.io/lvmvg
values:
- vg-k8s
- name: set ingress label
- name: set node labels
kubernetes.core.k8s:
kubeconfig: kubeconfig
state: present
......@@ -9,6 +9,7 @@
name: "{{ cluster.name }}-{{ item.key }}"
labels:
ingress: "{{ item.value.ingress | string | lower }}"
openebs.io/lvmvg: "{{ 'vg-k8s' if 0 < item.value.volumes | dict2items | map(attribute='value') | selectattr('vg', 'true') | length else 'none' }}"
loop: "{{ cluster.nodes | dict2items }}"
loop_control:
label: "{{ item.key }}"
......@@ -56,13 +57,18 @@
name: ingress-nginx
chart_ref: ingress-nginx/ingress-nginx
release_namespace: ingress-nginx
chart_version: 3.30.0
chart_version: 3.31.0
values:
controller:
kind: DaemonSet
nodeSelector:
kubernetes.io/os: linux
ingress: "true"
tolerations:
- key: dedicate
operator: Equal
value: ingress
effect: NoSchedule
service:
type: NodePort
nodePorts:
......@@ -77,7 +83,18 @@
name: prometheus-stack
chart_ref: prometheus-community/kube-prometheus-stack
release_namespace: monitoring
chart_version: 15.4.5
chart_version: 16.0.0
values:
prometheus:
prometheusSpec:
storageSpec:
volumeClaimTemplate:
spec:
storageClassName: openebs-lvm-im
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 5Gi
- name: deploy openebs-lvmlocalpv
kubernetes.core.helm:
......
......@@ -2,6 +2,7 @@
community.general.terraform:
project_path: "terraform/"
state: present
workspace: "{{ lookup('env', 'ENV') }}"
variables:
hcloud_token: "{{ lookup('env', 'HCLOUD_TOKEN') }}"
register: tf
......
......@@ -12,7 +12,7 @@ spec:
privateAddress: {{node.privateIp}}
{%endfor%}
k0s:
version: v1.20.6+k0s.0
version: v1.21.1+k0s.0
config:
apiVersion: k0s.k0sproject.io/v1beta1
kind: Cluster
......
......@@ -5,7 +5,7 @@ variable "hcloud_token" {
}
locals {
config = yamldecode(file("../config.yml"))
config = yamldecode(file("../config.${terraform.workspace}.yml"))
}
module "cluster" {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment