From c731c094b6aec538759490e54cb53dd8dda5176a Mon Sep 17 00:00:00 2001 From: nakof <12702673+nak0f@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:55:09 +0100 Subject: [PATCH 1/2] configmap-volumes: add support for configMap volumes Signed-off-by: nakof <12702673+nak0f@users.noreply.github.com> --- pkg/volume/volume_types.go | 14 +++++++++++--- pkg/volume/zz_generated.deepcopy.go | 5 +++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pkg/volume/volume_types.go b/pkg/volume/volume_types.go index 05d4bad..5e54655 100644 --- a/pkg/volume/volume_types.go +++ b/pkg/volume/volume_types.go @@ -21,16 +21,18 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -//nolint:unused,deadcode // +docName:"Kubernetes volume abstraction" // Refers to different types of volumes to be mounted to pods: emptyDir, hostPath, pvc // // Leverages core types from kubernetes/api/core/v1 +// +//nolint:unused,deadcode type _docKubernetesVolume interface{} -//nolint:unused,deadcode // +name:"KubernetesVolume" // +description:"Kubernetes volume abstraction" +// +//nolint:unused,deadcode type _metaKubernetesVolume interface{} // +kubebuilder:object:generate=true @@ -43,7 +45,8 @@ type KubernetesVolume struct { SecretSource *corev1.SecretVolumeSource `json:"secret,omitempty"` // PersistentVolumeClaim defines the Spec and the Source at the same time. // The PVC will be created with the configured spec and the name defined in the source. - PersistentVolumeClaim *PersistentVolumeClaim `json:"pvc,omitempty"` + PersistentVolumeClaim *PersistentVolumeClaim `json:"pvc,omitempty"` + ConfigMapSource *corev1.ConfigMapVolumeSource `json:"configMap,omitempty"` } // +kubebuilder:object:generate=true @@ -92,6 +95,11 @@ func (v *KubernetesVolume) GetVolume(name string) (corev1.Volume, error) { Secret: v.SecretSource, } return volume, nil + } else if v.ConfigMapSource != nil { + volume.VolumeSource = corev1.VolumeSource{ + ConfigMap: v.ConfigMapSource, + } + return volume, nil } // return a default emptydir volume if none configured volume.VolumeSource = corev1.VolumeSource{ diff --git a/pkg/volume/zz_generated.deepcopy.go b/pkg/volume/zz_generated.deepcopy.go index 93e6022..036ec36 100644 --- a/pkg/volume/zz_generated.deepcopy.go +++ b/pkg/volume/zz_generated.deepcopy.go @@ -50,6 +50,11 @@ func (in *KubernetesVolume) DeepCopyInto(out *KubernetesVolume) { *out = new(PersistentVolumeClaim) (*in).DeepCopyInto(*out) } + if in.ConfigMapSource != nil { + in, out := &in.ConfigMapSource, &out.ConfigMapSource + *out = new(v1.ConfigMapVolumeSource) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesVolume. From 698d7fc78a7a40b89e4c5113a95ac4a58731a9eb Mon Sep 17 00:00:00 2001 From: nakof <12702673+nak0f@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:56:30 +0100 Subject: [PATCH 2/2] configmap-volumes: add support for configMap volumes Signed-off-by: nakof <12702673+nak0f@users.noreply.github.com> --- docs/overrides/override.md | 293 +++++++++++++++---------------------- docs/types/base_types.md | 92 ++++-------- docs/types/secret_types.md | 14 +- docs/types/volume_types.md | 19 +-- 4 files changed, 160 insertions(+), 258 deletions(-) diff --git a/docs/overrides/override.md b/docs/overrides/override.md index 8525d89..3be8234 100644 --- a/docs/overrides/override.md +++ b/docs/overrides/override.md @@ -5,12 +5,10 @@ ObjectMeta contains only a [subset of the fields included in k8s.io/apimachinery ### annotations (map[string]string, optional) {#objectmeta-annotations} - ### labels (map[string]string, optional) {#objectmeta-labels} - ## Service Service is a subset of [Service in k8s.io/api/apps/v1](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#service-v1-core) for embedding. @@ -18,14 +16,12 @@ Service is a subset of [Service in k8s.io/api/apps/v1](https://kubernetes.io/doc ### metadata (ObjectMeta, optional) {#service-metadata} - ### spec (v1.ServiceSpec, optional) {#service-spec} Kubernetes [Service Specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#servicespec-v1-core) - ## IngressExtensionsV1beta1 IngressExtensionsV1beta1 is a subset of Ingress k8s.io/api/extensions/v1beta1 but is already deprecated @@ -33,12 +29,10 @@ IngressExtensionsV1beta1 is a subset of Ingress k8s.io/api/extensions/v1beta1 bu ### metadata (ObjectMeta, optional) {#ingressextensionsv1beta1-metadata} - ### spec (v1beta1.IngressSpec, optional) {#ingressextensionsv1beta1-spec} - ## IngressNetworkingV1beta1 IngressExtensionsV1beta1 is a subset of [Ingress in k8s.io/api/networking/v1beta1](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#ingress-v1-networking-k8s-io). @@ -46,14 +40,12 @@ IngressExtensionsV1beta1 is a subset of [Ingress in k8s.io/api/networking/v1beta ### metadata (ObjectMeta, optional) {#ingressnetworkingv1beta1-metadata} - ### spec (networkingv1beta1.IngressSpec, optional) {#ingressnetworkingv1beta1-spec} Kubernetes [Ingress Specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#ingressclassspec-v1-networking-k8s-io) - ## DaemonSet DaemonSet is a subset of [DaemonSet in k8s.io/api/apps/v1](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#daemonset-v1-apps), with [DaemonSetSpec replaced by the local variant](#daemonset-spec). @@ -61,48 +53,43 @@ DaemonSet is a subset of [DaemonSet in k8s.io/api/apps/v1](https://kubernetes.io ### metadata (ObjectMeta, optional) {#daemonset-metadata} - ### spec (DaemonSetSpec, optional) {#daemonset-spec} [Local DaemonSet specification](#daemonset-spec) - ## DaemonSetSpec DaemonSetSpec is a subset of [DaemonSetSpec in k8s.io/api/apps/v1](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#daemonsetspec-v1-apps) but with required fields declared as optional and [PodTemplateSpec replaced by the local variant](#podtemplatespec). -### selector (*metav1.LabelSelector, optional) {#daemonsetspec-selector} - -A label query over pods that are managed by the daemon set. - - +### minReadySeconds (int32, optional) {#daemonsetspec-minreadyseconds} -### template (PodTemplateSpec, optional) {#daemonsetspec-template} +The minimum number of seconds for which a newly created DaemonSet 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). -An object that describes the pod that will be created. Note that this is a [local PodTemplateSpec](#podtemplatespec) +Default: 0 +### revisionHistoryLimit (*int32, optional) {#daemonsetspec-revisionhistorylimit} +The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. -### updateStrategy (appsv1.DaemonSetUpdateStrategy, optional) {#daemonsetspec-updatestrategy} +Default: 10 -An update strategy to replace existing DaemonSet pods with new pods. +### selector (*metav1.LabelSelector, optional) {#daemonsetspec-selector} +A label query over pods that are managed by the daemon set. -### minReadySeconds (int32, optional) {#daemonsetspec-minreadyseconds} +### template (PodTemplateSpec, optional) {#daemonsetspec-template} -The minimum number of seconds for which a newly created DaemonSet 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). +An object that describes the pod that will be created. Note that this is a [local PodTemplateSpec](#podtemplatespec) -Default: 0 -### revisionHistoryLimit (*int32, optional) {#daemonsetspec-revisionhistorylimit} +### updateStrategy (appsv1.DaemonSetUpdateStrategy, optional) {#daemonsetspec-updatestrategy} -The number of old history to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. +An update strategy to replace existing DaemonSet pods with new pods. -Default: 10 ## Deployment @@ -112,48 +99,39 @@ Deployment is a subset of [Deployment in k8s.io/api/apps/v1](https://kubernetes. ### metadata (ObjectMeta, optional) {#deployment-metadata} - ### spec (DeploymentSpec, optional) {#deployment-spec} The desired behavior of [this deployment](#deploymentspec). - ## DeploymentSpec DeploymentSpec is a subset of [DeploymentSpec in k8s.io/api/apps/v1](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#deploymentspec-v1-apps) but with required fields declared as optional and [PodTemplateSpec replaced by the local variant](#podtemplatespec). -### replicas (*int32, optional) {#deploymentspec-replicas} - -Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. - -Default: 1 - -### selector (*metav1.LabelSelector, optional) {#deploymentspec-selector} - -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. - - +### minReadySeconds (int32, optional) {#deploymentspec-minreadyseconds} -### template (PodTemplateSpec, optional) {#deploymentspec-template} +Minimum number of seconds for which 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) -An object that describes the pod that will be created. Note that this is a [local PodTemplateSpec](#podtemplatespec) +Default: 0 +### paused (bool, optional) {#deploymentspec-paused} +Indicates that the deployment is paused. -### strategy (appsv1.DeploymentStrategy, optional) {#deploymentspec-strategy} -The deployment strategy to use to replace existing pods with new ones. +patchStrategy=retainKeys +### progressDeadlineSeconds (*int32, optional) {#deploymentspec-progressdeadlineseconds} +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. +Default: 600 -### minReadySeconds (int32, optional) {#deploymentspec-minreadyseconds} +### replicas (*int32, optional) {#deploymentspec-replicas} -Minimum number of seconds for which 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) +Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. -Default: 0 +Default: 1 ### revisionHistoryLimit (*int32, optional) {#deploymentspec-revisionhistorylimit} @@ -161,17 +139,20 @@ The number of old ReplicaSets to retain to allow rollback. This is a pointer to Default: 10 -### paused (bool, optional) {#deploymentspec-paused} +### selector (*metav1.LabelSelector, optional) {#deploymentspec-selector} -Indicates that the deployment is paused. +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 (appsv1.DeploymentStrategy, optional) {#deploymentspec-strategy} -### progressDeadlineSeconds (*int32, optional) {#deploymentspec-progressdeadlineseconds} +The deployment strategy to use to replace existing pods with new ones. +patchStrategy=retainKeys -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. -Default: 600 +### template (PodTemplateSpec, optional) {#deploymentspec-template} + +An object that describes the pod that will be created. Note that this is a [local PodTemplateSpec](#podtemplatespec) + ## StatefulSet @@ -181,39 +162,36 @@ StatefulSet is a subset of [StatefulSet in k8s.io/api/apps/v1](https://kubernete ### metadata (ObjectMeta, optional) {#statefulset-metadata} - ### spec (StatefulSetSpec, optional) {#statefulset-spec} - ## StatefulSetSpec StatefulSetSpec is a subset of [StatefulSetSpec in k8s.io/api/apps/v1](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#statefulsetspec-v1-apps) but with required fields declared as optional and [PodTemplateSpec](#podtemplatespec) and [PersistentVolumeClaim replaced by the local variant](#persistentvolumeclaim). -### replicas (*int32, optional) {#statefulsetspec-replicas} - -Replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1. +optional - -Default: 1 - -### selector (*metav1.LabelSelector, optional) {#statefulsetspec-selector} +### podManagementPolicy (appsv1.PodManagementPolicyType, optional) {#statefulsetspec-podmanagementpolicy} -Selector is a label query over pods that should match the replica count. It must match the pod template's labels. +podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once. +optional +Default: OrderedReady +### replicas (*int32, optional) {#statefulsetspec-replicas} -### template (PodTemplateSpec, optional) {#statefulsetspec-template} +Replicas is the desired number of replicas of the given Template. These are replicas in the sense that they are instantiations of the same Template, but individual replicas also have a consistent identity. If unspecified, defaults to 1. +optional -template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet. +Default: 1 +### revisionHistoryLimit (*int32, optional) {#statefulsetspec-revisionhistorylimit} +revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10. -### volumeClaimTemplates ([]PersistentVolumeClaim, optional) {#statefulsetspec-volumeclaimtemplates} +Default: 10 -volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name. +optional +### selector (*metav1.LabelSelector, optional) {#statefulsetspec-selector} +Selector is a label query over pods that should match the replica count. It must match the pod template's labels. ### serviceName (string, optional) {#statefulsetspec-servicename} @@ -221,24 +199,20 @@ volumeClaimTemplates is a list of claims that pods are allowed to reference. The serviceName is the name of the service that governs this StatefulSet. This service must exist before the StatefulSet, and is responsible for the network identity of the set. Pods get DNS/hostnames that follow the pattern: pod-specific-string.serviceName.default.svc.cluster.local where "pod-specific-string" is managed by the StatefulSet controller. +### template (PodTemplateSpec, optional) {#statefulsetspec-template} -### podManagementPolicy (appsv1.PodManagementPolicyType, optional) {#statefulsetspec-podmanagementpolicy} +template is the object that describes the pod that will be created if insufficient replicas are detected. Each pod stamped out by the StatefulSet will fulfill this Template, but have a unique identity from the rest of the StatefulSet. -podManagementPolicy controls how pods are created during initial scale up, when replacing pods on nodes, or when scaling down. The default policy is `OrderedReady`, where pods are created in increasing order (pod-0, then pod-1, etc) and the controller will wait until each pod is ready before continuing. When scaling down, the pods are removed in the opposite order. The alternative policy is `Parallel` which will create pods in parallel to match the desired scale without waiting, and on scale down will delete all pods at once. +optional - -Default: OrderedReady ### updateStrategy (appsv1.StatefulSetUpdateStrategy, optional) {#statefulsetspec-updatestrategy} updateStrategy indicates the StatefulSetUpdateStrategy that will be employed to update Pods in the StatefulSet when a revision is made to Template. +### volumeClaimTemplates ([]PersistentVolumeClaim, optional) {#statefulsetspec-volumeclaimtemplates} -### revisionHistoryLimit (*int32, optional) {#statefulsetspec-revisionhistorylimit} - -revisionHistoryLimit is the maximum number of revisions that will be maintained in the StatefulSet's revision history. The revision history consists of all revisions not represented by a currently applied StatefulSetSpec version. The default value is 10. +volumeClaimTemplates is a list of claims that pods are allowed to reference. The StatefulSet controller is responsible for mapping network identities to claims in a way that maintains the identity of a pod. Every claim in this list must have at least one matching (by name) volumeMount in one container in the template. A claim in this list takes precedence over any volumes in the template, with the same name. +optional -Default: 10 ## PersistentVolumeClaim @@ -248,29 +222,24 @@ PersistentVolumeClaim is a subset of [PersistentVolumeClaim in k8s.io/api/core/v ### metadata (EmbeddedPersistentVolumeClaimObjectMeta, optional) {#persistentvolumeclaim-metadata} - ### spec (v1.PersistentVolumeClaimSpec, optional) {#persistentvolumeclaim-spec} - ## EmbeddedPersistentVolumeClaimObjectMeta ObjectMeta contains only a subset of the fields included in k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta Only fields which are relevant to embedded PVCs are included controller-gen discards embedded ObjectMetadata type fields, so we have to overcome this. -### name (string, optional) {#embeddedpersistentvolumeclaimobjectmeta-name} - - - ### annotations (map[string]string, optional) {#embeddedpersistentvolumeclaimobjectmeta-annotations} - ### labels (map[string]string, optional) {#embeddedpersistentvolumeclaimobjectmeta-labels} +### name (string, optional) {#embeddedpersistentvolumeclaimobjectmeta-name} + ## PodTemplateSpec @@ -281,26 +250,27 @@ It's the same as [PodTemplateSpec in k8s.io/api/core/v1](https://kubernetes.io/d ### metadata (ObjectMeta, optional) {#podtemplatespec-metadata} - ### spec (PodSpec, optional) {#podtemplatespec-spec} - ## PodSpec PodSpec is a subset of [PodSpec in k8s.io/api/corev1](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#podspec-v1-core). It's the same as the original PodSpec expect it allows for containers to be missing. -### volumes ([]v1.Volume, optional) {#podspec-volumes} +### activeDeadlineSeconds (*int64, optional) {#podspec-activedeadlineseconds} -List of volumes that can be mounted by containers belonging to the pod. +patchMergeKey=name +patchStrategy=merge,retainKeys +Optional duration in seconds the pod may be active on the node relative to +### affinity (*v1.Affinity, optional) {#podspec-affinity} -### initContainers ([]v1.Container, optional) {#podspec-initcontainers} +If specified, the pod's scheduling constraints -List of initialization containers belonging to the pod. +patchMergeKey=name +patchStrategy=merge +### automountServiceAccountToken (*bool, optional) {#podspec-automountserviceaccounttoken} + +AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. ### containers ([]v1.Container, optional) {#podspec-containers} @@ -308,29 +278,9 @@ List of initialization containers belonging to the pod. +patchMergeKey=name +pat List of containers belonging to the pod. +patchMergeKey=name +patchStrategy=merge +### dnsConfig (*v1.PodDNSConfig, optional) {#podspec-dnsconfig} -### ephemeralContainers ([]v1.EphemeralContainer, optional) {#podspec-ephemeralcontainers} - -List of ephemeral containers run in this pod. +patchMergeKey=name +patchStrategy=merge - - - -### restartPolicy (v1.RestartPolicy, optional) {#podspec-restartpolicy} - -Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. - -Default: Always - -### terminationGracePeriodSeconds (*int64, optional) {#podspec-terminationgraceperiodseconds} - -Optional duration in seconds the pod needs to terminate gracefully. Defaults to 30 seconds. - -Default: 30 - -### activeDeadlineSeconds (*int64, optional) {#podspec-activedeadlineseconds} - -Optional duration in seconds the pod may be active on the node relative to - +Specifies the DNS parameters of a pod. ### dnsPolicy (v1.DNSPolicy, optional) {#podspec-dnspolicy} @@ -339,29 +289,27 @@ Set DNS policy for the pod. Defaults to "ClusterFirst". Valid values are 'Clust Default: ClusterFirst -### nodeSelector (map[string]string, optional) {#podspec-nodeselector} - -NodeSelector is a selector which must be true for the pod to fit on a node. - - - -### serviceAccountName (string, optional) {#podspec-serviceaccountname} +### enableServiceLinks (*bool, optional) {#podspec-enableservicelinks} -ServiceAccountName is the name of the ServiceAccount to use to run this pod. +EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true. +Default: true +### ephemeralContainers ([]v1.EphemeralContainer, optional) {#podspec-ephemeralcontainers} -### automountServiceAccountToken (*bool, optional) {#podspec-automountserviceaccounttoken} +List of ephemeral containers run in this pod. +patchMergeKey=name +patchStrategy=merge -AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. +### hostAliases ([]v1.HostAlias, optional) {#podspec-hostaliases} +HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods. +patchMergeKey=ip +patchStrategy=merge -### nodeName (string, optional) {#podspec-nodename} -NodeName is a request to schedule this pod onto a specific node. +### hostIPC (bool, optional) {#podspec-hostipc} +Use the host's ipc namespace. Optional: Default to false. +Default: false ### hostNetwork (bool, optional) {#podspec-hostnetwork} @@ -375,22 +323,9 @@ Use the host's pid namespace. Optional: Default to false. Default: false -### hostIPC (bool, optional) {#podspec-hostipc} - -Use the host's ipc namespace. Optional: Default to false. - -Default: false - -### shareProcessNamespace (*bool, optional) {#podspec-shareprocessnamespace} - -Share a single process namespace between all of the containers in a pod. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false. - -Default: false - -### securityContext (*v1.PodSecurityContext, optional) {#podspec-securitycontext} - -SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field. +### hostname (string, optional) {#podspec-hostname} +Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. ### imagePullSecrets ([]v1.LocalObjectReference, optional) {#podspec-imagepullsecrets} @@ -398,89 +333,99 @@ SecurityContext holds pod-level security attributes and common container setting 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. +patchMergeKey=name +patchStrategy=merge +### initContainers ([]v1.Container, optional) {#podspec-initcontainers} -### hostname (string, optional) {#podspec-hostname} - -Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. +List of initialization containers belonging to the pod. +patchMergeKey=name +patchStrategy=merge +### nodeName (string, optional) {#podspec-nodename} -### subdomain (string, optional) {#podspec-subdomain} +NodeName is a request to schedule this pod onto a specific node. -If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all. +### nodeSelector (map[string]string, optional) {#podspec-nodeselector} +NodeSelector is a selector which must be true for the pod to fit on a node. -### affinity (*v1.Affinity, optional) {#podspec-affinity} -If specified, the pod's scheduling constraints +### overhead (v1.ResourceList, optional) {#podspec-overhead} +Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. -### schedulerName (string, optional) {#podspec-schedulername} +### preemptionPolicy (*v1.PreemptionPolicy, optional) {#podspec-preemptionpolicy} -If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. +PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. +Default: PreemptLowerPriority +### priority (*int32, optional) {#podspec-priority} -### tolerations ([]v1.Toleration, optional) {#podspec-tolerations} +The priority value. Various system components use this field to find the priority of the pod. -If specified, the pod's tolerations. +### priorityClassName (string, optional) {#podspec-priorityclassname} +If specified, indicates the pod's priority. -### hostAliases ([]v1.HostAlias, optional) {#podspec-hostaliases} -HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods. +patchMergeKey=ip +patchStrategy=merge +### readinessGates ([]v1.PodReadinessGate, optional) {#podspec-readinessgates} +If specified, all readiness gates will be evaluated for pod readiness. -### priorityClassName (string, optional) {#podspec-priorityclassname} +### restartPolicy (v1.RestartPolicy, optional) {#podspec-restartpolicy} -If specified, indicates the pod's priority. +Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. +Default: Always +### runtimeClassName (*string, optional) {#podspec-runtimeclassname} -### priority (*int32, optional) {#podspec-priority} +RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. -The priority value. Various system components use this field to find the priority of the pod. +### schedulerName (string, optional) {#podspec-schedulername} +If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. -### dnsConfig (*v1.PodDNSConfig, optional) {#podspec-dnsconfig} -Specifies the DNS parameters of a pod. +### securityContext (*v1.PodSecurityContext, optional) {#podspec-securitycontext} +SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field. -### readinessGates ([]v1.PodReadinessGate, optional) {#podspec-readinessgates} +### serviceAccountName (string, optional) {#podspec-serviceaccountname} -If specified, all readiness gates will be evaluated for pod readiness. +ServiceAccountName is the name of the ServiceAccount to use to run this pod. +### setHostnameAsFQDN (*bool, optional) {#podspec-sethostnameasfqdn} -### runtimeClassName (*string, optional) {#podspec-runtimeclassname} +If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). Default to false. +optional -RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. +Default: false +### shareProcessNamespace (*bool, optional) {#podspec-shareprocessnamespace} +Share a single process namespace between all of the containers in a pod. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false. -### enableServiceLinks (*bool, optional) {#podspec-enableservicelinks} +Default: false -EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true. +### subdomain (string, optional) {#podspec-subdomain} -Default: true +If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all. -### preemptionPolicy (*v1.PreemptionPolicy, optional) {#podspec-preemptionpolicy} -PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. +### terminationGracePeriodSeconds (*int64, optional) {#podspec-terminationgraceperiodseconds} -Default: PreemptLowerPriority +Optional duration in seconds the pod needs to terminate gracefully. Defaults to 30 seconds. -### overhead (v1.ResourceList, optional) {#podspec-overhead} +Default: 30 -Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. +### tolerations ([]v1.Toleration, optional) {#podspec-tolerations} +If specified, the pod's tolerations. ### topologySpreadConstraints ([]v1.TopologySpreadConstraint, optional) {#podspec-topologyspreadconstraints} @@ -488,12 +433,10 @@ Overhead represents the resource overhead associated with running a pod for a gi TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. +patchMergeKey=topologyKey +patchStrategy=merge +listType=map +listMapKey=topologyKey +listMapKey=whenUnsatisfiable +### volumes ([]v1.Volume, optional) {#podspec-volumes} -### setHostnameAsFQDN (*bool, optional) {#podspec-sethostnameasfqdn} +List of volumes that can be mounted by containers belonging to the pod. +patchMergeKey=name +patchStrategy=merge,retainKeys -If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). Default to false. +optional - -Default: false ## ServiceAccount @@ -505,11 +448,9 @@ ServiceAccount is a subset of [ServiceAccount in k8s.io/api/core/v1](https://kub +optional +### automountServiceAccountToken (*bool, optional) {#serviceaccount-automountserviceaccounttoken} -### secrets ([]v1.ObjectReference, optional) {#serviceaccount-secrets} - -+optional +patchMergeKey=name +patchStrategy=merge - ++optional ### imagePullSecrets ([]v1.LocalObjectReference, optional) {#serviceaccount-imagepullsecrets} @@ -517,7 +458,9 @@ ServiceAccount is a subset of [ServiceAccount in k8s.io/api/core/v1](https://kub +optional +### secrets ([]v1.ObjectReference, optional) {#serviceaccount-secrets} + ++optional +patchMergeKey=name +patchStrategy=merge + -### automountServiceAccountToken (*bool, optional) {#serviceaccount-automountserviceaccounttoken} -+optional diff --git a/docs/types/base_types.md b/docs/types/base_types.md index c87f5b0..c6ac3c6 100644 --- a/docs/types/base_types.md +++ b/docs/types/base_types.md @@ -3,12 +3,10 @@ ### name (string, optional) {#objectkey-name} - ### namespace (string, optional) {#objectkey-namespace} - ## EnabledComponent EnabledComponent implements the "enabled component" pattern @@ -19,7 +17,6 @@ NOTE: Don't forget to annotate the embedded field with `json:",inline"` tag for - ## MetaBase Deprecated @@ -28,12 +25,10 @@ Consider using ObjectMeta in the typeoverrides package combined with the merge p ### annotations (map[string]string, optional) {#metabase-annotations} - ### labels (map[string]string, optional) {#metabase-labels} - ## PodTemplateBase Deprecated @@ -42,51 +37,40 @@ Consider using PodTemplateSpec in the typeoverrides package combined with the me ### metadata (*MetaBase, optional) {#podtemplatebase-metadata} - ### spec (*PodSpecBase, optional) {#podtemplatebase-spec} - ## ContainerBase Deprecated Consider using Container in the typeoverrides package combined with the merge package -### name (string, optional) {#containerbase-name} - - - -### resources (*corev1.ResourceRequirements, optional) {#containerbase-resources} - +### command ([]string, optional) {#containerbase-command} ### image (string, optional) {#containerbase-image} +### livenessProbe (*corev1.Probe, optional) {#containerbase-livenessprobe} -### pullPolicy (corev1.PullPolicy, optional) {#containerbase-pullpolicy} +### name (string, optional) {#containerbase-name} -### command ([]string, optional) {#containerbase-command} +### pullPolicy (corev1.PullPolicy, optional) {#containerbase-pullpolicy} +### readinessProbe (*corev1.Probe, optional) {#containerbase-readinessprobe} -### volumeMounts ([]corev1.VolumeMount, optional) {#containerbase-volumemounts} +### resources (*corev1.ResourceRequirements, optional) {#containerbase-resources} ### securityContext (*corev1.SecurityContext, optional) {#containerbase-securitycontext} - -### livenessProbe (*corev1.Probe, optional) {#containerbase-livenessprobe} - - - -### readinessProbe (*corev1.Probe, optional) {#containerbase-readinessprobe} - +### volumeMounts ([]corev1.VolumeMount, optional) {#containerbase-volumemounts} @@ -95,44 +79,34 @@ Consider using Container in the typeoverrides package combined with the merge pa Deprecated Consider using PodSpec in the typeoverrides package combined with the merge package -### tolerations ([]corev1.Toleration, optional) {#podspecbase-tolerations} - - - -### nodeSelector (map[string]string, optional) {#podspecbase-nodeselector} - - - -### serviceAccountName (string, optional) {#podspecbase-serviceaccountname} - - - ### affinity (*corev1.Affinity, optional) {#podspecbase-affinity} - -### securityContext (*corev1.PodSecurityContext, optional) {#podspecbase-securitycontext} +### containers ([]ContainerBase, optional) {#podspecbase-containers} +### imagePullSecrets ([]corev1.LocalObjectReference, optional) {#podspecbase-imagepullsecrets} -### volumes ([]corev1.Volume, optional) {#podspecbase-volumes} +### initContainers ([]ContainerBase, optional) {#podspecbase-initcontainers} -### priorityClassName (string, optional) {#podspecbase-priorityclassname} +### nodeSelector (map[string]string, optional) {#podspecbase-nodeselector} +### priorityClassName (string, optional) {#podspecbase-priorityclassname} -### containers ([]ContainerBase, optional) {#podspecbase-containers} +### securityContext (*corev1.PodSecurityContext, optional) {#podspecbase-securitycontext} -### initContainers ([]ContainerBase, optional) {#podspecbase-initcontainers} +### serviceAccountName (string, optional) {#podspecbase-serviceaccountname} +### tolerations ([]corev1.Toleration, optional) {#podspecbase-tolerations} -### imagePullSecrets ([]corev1.LocalObjectReference, optional) {#podspecbase-imagepullsecrets} +### volumes ([]corev1.Volume, optional) {#podspecbase-volumes} @@ -144,12 +118,10 @@ Consider using Deployment in the typeoverrides package combined with the merge p ### (*MetaBase, required) {#deploymentbase-} - ### spec (*DeploymentSpecBase, optional) {#deploymentbase-spec} - ## DeploymentSpecBase Deprecated @@ -158,20 +130,16 @@ Consider using DeploymentSpec in the typeoverrides package combined with the mer ### replicas (*int32, optional) {#deploymentspecbase-replicas} - ### selector (*metav1.LabelSelector, optional) {#deploymentspecbase-selector} - ### strategy (*appsv1.DeploymentStrategy, optional) {#deploymentspecbase-strategy} - ### template (*PodTemplateBase, optional) {#deploymentspecbase-template} - ## StatefulSetBase Deprecated @@ -180,36 +148,29 @@ Consider using StatefulSet in the typeoverrides package combined with the merge ### (*MetaBase, required) {#statefulsetbase-} - ### spec (*StatefulsetSpecBase, optional) {#statefulsetbase-spec} - ## StatefulsetSpecBase Deprecated Consider using StatefulSetSpec in the typeoverrides package combined with the merge package -### replicas (*int32, optional) {#statefulsetspecbase-replicas} - - - -### selector (*metav1.LabelSelector, optional) {#statefulsetspecbase-selector} - - - ### podManagementPolicy (appsv1.PodManagementPolicyType, optional) {#statefulsetspecbase-podmanagementpolicy} +### replicas (*int32, optional) {#statefulsetspecbase-replicas} -### updateStrategy (*appsv1.StatefulSetUpdateStrategy, optional) {#statefulsetspecbase-updatestrategy} +### selector (*metav1.LabelSelector, optional) {#statefulsetspecbase-selector} ### template (*PodTemplateBase, optional) {#statefulsetspecbase-template} +### updateStrategy (*appsv1.StatefulSetUpdateStrategy, optional) {#statefulsetspecbase-updatestrategy} + ## DaemonSetBase @@ -220,31 +181,28 @@ Consider using DaemonSet in the typeoverrides package combined with the merge pa ### (*MetaBase, required) {#daemonsetbase-} - ### spec (*DaemonSetSpecBase, optional) {#daemonsetbase-spec} - ## DaemonSetSpecBase Deprecated Consider using DaemonSetSpec in the typeoverrides package combined with the merge package -### selector (*metav1.LabelSelector, optional) {#daemonsetspecbase-selector} +### minReadySeconds (int32, optional) {#daemonsetspecbase-minreadyseconds} +### revisionHistoryLimit (*int32, optional) {#daemonsetspecbase-revisionhistorylimit} -### updateStrategy (*appsv1.DaemonSetUpdateStrategy, optional) {#daemonsetspecbase-updatestrategy} +### selector (*metav1.LabelSelector, optional) {#daemonsetspecbase-selector} -### minReadySeconds (int32, optional) {#daemonsetspecbase-minreadyseconds} - +### template (*PodTemplateBase, optional) {#daemonsetspecbase-template} -### revisionHistoryLimit (*int32, optional) {#daemonsetspecbase-revisionhistorylimit} +### updateStrategy (*appsv1.DaemonSetUpdateStrategy, optional) {#daemonsetspecbase-updatestrategy} -### template (*PodTemplateBase, optional) {#daemonsetspecbase-template} diff --git a/docs/types/secret_types.md b/docs/types/secret_types.md index 148986a..c969803 100644 --- a/docs/types/secret_types.md +++ b/docs/types/secret_types.md @@ -7,25 +7,25 @@ ## Configuration ## Secret +### mountFrom (*ValueFrom, optional) {#secret-mountfrom} + +Refers to a secret value to be used through a volume mount + + ### value (string, optional) {#secret-value} Refers to a non-secret value - ### valueFrom (*ValueFrom, optional) {#secret-valuefrom} Refers to a secret value to be used directly -### mountFrom (*ValueFrom, optional) {#secret-mountfrom} - -Refers to a secret value to be used through a volume mount - +## ValueFrom +### secretKeyRef (*corev1.SecretKeySelector, optional) {#valuefrom-secretkeyref} -## ValueFrom -### secretKeyRef (*corev1.SecretKeySelector, optional) {#valuefrom-secretkeyref} diff --git a/docs/types/volume_types.md b/docs/types/volume_types.md index ffbc567..a2defbc 100644 --- a/docs/types/volume_types.md +++ b/docs/types/volume_types.md @@ -4,25 +4,22 @@ Leverages core types from kubernetes/api/core/v1 + ## Configuration ## KubernetesVolume -### host_path (*corev1.HostPathVolumeSource, optional) {#kubernetesvolume-host_path} +### configMap (*corev1.ConfigMapVolumeSource, optional) {#kubernetesvolume-configmap} -Deprecated, use hostPath +### emptyDir (*corev1.EmptyDirVolumeSource, optional) {#kubernetesvolume-emptydir} ### hostPath (*corev1.HostPathVolumeSource, optional) {#kubernetesvolume-hostpath} +### host_path (*corev1.HostPathVolumeSource, optional) {#kubernetesvolume-host_path} -### emptyDir (*corev1.EmptyDirVolumeSource, optional) {#kubernetesvolume-emptydir} - - - -### secret (*corev1.SecretVolumeSource, optional) {#kubernetesvolume-secret} - +Deprecated, use hostPath ### pvc (*PersistentVolumeClaim, optional) {#kubernetesvolume-pvc} @@ -30,6 +27,8 @@ Deprecated, use hostPath PersistentVolumeClaim defines the Spec and the Source at the same time. The PVC will be created with the configured spec and the name defined in the source. +### secret (*corev1.SecretVolumeSource, optional) {#kubernetesvolume-secret} + ## PersistentVolumeClaim @@ -37,5 +36,7 @@ PersistentVolumeClaim defines the Spec and the Source at the same time. The PVC ### spec (corev1.PersistentVolumeClaimSpec, optional) {#persistentvolumeclaim-spec} - ### source (corev1.PersistentVolumeClaimVolumeSource, optional) {#persistentvolumeclaim-source} + + +