Documentation
¶
Index ¶
- func MutatePod(r Mutate, obj *corev1.PodTemplateSpec) error
- type Mutate
- type Pod
- func (in *Pod) DeepCopy() *Pod
- func (in *Pod) DeepCopyInto(out *Pod)
- func (spec *Pod) GetContainers() []container.Mutate
- func (spec *Pod) GetInitContainers() []container.Mutate
- func (o *Pod) GetObjectGroup() string
- func (o *Pod) GetObjectKind() string
- func (obj *Pod) Init()
- func (o *Pod) Mutate(obj interfaces.Object) error
- type PodSpec
- func (in *PodSpec) DeepCopy() *PodSpec
- func (in *PodSpec) DeepCopyInto(out *PodSpec)
- func (r *PodSpec) GetPodAffinity() *corev1.Affinity
- func (r *PodSpec) GetPodNodeSelector() map[string]string
- func (r *PodSpec) GetPodRestartPolicy() corev1.RestartPolicy
- func (r *PodSpec) GetPodSecurityContext() *corev1.PodSecurityContext
- func (r *PodSpec) GetPodTolerations() []corev1.Toleration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mutate ¶
type Mutate interface { GetPodSecurityContext() *corev1.PodSecurityContext GetPodVolumes() []corev1.Volume GetPodRestartPolicy() corev1.RestartPolicy GetPodNodeSelector() map[string]string GetPodAffinity() *corev1.Affinity GetPodTolerations() []corev1.Toleration GetContainers() []container.Mutate container.Mutate }
type Pod ¶
type Pod struct { *meta.ObjectMeta `json:"meta,omitempty"` *PodSpec `json:",inline"` }
+kubebuilder:object:generate=true
func (*Pod) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pod.
func (*Pod) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Pod) GetContainers ¶
func (*Pod) GetInitContainers ¶
func (*Pod) GetObjectGroup ¶
func (*Pod) GetObjectKind ¶
type PodSpec ¶
type PodSpec struct { Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"` // SecurityContext holds pod-level security attributes and common container settings. // Optional: Defaults to empty. See type description for default values of each field. // +optional SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty" protobuf:"bytes,14,opt,name=securityContext"` // If specified, the pod's scheduling constraints // +optional Affinity *corev1.Affinity `json:"affinity,omitempty"` // Restart policy for all containers within the pod. // One of Always, OnFailure, Never. // Default to Always. // More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy // +optional RestartPolicy corev1.RestartPolicy `json:"restartPolicy,omitempty"` // If specified, the pod's tolerations. // +optional Tolerations []corev1.Toleration `json:"tolerations,omitempty"` // NodeSelector is a selector which must be true for the pod to fit on a node. // Selector which must match a node's labels for the pod to be scheduled on that node. // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ // +optional NodeSelector map[string]string `json:"nodeSelector,omitempty"` container.Container `json:",inline"` // List of containers belonging to the pod. // Containers cannot currently be added or removed. // There must be at least one container in a Pod. // Cannot be updated. // +patchMergeKey=name // +patchStrategy=merge ExtraContainers []container.Container `json:"extraContainers,omitempty"` // List of initialization containers belonging to the pod. // Init containers are executed in order prior to containers being started. If any // init container fails, the pod is considered to have failed and is handled according // to its restartPolicy. The name for an init container or normal container must be // unique among all containers. // Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. // The resourceRequirements of an init container are taken into account during scheduling // by finding the highest request/limit for each resource type, and then using the max of // of that value or the sum of the normal containers. Limits are applied to init containers // in a similar fashion. // Init containers cannot currently be added or removed. // Cannot be updated. // More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ // +patchMergeKey=name // +patchStrategy=merge InitContainers []container.Container `json:"initContainers,omitempty"` // ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. // If specified, these secrets will be passed to individual puller implementations for them to use. For example, // in the case of docker, only DockerConfig type secrets are honored. // More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod // +optional // +patchMergeKey=name // +patchStrategy=merge ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` }
PodSpec is the specification of the desired behavior of the Pod. It is a stripped down version of https://godoc.org/k8s.io/api/core/v1#PodSpec with only user definied specs
Here we consider that a pod has a main container that is embedded in the PodSpec definition ¶
Extra and init containers can also be definied ¶
This is similar to the container / sidecar container pattern
+kubebuilder:object:generate=true
func (*PodSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSpec.
func (*PodSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PodSpec) GetPodAffinity ¶
func (*PodSpec) GetPodNodeSelector ¶
func (*PodSpec) GetPodRestartPolicy ¶
func (r *PodSpec) GetPodRestartPolicy() corev1.RestartPolicy
func (*PodSpec) GetPodSecurityContext ¶
func (r *PodSpec) GetPodSecurityContext() *corev1.PodSecurityContext
func (*PodSpec) GetPodTolerations ¶
func (r *PodSpec) GetPodTolerations() []corev1.Toleration