Update .gitignore to include .env file and enhance README.md with instructions for deploying secrets. Refactor noble.yml to improve Kubernetes health check handling and update templates for error reporting. Modify cert-manager and metallb tasks to apply secrets from .env and adjust timeout settings. Clarify Newt installation requirements in tasks. These changes aim to streamline deployment processes and improve documentation clarity.
This commit is contained in:
@@ -107,7 +107,7 @@
|
||||
- --request-timeout=15s
|
||||
environment:
|
||||
KUBECONFIG: "{{ noble_kubeconfig }}"
|
||||
register: noble_k8s_health
|
||||
register: noble_k8s_health_first
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
tags: [always]
|
||||
@@ -119,9 +119,9 @@
|
||||
- noble_k8s_api_server_auto_fallback | default(true) | bool
|
||||
- noble_k8s_api_server_override | default('') | length == 0
|
||||
- not (noble_skip_k8s_health_check | default(false) | bool)
|
||||
- noble_k8s_health.rc != 0 or (noble_k8s_health.stdout | default('') | trim) != 'ok'
|
||||
- ('network is unreachable' in (noble_k8s_health.stderr | default('') | lower)) or
|
||||
('no route to host' in (noble_k8s_health.stderr | default('') | lower))
|
||||
- (noble_k8s_health_first.rc | default(1)) != 0 or (noble_k8s_health_first.stdout | default('') | trim) != 'ok'
|
||||
- ('network is unreachable' in (noble_k8s_health_first.stderr | default('') | lower)) or
|
||||
('no route to host' in (noble_k8s_health_first.stderr | default('') | lower))
|
||||
block:
|
||||
- name: Ensure temp dir for kubeconfig auto-fallback
|
||||
ansible.builtin.file:
|
||||
@@ -174,16 +174,27 @@
|
||||
- --request-timeout=15s
|
||||
environment:
|
||||
KUBECONFIG: "{{ noble_kubeconfig }}"
|
||||
register: noble_k8s_health
|
||||
register: noble_k8s_health_after_fallback
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
|
||||
- name: Mark that API was re-checked after kubeconfig fallback
|
||||
ansible.builtin.set_fact:
|
||||
noble_k8s_api_fallback_used: true
|
||||
|
||||
- name: Normalize API health result for preflight (scalars; avoids dict merge / set_fact stringification)
|
||||
ansible.builtin.set_fact:
|
||||
noble_k8s_health_rc: "{{ noble_k8s_health_after_fallback.rc | default(1) if (noble_k8s_api_fallback_used | default(false) | bool) else (noble_k8s_health_first.rc | default(1)) }}"
|
||||
noble_k8s_health_stdout: "{{ noble_k8s_health_after_fallback.stdout | default('') if (noble_k8s_api_fallback_used | default(false) | bool) else (noble_k8s_health_first.stdout | default('')) }}"
|
||||
noble_k8s_health_stderr: "{{ noble_k8s_health_after_fallback.stderr | default('') if (noble_k8s_api_fallback_used | default(false) | bool) else (noble_k8s_health_first.stderr | default('')) }}"
|
||||
tags: [always]
|
||||
|
||||
- name: Fail when API check did not return ok
|
||||
ansible.builtin.fail:
|
||||
msg: "{{ lookup('template', 'templates/api_health_hint.j2') }}"
|
||||
when:
|
||||
- not (noble_skip_k8s_health_check | default(false) | bool)
|
||||
- noble_k8s_health.rc != 0 or (noble_k8s_health.stdout | default('') | trim) != 'ok'
|
||||
- (noble_k8s_health_rc | int) != 0 or (noble_k8s_health_stdout | default('') | trim) != 'ok'
|
||||
tags: [always]
|
||||
|
||||
roles:
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{# Error output for noble.yml API preflight when kubectl /healthz fails #}
|
||||
Cannot use the Kubernetes API from this host (kubectl get --raw /healthz).
|
||||
rc={{ noble_k8s_health.rc }}
|
||||
stderr: {{ noble_k8s_health.stderr | default('') | trim }}
|
||||
rc={{ noble_k8s_health_rc | default('n/a') }}
|
||||
stderr: {{ noble_k8s_health_stderr | default('') | trim }}
|
||||
|
||||
{% set err = (noble_k8s_health.stderr | default('')) | lower %}
|
||||
{% set err = (noble_k8s_health_stderr | default('')) | lower %}
|
||||
{% if 'connection refused' in err %}
|
||||
Connection refused: the TCP path to that host works, but nothing is accepting HTTPS on port 6443 there.
|
||||
• **Not bootstrapped yet?** Finish Talos first: `talosctl bootstrap` (once on a control plane), then `talosctl kubeconfig`, then confirm `kubectl get nodes`. See talos/README.md §2–§3 and CLUSTER-BUILD.md Phase A. **Do not run this playbook before the Kubernetes API exists.**
|
||||
|
||||
Reference in New Issue
Block a user