Skip to content

Commit 6738aa4

Browse files
committed
doc(upgrade): delete fluentd pod to avoid waiting backoff time
Signed-off-by: Zespre Chang <[email protected]>
1 parent cd3dc9f commit 6738aa4

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

docs/upgrade/v1-4-2-to-v1-5-0.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,26 +84,33 @@ To fix the issue, perform any of the following actions:
8484

8585
```bash
8686
# Get the Logging CR names
87-
OPERATOR_LOGGING_NAME=$(kubectl get logging -l app.kubernetes.io/name=rancher-logging -o jsonpath="{.items[0].metadata.name}")
88-
INFRA_LOGGING_NAME=$(kubectl get logging -l harvesterhci.io/upgradeLogComponent=infra -o jsonpath="{.items[0].metadata.name}")
87+
OPERATOR_LOGGING_NAME=$(kubectl get loggings -l app.kubernetes.io/name=rancher-logging -o jsonpath="{.items[0].metadata.name}")
88+
INFRA_LOGGING_NAME=$(kubectl get loggings -l harvesterhci.io/upgradeLogComponent=infra -o jsonpath="{.items[0].metadata.name}")
8989

9090
# Gather image info from operator's Logging CR
91-
FLUENTD_IMAGE_REPO=$(kubectl get logging $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentd.image.repository}")
92-
FLUENTD_IMAGE_TAG=$(kubectl get logging $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentd.image.tag}")
91+
FLUENTD_IMAGE_REPO=$(kubectl get loggings $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentd.image.repository}")
92+
FLUENTD_IMAGE_TAG=$(kubectl get loggings $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentd.image.tag}")
9393

94-
FLUENTBIT_IMAGE_REPO=$(kubectl get logging $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentbit.image.repository}")
95-
FLUENTBIT_IMAGE_TAG=$(kubectl get logging $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentbit.image.tag}")
94+
FLUENTBIT_IMAGE_REPO=$(kubectl get loggings $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentbit.image.repository}")
95+
FLUENTBIT_IMAGE_TAG=$(kubectl get loggings $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentbit.image.tag}")
9696

97-
CONFIG_RELOADER_IMAGE_REPO=$(kubectl get logging $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentd.configReloaderImage.repository}")
98-
CONFIG_RELOADER_IMAGE_TAG=$(kubectl get logging $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentd.configReloaderImage.tag}")
97+
CONFIG_RELOADER_IMAGE_REPO=$(kubectl get loggings $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentd.configReloaderImage.repository}")
98+
CONFIG_RELOADER_IMAGE_TAG=$(kubectl get loggings $OPERATOR_LOGGING_NAME -o jsonpath="{.spec.fluentd.configReloaderImage.tag}")
9999

100100
# Patch the Logging CR
101101
kubectl patch logging $INFRA_LOGGING_NAME --type=json -p="[{\"op\":\"replace\",\"path\":\"/spec/fluentbit/image\",\"value\":{\"repository\":\"$FLUENTBIT_IMAGE_REPO\",\"tag\":\"$FLUENTBIT_IMAGE_TAG\"}}]"
102102
kubectl patch logging $INFRA_LOGGING_NAME --type=json -p="[{\"op\":\"replace\",\"path\":\"/spec/fluentd/image\",\"value\":{\"repository\":\"$FLUENTD_IMAGE_REPO\",\"tag\":\"$FLUENTD_IMAGE_TAG\"}}]"
103103
kubectl patch logging $INFRA_LOGGING_NAME --type=json -p="[{\"op\":\"replace\",\"path\":\"/spec/fluentd/configReloaderImage\",\"value\":{\"repository\":\"$CONFIG_RELOADER_IMAGE_REPO\",\"tag\":\"$CONFIG_RELOADER_IMAGE_TAG\"}}]"
104104
```
105105

106-
The status of the Fluentd and Fluent Bit pods should change to `Running` and the upgrade process should continue after the Logging CR is updated.
106+
The status of the Fluentd and Fluent Bit pods should change to `Running` in a moment and the upgrade process should continue after the Logging CR is updated. If the Fluentd pod is still in the `ImagePullBackOff` status, try deleting it with the following command to force it to restart:
107+
108+
```bash
109+
UPGRADE_NAME=$(kubectl -n harvester-system get upgrades -l harvesterhci.io/latestUpgrade=true -o jsonpath='{.items[0].metadata.name}')
110+
UPGRADELOG_NAME=$(kubectl -n harvester-system get upgradelogs -l harvesterhci.io/upgrade=$UPGRADE_NAME -o jsonpath='{.items[0].metadata.name}')
111+
112+
kubectl -n harvester-system delete pods -l harvesterhci.io/upgradeLog=$UPGRADELOG_NAME,harvesterhci.io/upgradeLogComponent=aggregator
113+
```
107114

108115
- On a computer with internet access, pull the required container images and then export them to a TAR file. Next, transfer the TAR file to the cluster nodes and then import the images by running the following comands on each node:
109116

0 commit comments

Comments
 (0)