Skip to content

Commit

Permalink
Add debug logs from capi pod
Browse files Browse the repository at this point in the history
Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud>
  • Loading branch information
michal-gubricky committed Jul 10, 2024
1 parent 6b8c5be commit 6f254d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
17 changes: 7 additions & 10 deletions playbooks/openstack/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,29 +175,26 @@
- name: Apply cluster template
ansible.builtin.command: "kubectl apply -f {{ ansible_user_dir }}/cluster.yaml"
changed_when: true
- name: Debug puase
ansible.builtin.pause:
seconds: 600
- name: Describe cluster
ansible.builtin.command: "kubectl describe cluster"
changed_when: true

- name: Get pod names in the cso-system namespace
ansible.builtin.command: kubectl get pods -n cso-system -o jsonpath='{.items[*].metadata.name}'
- name: Get the single pod name in the capo-system namespace
ansible.builtin.command: kubectl get pods -n capo-system -o jsonpath='{.items[0].metadata.name}'
register: pod_name_output
changed_when: true

- name: Set fact for pod names
- name: Set fact for pod name
ansible.builtin.set_fact:
pod_name: "{{ pod_name_output.stdout }}"

- name: Fetch log from the pod
ansible.builtin.command: kubectl logs -n cso-system {{ pod_name }}
ansible.builtin.command: kubectl logs -n capo-system {{ pod_name }}
register: pod_log
changed_when: true

- name: Get the single pod name in the capo-system namespace
ansible.builtin.command: kubectl get pods -n capo-system -o jsonpath='{.items[0].metadata.name}'
- name: Get the single pod name in the capi-system namespace
ansible.builtin.command: kubectl get pods -n capi-system -o jsonpath='{.items[0].metadata.name}'
register: pod_name_output
changed_when: true

Expand All @@ -206,7 +203,7 @@
pod_name: "{{ pod_name_output.stdout }}"

- name: Fetch log from the pod
ansible.builtin.command: kubectl logs -n capo-system {{ pod_name }}
ansible.builtin.command: kubectl logs -n capi-system {{ pod_name }}
register: pod_log
changed_when: true

Expand Down
4 changes: 0 additions & 4 deletions playbooks/openstack/templates/cluster.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ spec:
value: {{ cloud_name }}
- name: secret_name
value: {{ cloud_name }}
- name: controller_server_group_id
value: {{ controller_server_group_id_value }}
- name: worker_server_group_id
value: {{ worker_server_group_id_value }}
class: {{ cluster_stack_name }}-{{ cluster_stack_version }}
controlPlane:
replicas: 3
Expand Down

0 comments on commit 6f254d2

Please sign in to comment.