Open llhuii opened 3 years ago
技术:
Pod更新限制: 只能更新以下pod字段, 见https://code.k8s.io/pkg/apis/core/validation/validation.go#L4050
spec.activeDeadlineSeconds
// ValidatePodUpdate tests to see if the update is legal for an end user to make. newPod is updated with fields
// that cannot be changed.
func ValidatePodUpdate(newPod, oldPod *core.Pod, opts PodValidationOptions) field.ErrorList {
fldPath := field.NewPath("metadata")
allErrs := ValidateObjectMetaUpdate(&newPod.ObjectMeta, &oldPod.ObjectMeta, fldPath)
allErrs = append(allErrs, validatePodMetadataAndSpec(newPod, opts)...)
allErrs = append(allErrs, ValidatePodSpecificAnnotationUpdates(newPod, oldPod, fldPath.Child("annotations"), opts)...)
specPath := field.NewPath("spec")
// validate updateable fields:
// 1. spec.containers[*].image
// 2. spec.initContainers[*].image
// 3. spec.activeDeadlineSeconds
// 4. spec.terminationGracePeriodSeconds
status:
containerStatuses:
- name: bash
image: bash:latest
imageID: docker-pullable://nginx@sha256:xxxxx
spec:
readinessGates:
- conditionType: MyDemo
status:
conditions:
- type: MyDemo
status: "True"
待整理:
原地升级的好处:
https://developer.aliyun.com/article/765421
https://www.infoq.cn/article/gifpiyxpvrbmzrxmofpk