我使用io.fabric8.kubernetes-client,版本3.1.8来创建或替换kubernetes资源。可以创建或替换部署。但是当我替换StatefulSet时遇到异常。但是如果我使用'kubectl apply -f pro-rabbitmq.yaml'
就可以了执行失败:PUT位于:https://kubernetes.default.svc/apis/apps/v1beta1/namespaces/itsma1/statefulsets/pro-rabbitmq。消息:StatefulSet.apps“pro-rabbitmq”无效:spec:Forbidden:禁止对'replicas','template'和'updateStrategy'以外的字段更新statefulset规范。收到状态:状态(apiVersion = v1, code = 422,details = StatusDetails(cause = [StatusCause(field = spec,message = Forbidden:禁止对'replicas','template'和'updateStrategy'以外的字段更新statefulset规范。,reason = FieldValueForbidden,additionalProperties = {})],group = apps,kind = StatefulSet,name = pro-rabbitmq,retryAfterSeconds = null,uid = null,additionalProperties = {}),kind = Status,message = StatefulSet.apps“pro-rabbitmq”无效:spec:Forbidden:禁止对'replicas','template'和'updateStrategy'以外的字段更新statefulset规范。,metadata = ListMeta(resourceVersion = null,selfLink = null,additionalProperties = {}),reason = Invalid ,status = Failure,additionalProperties = {})。