kubernetes 删除资源对象策略分析

本文分析的是kubernetes 删除资源对象的策略
具体源码在$GOPATH/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go文件中
type code
策略
de

DeleteOptions 结构体属性如下

type DeletionPropagation string

const (
   // Orphans the dependents.
   DeletePropagationOrphan DeletionPropagation = "Orphan"
   // Deletes the object from the key-value store, the garbage collector will
   // delete the dependents in the background.
   DeletePropagationBackground DeletionPropagation = "Background"
   // The object exists in the key-value store until the garbage collector
   // deletes all the dependents whose ownerReference.blockOwnerDeletion=true
   // from the key-value store.  API sever will put the "foregroundDeletion"
   // finalizer on the object, and sets its deletionTimestamp.  This policy is
   // cascading, i.e., the dependents will be deleted with Foreground.
   DeletePropagationForeground DeletionPropagation = "Foreground"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// DeleteOptions may be provided when deleting an API object.
type DeleteOptions struct {
   TypeMeta `json:",inline"`

   // The duration in seconds before the object should be deleted. Value must be non-negative integer.
   // The value zero indicates delete immediately. If this value is nil, the default grace period for the
   // specified type will be used.
   // Defaults to a per object value if not specified. zero means delete immediately.
   // +optional
   GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty" protobuf:"varint,1,opt,name=gracePeriodSeconds"`

   // Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be
   // returned.
   // +optional
   Preconditions *Preconditions `json:"preconditions,omitempty" protobuf:"bytes,2,opt,name=preconditions"`

   // Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7.
   // Should the dependent objects be orphaned. If true/false, the "
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值