// This module is included in the following assemblies:
//
// installing/installing_bare_metal/ipi/ipi-install-troubleshooting.adoc

:_mod-docs-content-type: PROCEDURE
[id="investigating-an-unavailable-kubernetes-api_{context}"]
= Investigating an unavailable Kubernetes API

When the Kubernetes API is unavailable, check the control plane nodes to ensure that they are running the correct components. Also, check the hostname resolution.

.Procedure

.  Ensure that `etcd` is running on each of the control plane nodes by running the following command:
+
[source,terminal]
----
$ sudo crictl logs $(sudo crictl ps --pod=$(sudo crictl pods --name=etcd-member --quiet) --quiet)
----

. If the previous command fails, ensure that Kubelet created the `etcd` pods by running the following command:
+
[source,terminal]
----
$ sudo crictl pods --name=etcd-member
----
+
If there are no pods, investigate `etcd`.

. Check the cluster nodes to ensure they have a fully qualified domain name, and not just `localhost.localdomain`, by using the following command:
+
[source,terminal]
----
$ hostname
----
+
If a hostname is not set, set the correct hostname. For example:
+
[source,terminal]
----
$ sudo hostnamectl set-hostname <hostname>
----

. Ensure that each node has the correct name resolution in the DNS server using the `dig` command:
+
[source,terminal]
----
$ dig api.<cluster_name>.example.com
----
+
[source,terminal]
----
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el8 <<>> api.<cluster_name>.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37551
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 866929d2f8e8563582af23f05ec44203d313e50948d43f60 (good)
;; QUESTION SECTION:
;api.<cluster_name>.example.com. IN A

;; ANSWER SECTION:
api.<cluster_name>.example.com. 10800 IN	A 10.19.13.86

;; AUTHORITY SECTION:
<cluster_name>.example.com. 10800 IN NS	<cluster_name>.example.com.

;; ADDITIONAL SECTION:
<cluster_name>.example.com. 10800 IN A	10.19.14.247

;; Query time: 0 msec
;; SERVER: 10.19.14.247#53(10.19.14.247)
;; WHEN: Tue May 19 20:30:59 UTC 2020
;; MSG SIZE  rcvd: 140
----
+
The output in the foregoing example indicates that the appropriate IP address for the `api.<cluster_name>.example.com` VIP is `10.19.13.86`. This IP address should reside on the `baremetal` network.
