fix: show detailed Loki template and resource diagnostics
This commit is contained in:
@@ -66,19 +66,25 @@
|
|||||||
--values /tmp/loki-values.yaml
|
--values /tmp/loki-values.yaml
|
||||||
register: loki_template
|
register: loki_template
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
- name: Show Loki template output (check for StatefulSet)
|
- name: Show Loki template summary
|
||||||
debug:
|
debug:
|
||||||
msg: "Loki template contains StatefulSet: {{ 'kind: StatefulSet' in loki_template.stdout }}"
|
|
||||||
when: "'kind: StatefulSet' not in loki_template.stdout"
|
|
||||||
|
|
||||||
- name: Fail if Loki template produces no StatefulSet
|
|
||||||
fail:
|
|
||||||
msg: |
|
msg: |
|
||||||
Loki Helm template produces no StatefulSet. Check values configuration.
|
Template rc: {{ loki_template.rc }}
|
||||||
Template output (first 100 lines):
|
Contains StatefulSet: {{ 'kind: StatefulSet' in loki_template.stdout }}
|
||||||
{{ loki_template.stdout.split('\n')[:100] | join('\n') }}
|
Contains Deployment: {{ 'kind: Deployment' in loki_template.stdout }}
|
||||||
when: "'kind: StatefulSet' not in loki_template.stdout"
|
Template stderr: {{ loki_template.stderr }}
|
||||||
|
|
||||||
|
- name: Show Loki template output sample
|
||||||
|
debug:
|
||||||
|
msg: "{{ loki_template.stdout.split('\n')[:50] }}"
|
||||||
|
when: loki_template.rc == 0
|
||||||
|
|
||||||
|
- name: Fail if Loki template fails
|
||||||
|
fail:
|
||||||
|
msg: "Loki helm template failed: {{ loki_template.stderr }}"
|
||||||
|
when: loki_template.rc != 0
|
||||||
|
|
||||||
- name: Remove legacy Loki scalable workloads (if present)
|
- name: Remove legacy Loki scalable workloads (if present)
|
||||||
command: >-
|
command: >-
|
||||||
@@ -145,10 +151,20 @@
|
|||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
|
- name: Show ALL observability resources
|
||||||
|
command: kubectl -n {{ observability_namespace }} get all,configmaps,secrets,pvc
|
||||||
|
register: all_observability_resources
|
||||||
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
|
- name: Debug all observability resources
|
||||||
|
debug:
|
||||||
|
msg: "{{ all_observability_resources.stdout }}"
|
||||||
|
when: all_observability_resources.stdout | length > 0
|
||||||
|
|
||||||
- name: Debug Loki resources
|
- name: Debug Loki resources
|
||||||
debug:
|
debug:
|
||||||
msg: "{{ loki_resources.stdout }}"
|
msg: "Loki resources: {{ loki_resources.stdout if loki_resources.stdout | length > 0 else 'No Loki resources found' }}"
|
||||||
when: loki_resources.stdout | length > 0
|
|
||||||
|
|
||||||
- name: Wait for Loki statefulset rollout
|
- name: Wait for Loki statefulset rollout
|
||||||
command: kubectl -n {{ observability_namespace }} rollout status statefulset/loki --timeout=10m
|
command: kubectl -n {{ observability_namespace }} rollout status statefulset/loki --timeout=10m
|
||||||
|
|||||||
Reference in New Issue
Block a user