@@ -2980,6 +2980,78 @@ type LifecycleHandler struct {
2980
2980
Sleep * SleepAction `json:"sleep,omitempty" protobuf:"bytes,4,opt,name=sleep"`
2981
2981
}
2982
2982
2983
+ // Signal defines the stop signal of containers
2984
+ // +enum
2985
+ type Signal string
2986
+
2987
+ const (
2988
+ SIGABRT Signal = "SIGABRT"
2989
+ SIGALRM Signal = "SIGALRM"
2990
+ SIGBUS Signal = "SIGBUS"
2991
+ SIGCHLD Signal = "SIGCHLD"
2992
+ SIGCLD Signal = "SIGCLD"
2993
+ SIGCONT Signal = "SIGCONT"
2994
+ SIGFPE Signal = "SIGFPE"
2995
+ SIGHUP Signal = "SIGHUP"
2996
+ SIGILL Signal = "SIGILL"
2997
+ SIGINT Signal = "SIGINT"
2998
+ SIGIO Signal = "SIGIO"
2999
+ SIGIOT Signal = "SIGIOT"
3000
+ SIGKILL Signal = "SIGKILL"
3001
+ SIGPIPE Signal = "SIGPIPE"
3002
+ SIGPOLL Signal = "SIGPOLL"
3003
+ SIGPROF Signal = "SIGPROF"
3004
+ SIGPWR Signal = "SIGPWR"
3005
+ SIGQUIT Signal = "SIGQUIT"
3006
+ SIGSEGV Signal = "SIGSEGV"
3007
+ SIGSTKFLT Signal = "SIGSTKFLT"
3008
+ SIGSTOP Signal = "SIGSTOP"
3009
+ SIGSYS Signal = "SIGSYS"
3010
+ SIGTERM Signal = "SIGTERM"
3011
+ SIGTRAP Signal = "SIGTRAP"
3012
+ SIGTSTP Signal = "SIGTSTP"
3013
+ SIGTTIN Signal = "SIGTTIN"
3014
+ SIGTTOU Signal = "SIGTTOU"
3015
+ SIGURG Signal = "SIGURG"
3016
+ SIGUSR1 Signal = "SIGUSR1"
3017
+ SIGUSR2 Signal = "SIGUSR2"
3018
+ SIGVTALRM Signal = "SIGVTALRM"
3019
+ SIGWINCH Signal = "SIGWINCH"
3020
+ SIGXCPU Signal = "SIGXCPU"
3021
+ SIGXFSZ Signal = "SIGXFSZ"
3022
+ SIGRTMIN Signal = "SIGRTMIN"
3023
+ SIGRTMINPLUS1 Signal = "SIGRTMIN+1"
3024
+ SIGRTMINPLUS2 Signal = "SIGRTMIN+2"
3025
+ SIGRTMINPLUS3 Signal = "SIGRTMIN+3"
3026
+ SIGRTMINPLUS4 Signal = "SIGRTMIN+4"
3027
+ SIGRTMINPLUS5 Signal = "SIGRTMIN+5"
3028
+ SIGRTMINPLUS6 Signal = "SIGRTMIN+6"
3029
+ SIGRTMINPLUS7 Signal = "SIGRTMIN+7"
3030
+ SIGRTMINPLUS8 Signal = "SIGRTMIN+8"
3031
+ SIGRTMINPLUS9 Signal = "SIGRTMIN+9"
3032
+ SIGRTMINPLUS10 Signal = "SIGRTMIN+10"
3033
+ SIGRTMINPLUS11 Signal = "SIGRTMIN+11"
3034
+ SIGRTMINPLUS12 Signal = "SIGRTMIN+12"
3035
+ SIGRTMINPLUS13 Signal = "SIGRTMIN+13"
3036
+ SIGRTMINPLUS14 Signal = "SIGRTMIN+14"
3037
+ SIGRTMINPLUS15 Signal = "SIGRTMIN+15"
3038
+ SIGRTMAXMINUS14 Signal = "SIGRTMAX-14"
3039
+ SIGRTMAXMINUS13 Signal = "SIGRTMAX-13"
3040
+ SIGRTMAXMINUS12 Signal = "SIGRTMAX-12"
3041
+ SIGRTMAXMINUS11 Signal = "SIGRTMAX-11"
3042
+ SIGRTMAXMINUS10 Signal = "SIGRTMAX-10"
3043
+ SIGRTMAXMINUS9 Signal = "SIGRTMAX-9"
3044
+ SIGRTMAXMINUS8 Signal = "SIGRTMAX-8"
3045
+ SIGRTMAXMINUS7 Signal = "SIGRTMAX-7"
3046
+ SIGRTMAXMINUS6 Signal = "SIGRTMAX-6"
3047
+ SIGRTMAXMINUS5 Signal = "SIGRTMAX-5"
3048
+ SIGRTMAXMINUS4 Signal = "SIGRTMAX-4"
3049
+ SIGRTMAXMINUS3 Signal = "SIGRTMAX-3"
3050
+ SIGRTMAXMINUS2 Signal = "SIGRTMAX-2"
3051
+ SIGRTMAXMINUS1 Signal = "SIGRTMAX-1"
3052
+ SIGRTMAX Signal = "SIGRTMAX"
3053
+ )
3054
+
2983
3055
// Lifecycle describes actions that the management system should take in response to container lifecycle
2984
3056
// events. For the PostStart and PreStop lifecycle handlers, management of the container blocks
2985
3057
// until the action is complete, unless the container process fails, in which case the handler is aborted.
@@ -3001,6 +3073,11 @@ type Lifecycle struct {
3001
3073
// More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
3002
3074
// +optional
3003
3075
PreStop * LifecycleHandler `json:"preStop,omitempty" protobuf:"bytes,2,opt,name=preStop"`
3076
+ // StopSignal defines which signal will be sent to a container when it is being stopped.
3077
+ // If not specified, the default is defined by the container runtime in use.
3078
+ // StopSignal can only be set for Pods with a non-empty .spec.os.name
3079
+ // +optional
3080
+ StopSignal * Signal `json:"stopSignal,omitempty" protobuf:"bytes,3,opt,name=stopSignal"`
3004
3081
}
3005
3082
3006
3083
type ConditionStatus string
@@ -3154,6 +3231,10 @@ type ContainerStatus struct {
3154
3231
// +listType=map
3155
3232
// +listMapKey=name
3156
3233
AllocatedResourcesStatus []ResourceStatus `json:"allocatedResourcesStatus,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,14,rep,name=allocatedResourcesStatus"`
3234
+ // StopSignal reports the effective stop signal for this container
3235
+ // +featureGate=ContainerStopSignals
3236
+ // +optional
3237
+ StopSignal * Signal `json:"stopSignal,omitempty" protobuf:"bytes,15,opt,name=stopSignal"`
3157
3238
}
3158
3239
3159
3240
// ResourceStatus represents the status of a single resource allocated to a Pod.
0 commit comments