Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSD-26287 - Add '--reason' to 'osdctl cluster etcd-health-check' #647

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tnierman
Copy link
Member

https://issues.redhat.com/browse/OSD-26287


Adds a required --reason flag to the osdctl cluster etcd-health-check command, allowing it to successfully exec into an etcd pod to run etcdctl commands.

For example, the current logic results in the following:

[tnierman@tnierman-thinkpadp1gen5] >> ~/workspace/osdctl/dist/osdctl_linux_amd64_v1/osdctl cluster etcd-health-check $CLUSTERID -S
INFO[0000] Backplane URL retrieved via OCM environment: https://api.stage.backplane.openshift.com 
INFO[0000] No PagerDuty API Key configuration available. This will result in failure of `ocm-backplane login --pd <incident-id>` command. 
INFO[0001] Backplane URL retrieved via OCM environment: https://api.stage.backplane.openshift.com 
INFO[0001] No PagerDuty API Key configuration available. This will result in failure of `ocm-backplane login --pd <incident-id>` command. 
+----------------------------------------------------------------+
|                CONTROLPLANE NODE STATUS                        |
+----------------------------------------------------------------+
ip-10-0-15-44.us-west-1.compute.internal        Ready   True
ip-10-0-22-91.us-west-1.compute.internal        Ready   True
ip-10-0-49-89.us-west-1.compute.internal        Ready   True
+----------------------------------------------------------------+
|               ETCD POD STATUS                                  |
+----------------------------------------------------------------+
etcd-ip-10-0-15-44.us-west-1.compute.internal   4/4
etcd-ip-10-0-22-91.us-west-1.compute.internal   4/4
etcd-ip-10-0-49-89.us-west-1.compute.internal   4/4
+---------------------------------------------------------------+
|               ETCD MEMBER HEALTH STATUS                       |
+---------------------------------------------------------------+
3 members are available

pods "etcd-ip-10-0-15-44.us-west-1.compute.internal" is forbidden: User "system:serviceaccount:openshift-backplane-srep:ed20b22e60f9973ab686e54bacf38f54" cannot create resource "pods/exec" in API group "" in the namespace "openshift-etcd"
$ etcdctl endpoint status -w table

pods "etcd-ip-10-0-15-44.us-west-1.compute.internal" is forbidden: User "system:serviceaccount:openshift-backplane-srep:ed20b22e60f9973ab686e54bacf38f54" cannot create resource "pods/exec" in API group "" in the namespace "openshift-etcd"
$ etcdctl endpoint health -w table

pods "etcd-ip-10-0-15-44.us-west-1.compute.internal" is forbidden: User "system:serviceaccount:openshift-backplane-srep:ed20b22e60f9973ab686e54bacf38f54" cannot create resource "pods/exec" in API group "" in the namespace "openshift-etcd"
$ etcdctl member list -w table

Adding the reason flag allows this to execute successfully:

[tnierman@tnierman-thinkpadp1gen5] >> ~/workspace/osdctl/dist/osdctl_linux_amd64_v1/osdctl cluster etcd-health-check $CLUSTERID --reason testing -S
INFO[0000] Backplane URL retrieved via OCM environment: https://api.stage.backplane.openshift.com 
INFO[0000] No PagerDuty API Key configuration available. This will result in failure of `ocm-backplane login --pd <incident-id>` command. 
INFO[0001] Backplane URL retrieved via OCM environment: https://api.stage.backplane.openshift.com 
INFO[0002] No PagerDuty API Key configuration available. This will result in failure of `ocm-backplane login --pd <incident-id>` command. 
+----------------------------------------------------------------+
|                CONTROLPLANE NODE STATUS                        |
+----------------------------------------------------------------+
ip-10-0-15-44.us-west-1.compute.internal        Ready   True
ip-10-0-22-91.us-west-1.compute.internal        Ready   True
ip-10-0-49-89.us-west-1.compute.internal        Ready   True
+----------------------------------------------------------------+
|               ETCD POD STATUS                                  |
+----------------------------------------------------------------+
etcd-ip-10-0-15-44.us-west-1.compute.internal   4/4
etcd-ip-10-0-22-91.us-west-1.compute.internal   4/4
etcd-ip-10-0-49-89.us-west-1.compute.internal   4/4
+---------------------------------------------------------------+
|               ETCD MEMBER HEALTH STATUS                       |
+---------------------------------------------------------------+
3 members are available

$ etcdctl endpoint status -w table
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
|        ENDPOINT         |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| https://10.0.15.44:2379 | f67c06d7ddeeaa3e |  3.5.16 |  205 MB |     false |      false |         9 |      75977 |              75977 |        |
| https://10.0.22.91:2379 | bba5a12344edd51b |  3.5.16 |  206 MB |      true |      false |         9 |      75977 |              75977 |        |
| https://10.0.49.89:2379 | 1e518e2c8b9dcbb2 |  3.5.16 |  206 MB |     false |      false |         9 |      75977 |              75977 |        |
+-------------------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+

$ etcdctl endpoint health -w table
+-------------------------+--------+------------+-------+
|        ENDPOINT         | HEALTH |    TOOK    | ERROR |
+-------------------------+--------+------------+-------+
| https://10.0.49.89:2379 |   true | 7.071363ms |       |
| https://10.0.22.91:2379 |   true |  7.28867ms |       |
| https://10.0.15.44:2379 |   true | 7.500636ms |       |
+-------------------------+--------+------------+-------+

$ etcdctl member list -w table
+------------------+---------+------------------------------------------+-------------------------+-------------------------+------------+
|        ID        | STATUS  |                   NAME                   |       PEER ADDRS        |      CLIENT ADDRS       | IS LEARNER |
+------------------+---------+------------------------------------------+-------------------------+-------------------------+------------+
| 1e518e2c8b9dcbb2 | started | ip-10-0-49-89.us-west-1.compute.internal | https://10.0.49.89:2380 | https://10.0.49.89:2379 |      false |
| bba5a12344edd51b | started | ip-10-0-22-91.us-west-1.compute.internal | https://10.0.22.91:2380 | https://10.0.22.91:2379 |      false |
| f67c06d7ddeeaa3e | started | ip-10-0-15-44.us-west-1.compute.internal | https://10.0.15.44:2380 | https://10.0.15.44:2379 |      false |
+------------------+---------+------------------------------------------+-------------------------+-------------------------+------------+

@openshift-ci openshift-ci bot requested review from dustman9000 and Tafhim December 23, 2024 20:05
Copy link
Contributor

openshift-ci bot commented Dec 23, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tnierman
Once this PR has been reviewed and has the lgtm label, please assign typeid for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

openshift-ci bot commented Dec 23, 2024

@tnierman: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant