-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hello Kiwis,
I ran into an issue using the plugin to apply a StatefulSet with the UpdateStrategy "OnDelete":
Error: >>> docker exec k3s-maven-plugin kubectl rollout status statefulset postgres --namespace=provider --timeout=1000s (timeout: PT16M50S)
Error: [ERROR] <<< error: rollout status is only available for RollingUpdate strategy type
In this specific case the StatefulSet is created by the Postgres Operator which handles the updates itself, therefor changing the updateStrategy is not an option.
My proposal would be to check the status of the sts if the readyReplicas are the same as the replicas field. Something like:
kubectl get sts -nsomeNamespace someSts -o jsonpath={.status.readyReplicas}
and
kubectl get sts -nsomeNamespace someSts -o jsonpath={.status.replicas}
If you dont see any issues and are fine with the approach, I can provide a PR
How to reproduce:
Use plugin to apply following manifest:
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: nginx
spec:
serviceName: "nginx"
replicas: 1
selector:
matchLabels:
app: nginx
updateStrategy:
type: OnDelete
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.27
ports:
- containerPort: 80