DESCRIPTION: Deployment enables declarative updates for Pods and ReplicaSets.
FIELDS: apiVersion <string> APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kind <string> Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadata <Object> Standard object metadata.
spec <Object> Specification of the desired behavior of the Deployment.
status <Object> Most recently observed status of the Deployment.
metadata
用于唯一标识Kubernetes集群中的资源,可以为资源命名、分配标签、注解和指定命名空间等。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
$ kubectl explain deployment.metadata | more KIND: Deployment VERSION: apps/v1
RESOURCE: metadata <Object>
DESCRIPTION: Standard object metadata. ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
FIELDS: annotations <map[string]string> Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations ...
~ kubectl explain deployment.spec | more KIND: Deployment VERSION: apps/v1
RESOURCE: spec <Object>
DESCRIPTION: Specification of the desired behavior of the Deployment.
DeploymentSpec is the specification of the desired behavior of the Deployment.
FIELDS: minReadySeconds <integer> Minimum number of seconds forwhich a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)
paused <boolean> Indicates that the deployment is paused.
progressDeadlineSeconds <integer> The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s.
replicas <integer> Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.
revisionHistoryLimit <integer> The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.
selector <Object> -required- Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels. strategy <Object> The deployment strategy to use to replace existin
DESCRIPTION: Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.
FIELDS: exec <Object> command <[]string> failureThreshold <integer> httpGet <Object> host <string> httpHeaders <[]Object> name <string> value <string> path <string> port <string> scheme <string> initialDelaySeconds <integer> periodSeconds <integer> successThreshold <integer> tcpSocket <Object> host <string> port <string> timeoutSeconds <integer>
DESCRIPTION: Actions that the management system should take in response to container lifecycle events. Cannot be updated.
Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, inwhichcase the handler is aborted.
FIELDS: postStart <Object> PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
preStop <Object> PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod's termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks