1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

fix(app): add github action for linting and formatting [EE-2344] (#6356)

This commit is contained in:
Chaim Lev-Ari 2022-01-17 07:53:32 +02:00 committed by GitHub
parent 34cc8ea96a
commit 1b1a50d6b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
313 changed files with 2685 additions and 3873 deletions

View file

@ -24,9 +24,7 @@
additional-files="ctrl.stack.AdditionalFiles"
type="application"
></git-form-info-panel>
<div class="col-sm-12 form-section-title" ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.APPLICATION_FORM">
Namespace
</div>
<div class="col-sm-12 form-section-title" ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.APPLICATION_FORM"> Namespace </div>
<!-- #region NAMESPACE -->
<div class="form-group" ng-if="ctrl.formValues.ResourcePool">
<label for="resource-pool-selector" class="col-sm-1 control-label text-left">Namespace</label>
@ -44,14 +42,14 @@
</div>
<div class="form-group" ng-if="ctrl.state.resourcePoolHasQuota && ctrl.resourceQuotaCapacityExceeded() && ctrl.formValues.ResourcePool">
<div class="col-sm-12 small text-danger">
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px"></i>
This namespace has exhausted its resource capacity and you will not be able to deploy the application. Contact your administrator to expand the capacity of the
namespace.
</div>
</div>
<div class="form-group" ng-if="!ctrl.formValues.ResourcePool">
<div class="col-sm-12 small text-muted">
<i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px"></i>
You do not have access to any namespace. Contact your administrator to get access to a namespace.
</div>
</div>
@ -77,7 +75,7 @@
<editor-description>
<span class="text-muted small" ng-show="ctrl.stack.IsComposeFormat">
<p>
<i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px"></i>
Portainer uses <a href="https://kompose.io/" target="_blank">Kompose</a> to convert your Compose manifest to a Kubernetes compliant manifest. Be wary that not
all the Compose format options are supported by Kompose at the moment.
</p>
@ -88,7 +86,7 @@
</span>
<span class="text-muted small" ng-show="!ctrl.stack.IsComposeFormat">
<p>
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px"></i>
This feature allows you to deploy any kind of Kubernetes resource in this environment (Deployment, Secret, ConfigMap...).
</p>
<p>
@ -100,9 +98,7 @@
</web-editor-form>
<!-- #endregion -->
<div ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.APPLICATION_FORM">
<div class="col-sm-12 form-section-title">
Application
</div>
<div class="col-sm-12 form-section-title"> Application </div>
<!-- #region NAME FIELD -->
<div class="form-group">
<label for="application_name" class="col-sm-1 control-label text-left">Name</label>
@ -157,13 +153,11 @@
</div>
</div>
<div ng-if="ctrl.formValues.ResourcePool">
<div class="col-sm-12 form-section-title">
Stack
</div>
<div class="col-sm-12 form-section-title"> Stack </div>
<!-- #region STACK -->
<div class="form-group">
<div class="col-sm-12 small text-muted">
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px"></i>
Portainer can automatically bundle multiple applications inside a stack. Enter a name of a new stack or select an existing stack in the list. Leave empty to
use the application name.
</div>
@ -187,9 +181,7 @@
</div>
<!-- #endregion -->
<div class="col-sm-12 form-section-title">
Environment
</div>
<div class="col-sm-12 form-section-title"> Environment </div>
<!-- #region ENVIRONMENT VARIABLES -->
<div class="form-group">
<div class="col-sm-12">
@ -197,7 +189,7 @@
<span
ng-if="ctrl.formValues.Containers.length <= 1"
class="label label-default interactive"
style="margin-left: 10px;"
style="margin-left: 10px"
ng-click="ctrl.addEnvironmentVariable()"
data-cy="k8sAppCreate-addEnvVarButton"
>
@ -205,9 +197,9 @@
</span>
</div>
<div class="col-sm-12 form-inline" style="margin-top: 10px;">
<div ng-repeat="envVar in ctrl.formValues.EnvironmentVariables | orderBy: 'NameIndex'" style="margin-top: 2px;">
<div style="margin-top: 2px;">
<div class="col-sm-12 form-inline" style="margin-top: 10px">
<div ng-repeat="envVar in ctrl.formValues.EnvironmentVariables | orderBy: 'NameIndex'" style="margin-top: 2px">
<div style="margin-top: 2px">
<div class="col-sm-4 input-group input-group-sm">
<div class="input-group col-sm-12 input-group-sm" ng-class="{ striked: envVar.NeedsDeletion }">
<span class="input-group-addon">name</span>
@ -263,7 +255,7 @@
<div class="col-sm-4 input-group input-group-sm">
<div
class="small text-warning"
style="margin-top: 5px;"
style="margin-top: 5px"
ng-show="
kubernetesApplicationCreationForm['environment_variable_name_' + $index].$invalid ||
ctrl.state.duplicates.environmentVariables.refs[$index] !== undefined
@ -289,16 +281,14 @@
</div>
<!-- #endregion -->
<div class="col-sm-12 form-section-title">
Configurations
</div>
<div class="col-sm-12 form-section-title"> Configurations </div>
<!-- #region CONFIGURATIONS -->
<div class="form-group">
<div class="col-sm-12">
<label class="control-label text-left">Configurations</label>
<span
class="label label-default interactive"
style="margin-left: 10px;"
style="margin-left: 10px"
ng-click="ctrl.addConfiguration()"
ng-if="ctrl.formValues.Containers.length <= 1"
data-cy="k8sAppCreate-addConfigButton"
@ -306,8 +296,8 @@
<i class="fa fa-plus-circle" aria-hidden="true"></i> add configuration
</span>
</div>
<div class="col-sm-12 small text-muted" style="margin-top: 15px;" ng-if="ctrl.formValues.Configurations.length">
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<div class="col-sm-12 small text-muted" style="margin-top: 15px" ng-if="ctrl.formValues.Configurations.length">
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px"></i>
Portainer will automatically expose all the keys of a configuration as environment variables. This behavior can be overriden to filesystem mounts for each key
via the override button.
</div>
@ -326,7 +316,7 @@
data-cy="k8sAppCreate-addConfigSelect_{{ $index }}"
></select>
</div>
<div class="col-sm-6" style="margin-top: 2px;">
<div class="col-sm-6" style="margin-top: 2px">
<button
class="btn btn-sm btn-primary"
type="button"
@ -358,9 +348,9 @@
</button>
</div>
<!-- no-override -->
<div class="col-sm-12" style="margin-top: 10px;" ng-if="config.SelectedConfiguration && !config.Overriden">
<div class="col-sm-12" style="margin-top: 10px" ng-if="config.SelectedConfiguration && !config.Overriden">
<div class="col-md-1 col-sm-2"></div>
<div class="col-md-11 col-sm-10 small text-muted" style="padding-left: 5px;">
<div class="col-md-11 col-sm-10 small text-muted" style="padding-left: 5px">
The following keys will be loaded from the <code>{{ config.SelectedConfiguration.Name }}</code> configuration as environment variables:
<span ng-repeat="(key, _) in config.SelectedConfiguration.Data">
<code>{{ key }}</code
@ -371,10 +361,10 @@
<!-- !no-override -->
<!-- has-override -->
<div class="col-sm-12 form-inline" style="margin-top: 10px;" ng-if="config.Overriden">
<div ng-repeat="(keyIndex, overridenKey) in config.OverridenKeys" style="margin-top: 2px;">
<div style="margin-top: 2px;">
<div class="col-sm-1 input-group input-group-sm" style="margin-left: 3px;"></div>
<div class="col-sm-12 form-inline" style="margin-top: 10px" ng-if="config.Overriden">
<div ng-repeat="(keyIndex, overridenKey) in config.OverridenKeys" style="margin-top: 2px">
<div style="margin-top: 2px">
<div class="col-sm-1 input-group input-group-sm" style="margin-left: 3px"></div>
<div class="col-sm-3 input-group input-group-sm">
<span class="input-group-addon">configuration key</span>
<input type="text" class="form-control" ng-value="overridenKey.Key" disabled />
@ -413,12 +403,12 @@
ctrl.state.duplicates.configurationPaths.refs[index + '_' + keyIndex] !== undefined
"
>
<div class="col-sm-1 input-group input-group-sm" style="margin-left: 3px;"></div>
<div class="col-sm-1 input-group input-group-sm" style="margin-left: 3px"></div>
<div class="col-sm-3 input-group input-group-sm"></div>
<div class="col-sm-3 input-group input-group-sm" ng-if="overridenKey.Type === ctrl.ApplicationConfigurationFormValueOverridenKeyTypes.FILESYSTEM">
<div
class="small text-warning"
style="margin-top: 5px;"
style="margin-top: 5px"
ng-show="
kubernetesApplicationCreationForm['overriden_key_path_' + index + '_' + keyIndex].$invalid ||
ctrl.state.duplicates.configurationPaths.refs[index + '_' + keyIndex] !== undefined
@ -441,23 +431,21 @@
<!-- !config-element -->
<!-- #endregion -->
<div class="col-sm-12 form-section-title">
Persisting data
</div>
<div class="col-sm-12 form-section-title"> Persisting data </div>
<!-- #region PERSISTED FOLDERS -->
<div class="form-group" ng-if="!ctrl.storageClassAvailable()">
<div class="col-sm-12 small text-muted">
<i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px"></i>
No storage option is available to persist data, contact your administrator to enable a storage option.
</div>
</div>
<div class="form-group" ng-if="ctrl.storageClassAvailable()">
<div class="col-sm-12" style="margin-top: 5px;">
<div class="col-sm-12" style="margin-top: 5px">
<label class="control-label text-left">Persisted folders</label>
<span
class="label label-default interactive"
style="margin-left: 10px;"
style="margin-left: 10px"
ng-click="ctrl.addPersistedFolder()"
ng-if="ctrl.isAddPersistentFolderButtonShowed()"
data-cy="k8sAppCreate-addPersistentFolderButton"
@ -466,8 +454,8 @@
</span>
</div>
<div class="col-sm-12 form-inline" style="margin-top: 10px;" ng-repeat="persistedFolder in ctrl.formValues.PersistedFolders">
<div style="margin-top: 2px;">
<div class="col-sm-12 form-inline" style="margin-top: 10px" ng-repeat="persistedFolder in ctrl.formValues.PersistedFolders">
<div style="margin-top: 2px">
<div class="input-group col-sm-3 input-group-sm" ng-class="{ striked: persistedFolder.NeedsDeletion }">
<span class="input-group-addon">path in container</span>
<input
@ -524,7 +512,7 @@
required
ng-disabled="ctrl.isEditAndExistingPersistedFolder($index) || ctrl.formValues.Containers.length > 1"
/>
<span class="input-group-addon" style="padding: 0;">
<span class="input-group-addon" style="padding: 0">
<select
ng-model="persistedFolder.SizeUnit"
ng-style="{ width: '100%', height: '100%', cursor: ctrl.isEditAndExistingPersistedFolder($index) ? 'not-allowed' : 'auto' }"
@ -605,7 +593,7 @@
<div class="input-group col-sm-3 input-group-sm">
<div
class="small text-warning"
style="margin-top: 5px;"
style="margin-top: 5px"
ng-show="
kubernetesApplicationCreationForm['persisted_folder_path_' + $index].$invalid || ctrl.state.duplicates.persistedFolders.refs[$index] !== undefined
"
@ -622,7 +610,7 @@
<div class="input-group col-sm-2 input-group-sm"></div>
<div class="input-group col-sm-5 input-group-sm">
<div class="small text-warning" style="margin-top: 5px;" ng-show="kubernetesApplicationCreationForm['persisted_folder_size_' + $index].$invalid">
<div class="small text-warning" style="margin-top: 5px" ng-show="kubernetesApplicationCreationForm['persisted_folder_size_' + $index].$invalid">
<ng-messages for="kubernetesApplicationCreationForm['persisted_folder_size_' + $index].$error">
<p ng-message="required"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Size is required.</p>
<p ng-message="min"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This value must be greater than zero.</p>
@ -656,13 +644,11 @@
</div>
<div class="form-group">
<div class="col-sm-12 small text-muted">
Specify how the data will be used across instances.
</div>
<div class="col-sm-12 small text-muted"> Specify how the data will be used across instances. </div>
</div>
<!-- access policy options -->
<div class="form-group" style="margin-bottom: 0;">
<div class="form-group" style="margin-bottom: 0">
<div class="boxselector_wrapper">
<div
ng-if="
@ -679,14 +665,14 @@
/>
<label for="data_access_isolated">
<div class="boxselector_header">
<i class="fa fa-cubes" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-cubes" aria-hidden="true" style="margin-right: 2px"></i>
Isolated
</div>
<p>Application will be deployed as a StatefulSet with each instantiating their own data</p>
</label>
</div>
<div
style="color: #767676;"
style="color: #767676"
ng-if="
(ctrl.state.isEdit && ctrl.formValues.DataAccessPolicy === ctrl.ApplicationDataAccessPolicies.SHARED) || ctrl.state.persistedFoldersUseExistingVolumes
"
@ -698,10 +684,10 @@
tooltip-placement="bottom"
tooltip-class="portainer-tooltip"
uib-tooltip="Changing the data access policy is not allowed"
style="cursor: pointer; border-color: #767676;"
style="cursor: pointer; border-color: #767676"
>
<div class="boxselector_header">
<i class="fa fa-cubes" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-cubes" aria-hidden="true" style="margin-right: 2px"></i>
Isolated
</div>
<p>Application will be deployed as a StatefulSet with each instantiating their own data</p>
@ -717,13 +703,13 @@
/>
<label for="data_access_shared">
<div class="boxselector_header">
<i class="fa fa-cube" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-cube" aria-hidden="true" style="margin-right: 2px"></i>
Shared
</div>
<p>Application will be deployed as a Deployment with a shared storage access</p>
</label>
</div>
<div style="color: #767676;" ng-if="ctrl.state.isEdit && ctrl.formValues.DataAccessPolicy === ctrl.ApplicationDataAccessPolicies.ISOLATED">
<div style="color: #767676" ng-if="ctrl.state.isEdit && ctrl.formValues.DataAccessPolicy === ctrl.ApplicationDataAccessPolicies.ISOLATED">
<input type="radio" id="data_access_shared" disabled />
<label
for="data_access_shared"
@ -731,10 +717,10 @@
tooltip-placement="bottom"
tooltip-class="portainer-tooltip"
uib-tooltip="Changing the data access policy is not allowed"
style="cursor: pointer; border-color: #767676;"
style="cursor: pointer; border-color: #767676"
>
<div class="boxselector_header">
<i class="fa fa-cube" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-cube" aria-hidden="true" style="margin-right: 2px"></i>
Shared
</div>
<p>Application will be deployed as a Deployment with a shared storage access</p>
@ -746,20 +732,18 @@
</div>
<!-- #endregion -->
<div class="col-sm-12 form-section-title">
Resource reservations
</div>
<div class="col-sm-12 form-section-title"> Resource reservations </div>
<!-- #region RESOURCE RESERVATIONS -->
<div class="form-group" ng-if="!ctrl.state.resourcePoolHasQuota">
<div class="col-sm-12 small text-muted">
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px"></i>
Resource reservations are applied per instance of the application.
</div>
</div>
<div class="form-group" ng-if="ctrl.state.resourcePoolHasQuota && !ctrl.resourceQuotaCapacityExceeded()">
<div class="col-sm-12 small text-muted">
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px"></i>
A resource quota is set on this namespace, you must specify resource reservations. Resource reservations are applied per instance of the application. Maximums
are inherited from the namespace quota.
</div>
@ -767,7 +751,7 @@
<div class="form-group" ng-if="ctrl.state.resourcePoolHasQuota && ctrl.resourceQuotaCapacityExceeded()">
<div class="col-sm-12 small text-danger">
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px"></i>
This namespace has exhausted its resource capacity and you will not be able to deploy the application. Contact your administrator to expand the capacity of
the namespace.
</div>
@ -780,7 +764,7 @@
(!ctrl.state.resourcePoolHasQuota || (ctrl.state.resourcePoolHasQuota && !ctrl.resourceQuotaCapacityExceeded())) && ctrl.formValues.Containers.length <= 1
"
>
<label for="memory-limit" class="col-sm-3 col-lg-2 control-label text-left" style="margin-top: 20px;">
<label for="memory-limit" class="col-sm-3 col-lg-2 control-label text-left" style="margin-top: 20px">
Memory
<portainer-tooltip
position="bottom"
@ -805,9 +789,7 @@
/>
</div>
<div class="col-sm-4">
<p class="small text-muted" style="margin-top: 7px;">
Maximum memory usage (<b>MB</b>)
</p>
<p class="small text-muted" style="margin-top: 7px"> Maximum memory usage (<b>MB</b>) </p>
</div>
</div>
<div class="form-group" ng-show="kubernetesApplicationCreationForm.memory_limit.$invalid">
@ -828,7 +810,7 @@
(!ctrl.state.resourcePoolHasQuota || (ctrl.state.resourcePoolHasQuota && !ctrl.resourceQuotaCapacityExceeded())) && ctrl.formValues.Containers.length <= 1
"
>
<label for="cpu-limit" class="col-sm-3 col-lg-2 control-label text-left" style="margin-top: 20px;">
<label for="cpu-limit" class="col-sm-3 col-lg-2 control-label text-left" style="margin-top: 20px">
CPU
<portainer-tooltip
position="bottom"
@ -839,34 +821,28 @@
<div class="col-sm-5">
<slider model="ctrl.formValues.CpuLimit" floor="ctrl.state.sliders.cpu.min" ceil="ctrl.state.sliders.cpu.max" step="0.10" precision="2"></slider>
</div>
<div class="col-sm-4" style="margin-top: 20px;">
<p class="small text-muted">
Maximum CPU usage
</p>
<div class="col-sm-4" style="margin-top: 20px">
<p class="small text-muted"> Maximum CPU usage </p>
</div>
</div>
<div class="form-group" ng-if="ctrl.nodeLimitsOverflow()">
<div class="col-sm-12 small text-danger">
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px"></i>
These reservations would exceed the resources currently available in the cluster.
</div>
</div>
<!-- !cpu-limit-input -->
<!-- #endregion -->
<div class="col-sm-12 form-section-title">
Deployment
</div>
<div class="col-sm-12 form-section-title"> Deployment </div>
<!-- #region DEPLOYMENT -->
<div class="form-group">
<div class="col-sm-12 small text-muted">
Select how you want to deploy your application inside the cluster.
</div>
<div class="col-sm-12 small text-muted"> Select how you want to deploy your application inside the cluster. </div>
</div>
<!-- deployment options -->
<div class="form-group" style="margin-bottom: 0;">
<div class="form-group" style="margin-bottom: 0">
<div class="boxselector_wrapper">
<div>
<input
@ -878,13 +854,13 @@
/>
<label for="deployment_replicated">
<div class="boxselector_header">
<i class="fa fa-cube" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-cube" aria-hidden="true" style="margin-right: 2px"></i>
Replicated
</div>
<p>Run one or multiple instances of this container</p>
</label>
</div>
<div style="color: #767676;" ng-if="!ctrl.supportGlobalDeployment()">
<div style="color: #767676" ng-if="!ctrl.supportGlobalDeployment()">
<input type="radio" id="deployment_global" disabled />
<label
for="deployment_global"
@ -892,10 +868,10 @@
tooltip-placement="bottom"
tooltip-class="portainer-tooltip"
uib-tooltip="The storage or access policy used for persisted folders cannot be used with this option"
style="cursor: pointer; border-color: #767676;"
style="cursor: pointer; border-color: #767676"
>
<div class="boxselector_header">
<i class="fa fa-cubes" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-cubes" aria-hidden="true" style="margin-right: 2px"></i>
Global
</div>
<p>Application will be deployed as a DaemonSet with an instance on each node of the cluster</p>
@ -912,7 +888,7 @@
/>
<label for="deployment_global">
<div class="boxselector_header">
<i class="fa fa-cubes" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-cubes" aria-hidden="true" style="margin-right: 2px"></i>
Global
</div>
<p>Application will be deployed as a DaemonSet with an instance on each node of the cluster</p>
@ -925,9 +901,7 @@
<!-- replica count -->
<div class="form-group form-inline" ng-if="ctrl.formValues.DeploymentType === ctrl.ApplicationDeploymentTypes.REPLICATED">
<div class="col-sm-12">
<label class="control-label text-left">
Instance count
</label>
<label class="control-label text-left"> Instance count </label>
<input
type="number"
name="replica_count"
@ -935,7 +909,7 @@
min="1"
max="9999"
placeholder="1"
style="margin-left: 20px;"
style="margin-left: 20px"
ng-model="ctrl.formValues.ReplicaCount"
ng-disabled="!ctrl.supportScalableReplicaDeployment()"
ng-change="ctrl.enforceReplicaCountMinimum()"
@ -959,7 +933,7 @@
ng-if="!ctrl.resourceReservationsOverflow() && ctrl.formValues.ReplicaCount > 1 && (ctrl.formValues.CpuLimit !== 0 || ctrl.formValues.MemoryLimit !== 0)"
>
<div class="col-sm-12 small text-muted">
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px"></i>
This application will reserve the following resources:
<b>{{ ctrl.formValues.CpuLimit * ctrl.formValues.ReplicaCount | kubernetesApplicationCPUValue }} CPU</b> and
<b>{{ ctrl.formValues.MemoryLimit * ctrl.formValues.ReplicaCount }} MB</b> of memory.
@ -968,14 +942,14 @@
<div class="form-group" ng-if="ctrl.resourceReservationsOverflow()">
<div class="col-sm-12 small text-danger">
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px"></i>
This application would exceed available resources. Please review resource reservations or the instance count.
</div>
</div>
<div class="form-group" ng-if="!ctrl.supportScalableReplicaDeployment()">
<div class="col-sm-12 small text-muted">
<i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px"></i>
The following storage option(s) do not support concurrent access from multiples instances: <code>{{ ctrl.getNonScalableStorage() }}</code
>. You will not be able to scale that application.
</div>
@ -983,16 +957,12 @@
<!-- #endregion -->
<!-- #region AUTO SCALING -->
<div class="col-sm-12 form-section-title" ng-if="ctrl.formValues.DeploymentType !== ctrl.ApplicationDeploymentTypes.GLOBAL">
Auto-scaling
</div>
<div class="col-sm-12 form-section-title" ng-if="ctrl.formValues.DeploymentType !== ctrl.ApplicationDeploymentTypes.GLOBAL"> Auto-scaling </div>
<div class="form-group" ng-if="ctrl.formValues.DeploymentType !== ctrl.ApplicationDeploymentTypes.GLOBAL && ctrl.state.useServerMetrics">
<div class="col-sm-12">
<label for="enable_auto_scaling" class="control-label text-left">
Enable auto scaling for this application
</label>
<label class="switch" style="margin-left: 20px;">
<label for="enable_auto_scaling" class="control-label text-left"> Enable auto scaling for this application </label>
<label class="switch" style="margin-left: 20px">
<input
type="checkbox"
class="form-control"
@ -1007,9 +977,7 @@
<div class="form-group" ng-if="ctrl.formValues.DeploymentType !== ctrl.ApplicationDeploymentTypes.GLOBAL && !ctrl.state.useServerMetrics">
<div class="col-sm-12 small text-muted">
<p ng-if="!ctrl.isAdmin">
This feature is currently disabled and must be enabled by an administrator user.
</p>
<p ng-if="!ctrl.isAdmin"> This feature is currently disabled and must be enabled by an administrator user. </p>
<p ng-if="ctrl.isAdmin">
Server metrics features must be enabled in the
<a ui-sref="portainer.k8sendpoint.kubernetesConfig({id: ctrl.endpoint.Id})" class="ctrl.isAdmin">environment configuration view</a>.
@ -1018,12 +986,12 @@
</div>
<div class="form-inline" ng-if="ctrl.formValues.DeploymentType !== ctrl.ApplicationDeploymentTypes.GLOBAL && ctrl.formValues.AutoScaler.IsUsed">
<table class="table" style="margin-bottom: 0px;">
<table class="table" style="margin-bottom: 0px">
<tbody>
<tr class="small">
<td style="width: 33%; border: none; padding: 2px 0 2px 0;">Minimum instances</td>
<td style="width: 33%; border: none; padding: 2px 0 2px 0;">Maximum instances</td>
<td style="width: 33%; border: none; padding: 2px 0 2px 0;">
<td style="width: 33%; border: none; padding: 2px 0 2px 0">Minimum instances</td>
<td style="width: 33%; border: none; padding: 2px 0 2px 0">Maximum instances</td>
<td style="width: 33%; border: none; padding: 2px 0 2px 0">
Target CPU usage (<b>%</b>)
<portainer-tooltip
position="bottom"
@ -1033,8 +1001,8 @@
</td>
</tr>
<tr>
<td style="padding: 8px 5px 5px 0; border: none;">
<div class="input-group input-group-sm" style="width: 100%;">
<td style="padding: 8px 5px 5px 0; border: none">
<div class="input-group input-group-sm" style="width: 100%">
<input
type="number"
class="form-control"
@ -1047,7 +1015,7 @@
/>
</div>
<div class="input-group input-group-sm" ng-show="kubernetesApplicationCreationForm['auto_scaler_min'].$invalid">
<div class="small text-warning" style="margin-top: 5px;">
<div class="small text-warning" style="margin-top: 5px">
<ng-messages for="kubernetesApplicationCreationForm['auto_scaler_min'].$error">
<p ng-message="required"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Minimum instances is required.</p>
<p ng-message="min"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Minimum instances must be greater than 0.</p>
@ -1056,8 +1024,8 @@
</div>
</div>
</td>
<td style="padding: 8px 5px 5px 0; border: none;">
<div class="input-group input-group-sm" style="width: 100%;">
<td style="padding: 8px 5px 5px 0; border: none">
<div class="input-group input-group-sm" style="width: 100%">
<input
type="number"
class="form-control"
@ -1067,7 +1035,7 @@
/>
</div>
<div class="input-group input-group-sm" ng-show="kubernetesApplicationCreationForm['auto_scaler_max'].$invalid || ctrl.autoScalerOverflow()">
<div class="small text-warning" style="margin-top: 5px;">
<div class="small text-warning" style="margin-top: 5px">
<ng-messages for="kubernetesApplicationCreationForm['auto_scaler_max'].$error">
<p ng-message="required"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Maximum instances is required.</p>
<p ng-message="min"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Maximum instances must be greater than minimum instances.</p>
@ -1075,8 +1043,8 @@
</div>
</div>
</td>
<td style="padding: 8px 5px 5px 0; border: none;">
<div class="input-group input-group-sm" style="width: 100%;">
<td style="padding: 8px 5px 5px 0; border: none">
<div class="input-group input-group-sm" style="width: 100%">
<input
type="number"
class="form-control"
@ -1089,7 +1057,7 @@
/>
</div>
<div class="input-group input-group-sm" ng-show="kubernetesApplicationCreationForm['auto_scaler_cpu'].$invalid">
<div class="small text-warning" style="margin-top: 5px;">
<div class="small text-warning" style="margin-top: 5px">
<ng-messages for="kubernetesApplicationCreationForm['auto_scaler_cpu'].$error">
<p ng-message="required"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Target CPU usage is required.</p>
<p ng-message="min"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Target CPU usage must be greater than 0.</p>
@ -1102,9 +1070,9 @@
</tbody>
</table>
<div class="form-group" ng-if="ctrl.autoScalerOverflow()" style="margin-bottom: 10px;">
<div class="form-group" ng-if="ctrl.autoScalerOverflow()" style="margin-bottom: 10px">
<div class="col-sm-12 small text-danger">
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px"></i>
This application would exceed available resources. Please review resource reservations or the maximum instance count of the auto-scaling policy.
</div>
</div>
@ -1112,26 +1080,24 @@
<!-- #endregion -->
<div ng-if="ctrl.formValues.DeploymentType === ctrl.ApplicationDeploymentTypes.REPLICATED">
<div class="col-sm-12 form-section-title">
Placement preferences and constraints
</div>
<div class="col-sm-12 form-section-title"> Placement preferences and constraints </div>
<!-- #region PLACEMENTS -->
<div class="form-group">
<div class="col-sm-12">
<label class="control-label text-left">Placement rules</label>
<span class="label label-default interactive" style="margin-left: 10px;" ng-click="ctrl.addPlacement()">
<span class="label label-default interactive" style="margin-left: 10px" ng-click="ctrl.addPlacement()">
<i class="fa fa-plus-circle" aria-hidden="true"></i> add rule
</span>
</div>
<div class="col-sm-12 small text-muted" ng-if="ctrl.formValues.Placements.length > 0" style="margin-top: 10px;">
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<div class="col-sm-12 small text-muted" ng-if="ctrl.formValues.Placements.length > 0" style="margin-top: 10px">
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px"></i>
Deploy this application on nodes that respect <b>ALL</b> of the following placement rules. Placement rules are based on node labels.
</div>
<div class="col-sm-12 form-inline" style="margin-top: 10px;">
<div ng-repeat-start="placement in ctrl.formValues.Placements" style="margin-top: 2px;">
<div class="col-sm-12 form-inline" style="margin-top: 10px">
<div ng-repeat-start="placement in ctrl.formValues.Placements" style="margin-top: 2px">
<div class="col-sm-5 input-group" ng-class="{ striked: placement.NeedsDeletion }">
<select
class="form-control"
@ -1177,7 +1143,7 @@
</div>
<div ng-repeat-end ng-show="ctrl.state.duplicates.placements.refs[$index] !== undefined">
<div class="col-sm-5 input-group">
<div class="small text-warning" style="margin-top: 5px;" ng-if="ctrl.state.duplicates.placements.refs[$index] !== undefined">
<div class="small text-warning" style="margin-top: 5px" ng-if="ctrl.state.duplicates.placements.refs[$index] !== undefined">
<p ng-if="ctrl.state.duplicates.placements.refs[$index] !== undefined">
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This label is already defined.
</p>
@ -1194,13 +1160,11 @@
</div>
<div class="form-group">
<div class="col-sm-12 small text-muted">
Specify the policy associated to the placement rules.
</div>
<div class="col-sm-12 small text-muted"> Specify the policy associated to the placement rules. </div>
</div>
<!-- placement policy options -->
<div class="form-group" style="margin-bottom: 0;" ng-if="ctrl.formValues.Placements.length">
<div class="form-group" style="margin-bottom: 0" ng-if="ctrl.formValues.Placements.length">
<div class="boxselector_wrapper">
<div>
<input
@ -1212,7 +1176,7 @@
/>
<label for="placement_hard">
<div class="boxselector_header">
<i class="fa fa-tasks" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-tasks" aria-hidden="true" style="margin-right: 2px"></i>
Mandatory
</div>
<p>Schedule this application <b>ONLY</b> on nodes that match <b>ALL</b> Rules</p>
@ -1228,7 +1192,7 @@
/>
<label for="placement_soft">
<div class="boxselector_header">
<i class="fa fa-list" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-list" aria-hidden="true" style="margin-right: 2px"></i>
Preferred
</div>
<p>Schedule this application on nodes that match the rules if possible</p>
@ -1255,9 +1219,7 @@
</div>
</div>
<div ng-if="ctrl.isExternalApplication()">
<div class="col-sm-12 form-section-title" ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.APPLICATION_FORM">
Namespace
</div>
<div class="col-sm-12 form-section-title" ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.APPLICATION_FORM"> Namespace </div>
<!-- #region NAMESPACE -->
<div class="form-group" ng-if="ctrl.formValues.ResourcePool">
<label for="resource-pool-selector" class="col-sm-1 control-label text-left">Namespace</label>
@ -1275,14 +1237,14 @@
</div>
<div class="form-group" ng-if="ctrl.state.resourcePoolHasQuota && ctrl.resourceQuotaCapacityExceeded() && ctrl.formValues.ResourcePool">
<div class="col-sm-12 small text-danger">
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-exclamation-circle red-icon" aria-hidden="true" style="margin-right: 2px"></i>
This namespace has exhausted its resource capacity and you will not be able to deploy the application. Contact your administrator to expand the capacity of the
namespace.
</div>
</div>
<div class="form-group" ng-if="!ctrl.formValues.ResourcePool">
<div class="col-sm-12 small text-muted">
<i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px;"></i>
<i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px"></i>
You do not have access to any namespace. Contact your administrator to get access to a namespace.
</div>
</div>
@ -1294,9 +1256,7 @@
<!-- kubernetes summary for external application -->
<kubernetes-summary-view ng-if="ctrl.isExternalApplication()" form-values="ctrl.formValues" old-form-values="ctrl.savedFormValues"></kubernetes-summary-view>
<!-- kubernetes summary for external application -->
<div class="col-sm-12 form-section-title" ng-if="ctrl.state.appType !== ctrl.KubernetesDeploymentTypes.GIT">
Actions
</div>
<div class="col-sm-12 form-section-title" ng-if="ctrl.state.appType !== ctrl.KubernetesDeploymentTypes.GIT"> Actions </div>
<!-- #region ACTIONS -->
<div class="form-group">
<div class="col-sm-12">
@ -1329,7 +1289,7 @@
ng-click="ctrl.updateApplicationViaWebEditor()"
ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.CONTENT || ctrl.state.updateWebEditorInProgress"
ng-disabled="!kubernetesApplicationCreationForm.$valid || !ctrl.state.isEditorDirty || ctrl.state.updateWebEditorInProgress"
style="margin-top: 7px; margin-left: 0;"
style="margin-top: 7px; margin-left: 0"
button-spinner="ctrl.state.updateWebEditorInProgress"
>
<span ng-show="!ctrl.state.updateWebEditorInProgress">Update the application</span>