Verified Commit 7e300192 authored by Hugo's avatar Hugo
Browse files

fixes + prod config

parent 790be1c5
......@@ -12,6 +12,11 @@ tasks:
cmds:
- ansible-galaxy install -r requirements.yaml
- pip3 install openshift
init:
desc: Terraform init
dir: terraform
cmds:
- terraform init -backend-config=secret_key=$AWS_SECRET_ACCESS_KEY
apply:
desc: Apply the configuration.
cmds:
......
name: ada-lovelace
sshKeys: ["4180571"]
sshKeys: ["4180571", "4180869", "4180895"]
location: "fsn1"
network:
id: 1182169
......@@ -19,39 +19,42 @@ firewall:
jvb:
port: 30300
proto: udp
jvb-tcp:
port: 30301
proto: tcp
nodes:
c1:
type: vm
role: controller
serverType: cx21
serverType: cx11
privateIp: 10.0.1.64
ingress: false
volumes: {}
c2:
type: vm
role: controller
serverType: cx21
serverType: cx11
privateIp: 10.0.1.65
ingress: false
volumes: {}
c3:
type: vm
role: controller
serverType: cx21
serverType: cx11
privateIp: 10.0.1.66
ingress: false
volumes: {}
i1:
type: vm
role: worker
serverType: cpx11
serverType: cx11
privateIp: 10.0.1.128
ingress: true
volumes: {}
i2:
type: vm
role: worker
serverType: cpx11
serverType: cx11
privateIp: 10.0.1.129
ingress: true
volumes: {}
......@@ -63,7 +66,7 @@ nodes:
ingress: false
volumes:
vol1:
size: 10
size: 30
vg: true
w2:
type: vm
......
......@@ -28,3 +28,24 @@
tasks:
- import_tasks: "tasks/deploy.yaml"
- import_tasks: "tasks/addons.yaml"
- name: fix worklet
hosts: worker
remote_user: root
any_errors_fatal: true
handlers:
- name: restart k0sworker
ansible.builtin.systemd:
state: restarted
daemon_reload: yes
name: k0sworker
tasks:
- import_tasks: "tasks/load-cluster.yaml"
- name: set worklet ip
lineinfile:
dest: /etc/systemd/system/k0sworker.service
regexp: "^ExecStart=/usr/local/bin/k0s worker"
line: 'ExecStart=/usr/local/bin/k0s worker --token-file=/etc/k0s/k0stoken --kubelet-extra-args="--node-ip={{node.privateIp}} --address=0.0.0.0"'
state: present
notify:
- restart k0sworker
- name: set konnectivity tolerations
kubernetes.core.k8s:
kubeconfig: kubeconfig
state: present
namespace: kube-system
definition:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: konnectivity-agent
spec:
template:
spec:
tolerations:
- key: CriticalAddonsOnly
operator: Exists
- effect: NoSchedule
operator: Exists
- name: set node labels
kubernetes.core.k8s:
kubeconfig: kubeconfig
......@@ -10,7 +29,7 @@
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' }}"
cputype: "{% if item.value.type != 'vm'%}dedicated{% elif item.value.serverType.find('ccx') == 1 %}virtual-dedicated{% else %}virtual{% endif %}"
cputype: "{% if item.value.type != 'vm'%}dedicated{% elif item.value.serverType.find('ccx') == 0 %}virtual-dedicated{% else %}virtual{% endif %}"
loop: "{{ cluster.nodes | dict2items }}"
loop_control:
label: "{{ item.key }}"
......
......@@ -40,4 +40,3 @@
community.general.ufw:
state: enabled
policy: deny
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