adding pvc template to statefulset

This commit is contained in:
Nancy Butler 2020-09-16 15:54:32 -07:00
parent 2cfc90ca63
commit bc5bec82b0
3 changed files with 79 additions and 41 deletions

View File

@ -1317,9 +1317,13 @@ workload:
parallelism: parallelism:
label: Parallelism label: Parallelism
tip: The maximum number of pods the job should run at any given time. tip: The maximum number of pods the job should run at any given time.
startingDeadlineSeconds:
label: Starting Deadline Seconds
tip: The deadline in seconds for starting the job if it misses scheduled time
successfulJobsHistoryLimit: successfulJobsHistoryLimit:
label: Successful Job History Limit label: Successful Job History Limit
tip: The number of successful finished jobs to retain. tip: The number of successful finished jobs to retain.
suspend: Suspend
networking: networking:
dnsPolicy: dnsPolicy:
label: DNS Policy label: DNS Policy
@ -1489,7 +1493,6 @@ workload:
title: 'Storage' title: 'Storage'
volumeName: Volume Name volumeName: Volume Name
volumePath: Volume Path volumePath: Volume Path
typeDescriptions: typeDescriptions:
apps.daemonset: <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" target="_blank" rel="noopener nofollow" >DaemonSets</a> run exactly one pod on every eligible node. When new nodes are added to the cluster, DaemonSets automatically deploy to them. Recommended for system-wide or vertically-scalable workloads that never need more than one pod per node. apps.daemonset: <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/" target="_blank" rel="noopener nofollow" >DaemonSets</a> run exactly one pod on every eligible node. When new nodes are added to the cluster, DaemonSets automatically deploy to them. Recommended for system-wide or vertically-scalable workloads that never need more than one pod per node.
apps.deployment: '<a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" target="_blank" rel="noopener nofollow" >Deployments</a> run a scalable number of replicas of a pod distributed among the eligible nodes. Changes are rolled out incrementally and can be rolled back to the previous revision when needed. Recommended for stateless & horizontally-scalable workloads.' apps.deployment: '<a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" target="_blank" rel="noopener nofollow" >Deployments</a> run a scalable number of replicas of a pod distributed among the eligible nodes. Changes are rolled out incrementally and can be rolled back to the previous revision when needed. Recommended for stateless & horizontally-scalable workloads.'
@ -1500,6 +1503,12 @@ workload:
activeDeadlineSeconds: activeDeadlineSeconds:
label: Pod Active Deadline label: Pod Active Deadline
tip: The duration the pod may be active before the system will try to mark it failed and kill associated containers. tip: The duration the pod may be active before the system will try to mark it failed and kill associated containers.
concurrencyPolicy:
label: Concurrency
options:
allow: Allow CronJobs to run concurrently
forbid: Skip next run if current run hasn't finished
replace: Replace run if current run hasn't finished
maxSurge: maxSurge:
label: Max Surge label: Max Surge
tip: The maximum number of pods allowed beyond the desired scale at any given time. tip: The maximum number of pods allowed beyond the desired scale at any given time.

View File

@ -29,19 +29,20 @@ export default {
}, },
data() { data() {
const { const {
failedJobsHistoryLimit, successfulJobsHistoryLimit, suspend, schedule failedJobsHistoryLimit, successfulJobsHistoryLimit, suspend = false, schedule
} = this.value; } = this.value;
if (this.type === WORKLOAD_TYPES.CRON_JOB) { if (this.type === WORKLOAD_TYPES.CRON_JOB) {
if (!this.value.jobTemplate) { if (!this.value.jobTemplate) {
this.$set(this.value, 'jobTemplate', { spec: {} }); this.$set(this.value, 'jobTemplate', { spec: {} });
} }
const { concurrencyPolicy = 'Allow', startingDeadlineSeconds } = this.value;
const { const {
completions, parallelism, backoffLimit, activeDeadlineSeconds completions, parallelism, backoffLimit, activeDeadlineSeconds
} = this.value.jobTemplate.spec; } = this.value.jobTemplate.spec;
return { return {
completions, parallelism, backoffLimit, activeDeadlineSeconds, failedJobsHistoryLimit, successfulJobsHistoryLimit, suspend, schedule completions, parallelism, backoffLimit, activeDeadlineSeconds, failedJobsHistoryLimit, successfulJobsHistoryLimit, suspend, schedule, concurrencyPolicy, startingDeadlineSeconds
}; };
} else { } else {
const { const {
@ -70,7 +71,6 @@ export default {
parallelism: this.parallelism, parallelism: this.parallelism,
backoffLimit: this.backoffLimit, backoffLimit: this.backoffLimit,
activeDeadlineSeconds: this.activeDeadlineSeconds, activeDeadlineSeconds: this.activeDeadlineSeconds,
}; };
this.$emit('input', spec); this.$emit('input', spec);
@ -80,7 +80,8 @@ export default {
failedJobsHistoryLimit: this.failedJobsHistoryLimit, failedJobsHistoryLimit: this.failedJobsHistoryLimit,
successfulJobsHistoryLimit: this.successfulJobsHistoryLimit, successfulJobsHistoryLimit: this.successfulJobsHistoryLimit,
suspend: this.suspend, suspend: this.suspend,
schedule: this.schedule, concurrencyPolicy: this.concurrencyPolicy,
startingDeadlineSeconds: this.startingDeadlineSeconds,
jobTemplate: { jobTemplate: {
...this.value.jobTemplate, ...this.value.jobTemplate,
completions: this.completions, completions: this.completions,
@ -103,7 +104,7 @@ export default {
<div class="col span-6"> <div class="col span-6">
<UnitInput v-model="completions" :mode="mode" :suffix="completions===1 ? 'Time' : 'Times'"> <UnitInput v-model="completions" :mode="mode" :suffix="completions===1 ? 'Time' : 'Times'">
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label class="has-tooltip" :style="{'color':'var(--input-label)'}">
{{ t('workload.job.completions.label') }} {{ t('workload.job.completions.label') }}
<i v-tooltip="t('workload.job.completions.tip')" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.job.completions.tip')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
@ -113,7 +114,7 @@ export default {
<div class="col span-6"> <div class="col span-6">
<UnitInput v-model="parallelism" :mode="mode" class="col span-6" :suffix="parallelism===1 ? 'Time' : 'Times'"> <UnitInput v-model="parallelism" :mode="mode" class="col span-6" :suffix="parallelism===1 ? 'Time' : 'Times'">
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label class="has-tooltip" :style="{'color':'var(--input-label)'}">
{{ t('workload.job.parallelism.label') }} {{ t('workload.job.parallelism.label') }}
<i v-tooltip="t('workload.job.parallelism.tip')" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.job.parallelism.tip')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
@ -125,7 +126,7 @@ export default {
<div class="col span-6"> <div class="col span-6">
<UnitInput v-model="backoffLimit" :mode="mode" :suffix="backoffLimit===1 ? 'Time' : 'Times'"> <UnitInput v-model="backoffLimit" :mode="mode" :suffix="backoffLimit===1 ? 'Time' : 'Times'">
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label class="has-tooltip" :style="{'color':'var(--input-label)'}">
{{ t('workload.job.backoffLimit.label') }} {{ t('workload.job.backoffLimit.label') }}
<i v-tooltip="t('workload.job.backoffLimit.tip')" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.job.backoffLimit.tip')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
@ -135,7 +136,7 @@ export default {
<div class="col span-6"> <div class="col span-6">
<UnitInput v-model="activeDeadlineSeconds" :mode="mode" :suffix="activeDeadlineSeconds===1 ? 'Second' : 'Seconds'"> <UnitInput v-model="activeDeadlineSeconds" :mode="mode" :suffix="activeDeadlineSeconds===1 ? 'Second' : 'Seconds'">
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label class="has-tooltip" :style="{'color':'var(--input-label)'}">
{{ t('workload.job.activeDeadlineSeconds.label') }} {{ t('workload.job.activeDeadlineSeconds.label') }}
<i v-tooltip="t('workload.job.activeDeadlineSeconds.tip')" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.job.activeDeadlineSeconds.tip')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
@ -148,7 +149,7 @@ export default {
<div class="col span-6"> <div class="col span-6">
<LabeledInput v-model.number="successfulJobsHistoryLimit" :mode="mode"> <LabeledInput v-model.number="successfulJobsHistoryLimit" :mode="mode">
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label class="has-tooltip" :style="{'color':'var(--input-label)'}">
{{ t('workload.job.successfulJobsHistoryLimit.label') }} {{ t('workload.job.successfulJobsHistoryLimit.label') }}
<i v-tooltip="t('workload.job.successfulJobsHistoryLimit.tip')" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.job.successfulJobsHistoryLimit.tip')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
@ -158,7 +159,7 @@ export default {
<div class="col span-6"> <div class="col span-6">
<LabeledInput v-model.number="failedJobsHistoryLimit" :mode="mode"> <LabeledInput v-model.number="failedJobsHistoryLimit" :mode="mode">
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label class="has-tooltip" :style="{'color':'var(--input-label)'}">
{{ t('workload.job.failedJobsHistoryLimit.label') }} {{ t('workload.job.failedJobsHistoryLimit.label') }}
<i v-tooltip="t('workload.job.failedJobsHistoryLimit.tip')" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.job.failedJobsHistoryLimit.tip')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
@ -166,8 +167,42 @@ export default {
</LabeledInput> </LabeledInput>
</div> </div>
</div> </div>
<span>Suspend</span> <div class="row mb-20">
<RadioGroup v-model="suspend" name="suspend" row :options="[true, false]" :labels="['Yes', 'No']" /> <div class="col span-6">
<UnitInput v-model="startingDeadlineSeconds" :mode="mode" :suffix="startingDeadlineSeconds===1 ? 'Second' : 'Seconds'">
<template #label>
<label class="has-tooltip" :style="{'color':'var(--input-label)'}">
{{ t('workload.job.startingDeadlineSeconds.label') }}
<i v-tooltip="t('workload.job.startingDeadlineSeconds.tip')" class="icon icon-info" style="font-size: 14px" />
</label>
</template>
</UnitInput>
</div>
<div class="col span-6">
<RadioGroup
v-model="suspend"
:mode="mode"
:label="t('workload.job.suspend')"
name="suspend"
:options="[true, false]"
:labels="['Yes', 'No']"
@input="update"
/>
</div>
</div>
<div class="row">
<div class="col span-6">
<RadioGroup
v-model="concurrencyPolicy"
:mode="mode"
:label="t('workload.upgrading.concurrencyPolicy.label')"
name="concurrency"
:options="['Allow', 'Forbid', 'Replace']"
:labels="[t('workload.upgrading.concurrencyPolicy.options.allow'), t('workload.upgrading.concurrencyPolicy.options.forbid'), t('workload.upgrading.concurrencyPolicy.options.replace')]"
@input="update"
/>
</div>
</div>
</template> </template>
</form> </form>
</template> </template>

View File

@ -29,7 +29,7 @@ export default {
}, },
data() { data() {
const { const {
strategy:strategyObj = {}, minReadySeconds = 0, progressDeadlineSeconds = 600, revisionHistoryLimit = 10 strategy:strategyObj = {}, minReadySeconds = 0, progressDeadlineSeconds = 600, revisionHistoryLimit = 10, podManagementPolicy = 'OrderedReady'
} = this.value; } = this.value;
const strategy = strategyObj.type || 'RollingUpdate'; const strategy = strategyObj.type || 'RollingUpdate';
let maxSurge = '25'; let maxSurge = '25';
@ -54,7 +54,6 @@ export default {
unavaiableUnits = 'Pods'; unavaiableUnits = 'Pods';
} }
} }
const partition = get(strategyObj, `${ strategy }.partition`) || 0;
const podSpec = get(this.value, 'template.spec'); const podSpec = get(this.value, 'template.spec');
@ -69,8 +68,8 @@ export default {
maxSurge, maxSurge,
maxUnavailable, maxUnavailable,
revisionHistoryLimit, revisionHistoryLimit,
partition,
terminationGracePeriodSeconds, terminationGracePeriodSeconds,
podManagementPolicy
}; };
}, },
computed: { computed: {
@ -111,7 +110,7 @@ export default {
update() { update() {
const podSpec = this.value?.template?.spec; const podSpec = this.value?.template?.spec;
const { const {
minReadySeconds, revisionHistoryLimit, progressDeadlineSeconds, terminationGracePeriodSeconds, partition minReadySeconds, revisionHistoryLimit, progressDeadlineSeconds, terminationGracePeriodSeconds
} = this; } = this;
let { maxSurge, maxUnavailable } = this; let { maxSurge, maxUnavailable } = this;
@ -160,15 +159,11 @@ export default {
break; break;
} }
case WORKLOAD_TYPES.STATEFUL_SET: { case WORKLOAD_TYPES.STATEFUL_SET: {
let updateStrategy; const updateStrategy = { type: this.strategy };
if (this.strategy === 'RollingUpdate') { Object.assign(this.value, {
updateStrategy = { rollingUpdate: { partition }, type: this.strategy }; updateStrategy, revisionHistoryLimit, podManagementPolicy: this.podManagementPolicy
} else { });
updateStrategy = { type: this.strategy };
}
Object.assign(this.value, { updateStrategy, revisionHistoryLimit });
break; break;
} }
default: default:
@ -210,15 +205,14 @@ export default {
</div> </div>
<div v-if="isStatefulSet" class="row mb-20"> <div v-if="isStatefulSet" class="row mb-20">
<div class="col span-6"> <div class="col span-6">
<RadioGroup v-model="value.podManagementPolicy" :label="t('workload.upgrading.podManagementPolicy.label')" :options="['OrderedReady', 'Parallel']" /> <RadioGroup
<!-- <UnitInput v-model="partition" :suffix="partition == 1 ? 'Pod' : 'Pods'" :label="t('workload.upgrading.partition.label')" :mode="mode"> v-model="podManagementPolicy"
<template #label> name="podManagement"
<label :style="{'color':'var(--input-label)'}"> :mode="mode"
{{ t('workload.upgrading.partition.label') }} :label="t('workload.upgrading.podManagementPolicy.label')"
<i v-tooltip="t('workload.upgrading.partition.tip')" class="icon icon-info" style="font-size: 14px" /> :options="['OrderedReady', 'Parallel']"
</label> @input="update"
</template> />
</UnitInput> -->
</div> </div>
</div> </div>
<template v-if="strategy === 'RollingUpdate'"> <template v-if="strategy === 'RollingUpdate'">
@ -235,7 +229,7 @@ export default {
@input="e=>updateWithUnits(e, 'maxSurge')" @input="e=>updateWithUnits(e, 'maxSurge')"
> >
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label class="has-tooltip" :style="{'color':'var(--input-label)'}">
{{ t('workload.upgrading.maxSurge.label') }} {{ t('workload.upgrading.maxSurge.label') }}
<i v-tooltip="t('workload.upgrading.maxSurge.label')" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.upgrading.maxSurge.label')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
@ -254,7 +248,7 @@ export default {
@input="e=>updateWithUnits(e, 'maxUnavailable')" @input="e=>updateWithUnits(e, 'maxUnavailable')"
> >
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label class="has-tooltip" :style="{'color':'var(--input-label)'}">
{{ t('workload.upgrading.maxUnavailable.label') }} {{ t('workload.upgrading.maxUnavailable.label') }}
<i v-tooltip="t('workload.upgrading.maxUnavailable.label')" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.upgrading.maxUnavailable.label')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
@ -269,7 +263,7 @@ export default {
<div v-if="!isStatefulSet" class="col span-6"> <div v-if="!isStatefulSet" class="col span-6">
<UnitInput v-model="minReadySeconds" :suffix="minReadySeconds == 1 ? 'Second' : 'Seconds'" :label="t('workload.upgrading.minReadySeconds.label')" :mode="mode"> <UnitInput v-model="minReadySeconds" :suffix="minReadySeconds == 1 ? 'Second' : 'Seconds'" :label="t('workload.upgrading.minReadySeconds.label')" :mode="mode">
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label class="has-tooltip" :style="{'color':'var(--input-label)'}">
{{ t('workload.upgrading.minReadySeconds.label') }} {{ t('workload.upgrading.minReadySeconds.label') }}
<i v-tooltip="t('workload.upgrading.minReadySeconds.tip')" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.upgrading.minReadySeconds.tip')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
@ -279,7 +273,7 @@ export default {
<div v-if="isDeployment || isStatefulSet || isDaemonSet" class="col span-6"> <div v-if="isDeployment || isStatefulSet || isDaemonSet" class="col span-6">
<UnitInput v-model="revisionHistoryLimit" :suffix="revisionHistoryLimit == 1 ? 'Set' : 'Sets'" :label="t('workload.upgrading.revisionHistoryLimit.label')" :mode="mode"> <UnitInput v-model="revisionHistoryLimit" :suffix="revisionHistoryLimit == 1 ? 'Set' : 'Sets'" :label="t('workload.upgrading.revisionHistoryLimit.label')" :mode="mode">
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label class="has-tooltip" :style="{'color':'var(--input-label)'}">
{{ t('workload.upgrading.revisionHistoryLimit.label') }} {{ t('workload.upgrading.revisionHistoryLimit.label') }}
<i v-tooltip="t('workload.upgrading.revisionHistoryLimit.tip')" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.upgrading.revisionHistoryLimit.tip')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
@ -291,9 +285,9 @@ export default {
<div class="col span-6"> <div class="col span-6">
<UnitInput v-model="progressDeadlineSeconds" :suffix="progressDeadlineSeconds == 1 ? 'Second' : 'Seconds'" label="Progress Deadline" :mode="mode"> <UnitInput v-model="progressDeadlineSeconds" :suffix="progressDeadlineSeconds == 1 ? 'Second' : 'Seconds'" label="Progress Deadline" :mode="mode">
<template #label> <template #label>
<label :style="{'color':'var(--input-label)'}"> <label class="has-tooltip" :style="{'color':'var(--input-label)'}">
Progress Deadline {{ t('workload.upgrading.progressDeadlineSeconds.label') }}
<i v-tooltip="'How long to wait without seeing progress before marking the deployment as stalled.'" class="icon icon-info" style="font-size: 14px" /> <i v-tooltip="t('workload.upgrading.progressDeadlineSeconds.tip')" class="icon icon-info" style="font-size: 14px" />
</label> </label>
</template> </template>
</UnitInput> </UnitInput>