diff --git a/.changelog/1997.txt b/.changelog/1997.txt new file mode 100644 index 0000000000..69c830909f --- /dev/null +++ b/.changelog/1997.txt @@ -0,0 +1,7 @@ +```release-note:doc +`resource/kubernetes_job`: Add documentation for the attribute `spec.completion_mode`. +``` + +```release-note:doc +`resource/kubernetes_job_v1`: Add documentation for the attribute `spec.completion_mode`. +``` diff --git a/kubernetes/schema_job_spec.go b/kubernetes/schema_job_spec.go index 2acee6a774..0f52723ea9 100644 --- a/kubernetes/schema_job_spec.go +++ b/kubernetes/schema_job_spec.go @@ -71,7 +71,7 @@ func jobSpecFields(specUpdatable bool) map[string]*schema.Schema { string(batchv1.IndexedCompletion), string(batchv1.NonIndexedCompletion), }, false), - Description: "CompletionMode specifies how Pod completions are tracked.", + Description: "Specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. For more information: https://kubernetes.io/docs/concepts/workloads/controllers/job/#completion-mode", }, "manual_selector": { Type: schema.TypeBool, diff --git a/website/docs/r/job.html.markdown b/website/docs/r/job.html.markdown index f651ef498c..0aa029645c 100644 --- a/website/docs/r/job.html.markdown +++ b/website/docs/r/job.html.markdown @@ -108,6 +108,7 @@ The following arguments are supported: * `active_deadline_seconds` - (Optional) Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer. * `backoff_limit` - (Optional) Specifies the number of retries before marking this job failed. Defaults to 6 * `completions` - (Optional) Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ +* `completion_mode` - (Optional) Specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/job/#completion-mode). * `manual_selector` - (Optional) Controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector * `parallelism` - (Optional) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when `((.spec.completions - .status.successful) < .spec.parallelism)`, i.e. when the work left to do is less than max parallelism. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ * `selector` - (Optional) A label query over pods that should match the pod count. Normally, the system sets this field for you. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors diff --git a/website/docs/r/job_v1.html.markdown b/website/docs/r/job_v1.html.markdown index 11e29cdc52..89125479a0 100644 --- a/website/docs/r/job_v1.html.markdown +++ b/website/docs/r/job_v1.html.markdown @@ -108,6 +108,7 @@ The following arguments are supported: * `active_deadline_seconds` - (Optional) Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer. * `backoff_limit` - (Optional) Specifies the number of retries before marking this job failed. Defaults to 6 * `completions` - (Optional) Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ +* `completion_mode` - (Optional) Specifies how Pod completions are tracked. It can be `NonIndexed` (default) or `Indexed`. For more info see [Kubernetes reference](https://kubernetes.io/docs/concepts/workloads/controllers/job/#completion-mode). * `manual_selector` - (Optional) Controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector * `parallelism` - (Optional) Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when `((.spec.completions - .status.successful) < .spec.parallelism)`, i.e. when the work left to do is less than max parallelism. For more info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ * `selector` - (Optional) A label query over pods that should match the pod count. Normally, the system sets this field for you. For more info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors