Skip to content

Commit b2725b6

Browse files
authored
Add doc how to check harvester status (#900)
* Add doc how to check harvester status Adding documentation on how to check the status of the harvester components to the troublshooting/installation section. The documentation is added for 1.7/1.6/1.5/1.4 Signed-off-by: Martin Dekov <[email protected]>
1 parent 15031cc commit b2725b6

File tree

4 files changed

+183
-1
lines changed

4 files changed

+183
-1
lines changed

docs/troubleshooting/installation.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,52 @@ $ sudo yq eval .token /etc/rancher/rancherd/config.yaml
106106

107107
:::
108108

109+
## Check the status of Harvester components
110+
111+
Before checking the status of Harvester components, obtain a copy of the Harvester cluster's kubeconfig file following the [guide](../faq.md#how-can-i-access-the-kubeconfig-file-of-the-harvester-cluster).
112+
113+
After you obtain a copy of the kubeconfig file, run the following script against the cluster to check the readiness of each component.
114+
115+
- Harvester components script
116+
```shell
117+
#!/bin/bash
118+
119+
cluster_ready() {
120+
namespaces=("cattle-system" "kube-system" "harvester-system" "longhorn-system")
121+
for ns in "${namespaces[@]}"; do
122+
pod_statuses=($(kubectl -n "${ns}" get pods \
123+
--field-selector=status.phase!=Succeeded \
124+
-ojsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name},{.status.conditions[?(@.type=="Ready")].status}{"\n"}{end}'))
125+
for status in "${pod_statuses[@]}"; do
126+
name=$(echo "${status}" | cut -d ',' -f1)
127+
ready=$(echo "${status}" | cut -d ',' -f2)
128+
if [ "${ready}" != "True" ]; then
129+
echo "pod ${name} is not ready"
130+
false
131+
return
132+
fi
133+
done
134+
done
135+
}
136+
137+
if cluster_ready; then
138+
echo "cluster is ready"
139+
else
140+
echo "cluster is not ready"
141+
fi
142+
```
143+
144+
- API
145+
```shell
146+
$ curl -fk https://<VIP>/version
147+
```
148+
149+
:::note
150+
151+
You must replace <VIP\> with the [real VIP](../install/management-address.md#how-to-get-the-vip-mac-address), which is the value of `kube-vip.io/requestedIP` in the link.
152+
153+
:::
154+
109155
## Collecting troubleshooting information
110156

111157
Please include the following information in a bug report when reporting a failed installation:

versioned_docs/version-v1.4/troubleshooting/installation.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,52 @@ $ sudo yq eval .token /etc/rancher/rancherd/config.yaml
106106

107107
:::
108108

109+
## Check the status of Harvester components
110+
111+
Before checking the status of Harvester components, obtain a copy of the Harvester cluster's kubeconfig file following the [guide](../faq.md#how-can-i-access-the-kubeconfig-file-of-the-harvester-cluster).
112+
113+
After you obtain a copy of the kubeconfig file, run the following script against the cluster to check the readiness of each component.
114+
115+
- Harvester components script
116+
```shell
117+
#!/bin/bash
118+
119+
cluster_ready() {
120+
namespaces=("cattle-system" "kube-system" "harvester-system" "longhorn-system")
121+
for ns in "${namespaces[@]}"; do
122+
pod_statuses=($(kubectl -n "${ns}" get pods \
123+
--field-selector=status.phase!=Succeeded \
124+
-ojsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name},{.status.conditions[?(@.type=="Ready")].status}{"\n"}{end}'))
125+
for status in "${pod_statuses[@]}"; do
126+
name=$(echo "${status}" | cut -d ',' -f1)
127+
ready=$(echo "${status}" | cut -d ',' -f2)
128+
if [ "${ready}" != "True" ]; then
129+
echo "pod ${name} is not ready"
130+
false
131+
return
132+
fi
133+
done
134+
done
135+
}
136+
137+
if cluster_ready; then
138+
echo "cluster is ready"
139+
else
140+
echo "cluster is not ready"
141+
fi
142+
```
143+
144+
- API
145+
```shell
146+
$ curl -fk https://<VIP>/version
147+
```
148+
149+
:::note
150+
151+
You must replace <VIP\> with the [real VIP](../install/management-address.md#how-to-get-the-vip-mac-address), which is the value of `kube-vip.io/requestedIP` in the link.
152+
153+
:::
154+
109155
## Collecting troubleshooting information
110156

111157
Please include the following information in a bug report when reporting a failed installation:

versioned_docs/version-v1.5/troubleshooting/installation.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,51 @@ you can run the following command to only display the token's value:
104104
$ sudo yq eval .token /etc/rancher/rancherd/config.yaml
105105
```
106106

107-
:::
107+
## Check the status of Harvester components
108+
109+
Before checking the status of Harvester components, obtain a copy of the Harvester cluster's kubeconfig file following the [guide](../faq.md#how-can-i-access-the-kubeconfig-file-of-the-harvester-cluster).
110+
111+
After you obtain a copy of the kubeconfig file, run the following script against the cluster to check the readiness of each component.
112+
113+
- Harvester components script
114+
```shell
115+
#!/bin/bash
116+
117+
cluster_ready() {
118+
namespaces=("cattle-system" "kube-system" "harvester-system" "longhorn-system")
119+
for ns in "${namespaces[@]}"; do
120+
pod_statuses=($(kubectl -n "${ns}" get pods \
121+
--field-selector=status.phase!=Succeeded \
122+
-ojsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name},{.status.conditions[?(@.type=="Ready")].status}{"\n"}{end}'))
123+
for status in "${pod_statuses[@]}"; do
124+
name=$(echo "${status}" | cut -d ',' -f1)
125+
ready=$(echo "${status}" | cut -d ',' -f2)
126+
if [ "${ready}" != "True" ]; then
127+
echo "pod ${name} is not ready"
128+
false
129+
return
130+
fi
131+
done
132+
done
133+
}
134+
135+
if cluster_ready; then
136+
echo "cluster is ready"
137+
else
138+
echo "cluster is not ready"
139+
fi
140+
```
141+
142+
- API
143+
```shell
144+
$ curl -fk https://<VIP>/version
145+
```
146+
147+
:::note
148+
149+
You must replace <VIP\> with the [real VIP](../install/management-address.md#how-to-get-the-vip-mac-address), which is the value of `kube-vip.io/requestedIP` in the link.
150+
151+
:::
108152

109153
## Collecting troubleshooting information
110154

versioned_docs/version-v1.6/troubleshooting/installation.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,52 @@ $ sudo yq eval .token /etc/rancher/rancherd/config.yaml
106106

107107
:::
108108

109+
## Check the status of Harvester components
110+
111+
Before checking the status of Harvester components, obtain a copy of the Harvester cluster's kubeconfig file following the [guide](../faq.md#how-can-i-access-the-kubeconfig-file-of-the-harvester-cluster).
112+
113+
After you obtain a copy of the kubeconfig file, run the following script against the cluster to check the readiness of each component.
114+
115+
- Harvester components script
116+
```shell
117+
#!/bin/bash
118+
119+
cluster_ready() {
120+
namespaces=("cattle-system" "kube-system" "harvester-system" "longhorn-system")
121+
for ns in "${namespaces[@]}"; do
122+
pod_statuses=($(kubectl -n "${ns}" get pods \
123+
--field-selector=status.phase!=Succeeded \
124+
-ojsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name},{.status.conditions[?(@.type=="Ready")].status}{"\n"}{end}'))
125+
for status in "${pod_statuses[@]}"; do
126+
name=$(echo "${status}" | cut -d ',' -f1)
127+
ready=$(echo "${status}" | cut -d ',' -f2)
128+
if [ "${ready}" != "True" ]; then
129+
echo "pod ${name} is not ready"
130+
false
131+
return
132+
fi
133+
done
134+
done
135+
}
136+
137+
if cluster_ready; then
138+
echo "cluster is ready"
139+
else
140+
echo "cluster is not ready"
141+
fi
142+
```
143+
144+
- API
145+
```shell
146+
$ curl -fk https://<VIP>/version
147+
```
148+
149+
:::note
150+
151+
You must replace <VIP\> with the [real VIP](../install/management-address.md#how-to-get-the-vip-mac-address), which is the value of `kube-vip.io/requestedIP` in the link.
152+
153+
:::
154+
109155
## Collecting troubleshooting information
110156

111157
Please include the following information in a bug report when reporting a failed installation:

0 commit comments

Comments
 (0)