Add graceful shutdown configuration
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2023-01-03 11:28:32 +01:00
parent dc4fa31070
commit 3f24a4af1a
2 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,22 @@
- name: Store custom configuration files
ansible.builtin.copy:
dest: "{{ item.filename }}"
content: "{{ item.content }}"
loop:
- filename: /etc/rancher/k3s/config.yaml
content: |
kubelet-arg:
- "config=/etc/rancher/k3s/kubelet.config"
- filename: /etc/rancher/k3s/kubelet.config
content: |
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
shutdownGracePeriod: 180s
shtudownGracePeriodCriticalPods: 60s
loop_control:
label: "{{ item.filename }}"
- name: Gather service facts - name: Gather service facts
ansible.builtin.service_facts: ansible.builtin.service_facts:
# Module requires no attributes # Module requires no attributes
@ -8,7 +27,7 @@
chdir: /opt/metacluster/k3s chdir: /opt/metacluster/k3s
environment: environment:
INSTALL_K3S_SKIP_DOWNLOAD: 'true' INSTALL_K3S_SKIP_DOWNLOAD: 'true'
INSTALL_K3S_EXEC: 'server --cluster-init --disable local-storage' INSTALL_K3S_EXEC: 'server --cluster-init --disable local-storage --config /etc/rancher/k3s/config.yaml'
when: ansible_facts.services['k3s.service'] is undefined when: ansible_facts.services['k3s.service'] is undefined
- name: Debug possible taints on k3s node - name: Debug possible taints on k3s node

View File

@ -154,6 +154,7 @@ components:
parse_logic: cat values.yaml | yq eval '.. | select(has("repository")) | .repository + ":" + .tag' parse_logic: cat values.yaml | yq eval '.. | select(has("repository")) | .repository + ":" + .tag'
chart_values: !unsafe | chart_values: !unsafe |
defaultSettings: defaultSettings:
allowNodeDrainWithLastHealthyReplica: true
defaultDataPath: /mnt/blockstorage defaultDataPath: /mnt/blockstorage
defaultReplicaCount: 1 defaultReplicaCount: 1
ingress: ingress: