2020-07-05 23:21:03 +00:00
< kubernetes-view-header title = "Resource pool details" state = "kubernetes.resourcePools.resourcePool" view-ready = "ctrl.state.viewReady" >
< a ui-sref = "kubernetes.resourcePools" > Resource pools< / a > > {{ ctrl.pool.Namespace.Name }}
< / kubernetes-view-header >
< kubernetes-view-loading view-ready = "ctrl.state.viewReady" > < / kubernetes-view-loading >
< div ng-if = "ctrl.state.viewReady" >
< div class = "row" >
< div class = "col-sm-12" >
< rd-widget >
< rd-widget-body classes = "no-padding" >
< uib-tabset active = "ctrl.state.activeTab" justified = "true" type = "pills" >
< uib-tab index = "0" classes = "btn-sm" select = "ctrl.selectTab(0)" >
< uib-tab-heading > < i class = "fa fa-layer-group space-right" aria-hidden = "true" > < / i > Resource pool < / uib-tab-heading >
< form class = "form-horizontal" autocomplete = "off" name = "resourcePoolEditForm" style = "padding: 20px; margin-top: 10px;" >
<!-- name - input -->
< div class = "form-group" >
< label for = "pool_name" class = "col-sm-1 control-label text-left" > Name< / label >
< div class = "col-sm-11" >
< input type = "text" class = "form-control" name = "pool_name" ng-model = "ctrl.pool.Namespace.Name" disabled / >
< / div >
< / div >
<!-- !name - input -->
2020-08-07 00:03:00 +00:00
< div ng-if = "ctrl.isAdmin && ctrl.isEditable" class = "col-sm-12 form-section-title" > Quota< / div >
2020-07-05 23:21:03 +00:00
<!-- quotas - switch -->
2020-08-07 00:03:00 +00:00
< div ng-if = "ctrl.isAdmin && ctrl.isEditable" class = "form-group" >
2020-07-05 23:21:03 +00:00
< div class = "col-sm-12" >
< label class = "control-label text-left" >
Resource assignment
< / label >
2020-08-12 23:30:23 +00:00
< label class = "switch" style = "margin-left: 20px;" > < input type = "checkbox" ng-model = "ctrl.formValues.HasQuota" / > < i > < / i > < / label >
2020-07-05 23:21:03 +00:00
< / div >
< / div >
2020-08-12 23:30:23 +00:00
< div class = "form-group" ng-if = "ctrl.formValues.HasQuota && ctrl.isAdmin && ctrl.isEditable && !ctrl.isQuotaValid()" >
2020-07-05 23:21:03 +00:00
< span class = "col-sm-12 text-warning small" >
< p > < i class = "fa fa-exclamation-triangle" aria-hidden = "true" style = "margin-right: 2px;" > < / i > At least a single limit must be set for the quota to be valid. < / p >
< / span >
< / div >
<!-- !quotas - switch -->
2020-08-12 23:30:23 +00:00
< div ng-if = "ctrl.formValues.HasQuota && ctrl.isAdmin && ctrl.isEditable" >
2020-07-05 23:21:03 +00:00
< div class = "col-sm-12 form-section-title" >
Resource limits
< / div >
< div >
<!-- memory - limit - input -->
< div class = "form-group" >
< label for = "memory-limit" class = "col-sm-3 col-lg-2 control-label text-left" style = "margin-top: 20px;" >
Memory limit
< / label >
< div class = "col-sm-3" >
< slider
model="ctrl.formValues.MemoryLimit"
floor="ctrl.defaults.MemoryLimit"
ceil="ctrl.state.sliderMaxMemory"
step="128"
ng-if="ctrl.state.sliderMaxMemory"
>< / slider >
< / div >
< div class = "col-sm-2" >
< input
name="memory_limit"
type="number"
min="{{ ctrl.defaults.MemoryLimit }}"
max="{{ ctrl.state.sliderMaxMemory }}"
class="form-control"
ng-model="ctrl.formValues.MemoryLimit"
id="memory-limit"
required
/>
< / div >
< div class = "col-sm-4" >
< p class = "small text-muted" style = "margin-top: 7px;" >
Memory limit (< b > MB< / b > )
< / p >
< / div >
< / div >
< div class = "form-group" ng-show = "resourcePoolEditForm.memory_limit.$invalid" >
< div class = "col-sm-12 small text-warning" >
< div ng-messages = "resourcePoolEditForm.pool_name.$error" >
< p
>< i class = "fa fa-exclamation-triangle" aria-hidden = "true" > < / i > Value must be between {{ ctrl.defaults.MemoryLimit }} and
{{ ctrl.state.sliderMaxMemory }}< /p
>
< / div >
< / div >
< / div >
<!-- !memory - limit - input -->
<!-- cpu - limit - input -->
< div class = "form-group" >
< label for = "cpu-limit" class = "col-sm-3 col-lg-2 control-label text-left" style = "margin-top: 20px;" >
CPU limit
< / label >
< div class = "col-sm-5" >
< slider
model="ctrl.formValues.CpuLimit"
floor="ctrl.defaults.CpuLimit"
ceil="ctrl.state.sliderMaxCpu"
step="0.1"
precision="2"
ng-if="ctrl.state.sliderMaxCpu"
>< / slider >
< / div >
< div class = "col-sm-4" style = "margin-top: 20px;" >
< p class = "small text-muted" >
Maximum CPU usage
< / p >
< / div >
< / div >
<!-- !cpu - limit - input -->
< / div >
< / div >
2020-08-12 23:30:23 +00:00
< div ng-if = "ctrl.formValues.HasQuota" >
2020-07-05 23:21:03 +00:00
< kubernetes-resource-reservation
ng-if="ctrl.pool.Quota"
description="Resource reservation represents the total amount of resource assigned to all the applications deployed inside this resource pool."
cpu="ctrl.state.cpuUsed"
memory="ctrl.state.memoryUsed"
cpu-limit="ctrl.formValues.CpuLimit"
memory-limit="ctrl.formValues.MemoryLimit"
>
< / kubernetes-resource-reservation >
< / div >
2020-08-12 23:30:23 +00:00
< div ng-if = "ctrl.isAdmin && ctrl.isEditable" >
< div class = "col-sm-12 form-section-title" >
Ingresses
< / div >
< div class = "form-group" ng-if = "!ctrl.state.canUseIngress" >
< div class = "col-sm-12 small text-muted" >
The ingress feature must be enabled in the
< a ui-sref = "portainer.endpoints.endpoint.kubernetesConfig({id: ctrl.endpoint.Id})" > endpoint configuration view< / a > to be able to register ingresses inside
this resource pool.
< / div >
< / div >
< div class = "form-group col-sm-12" ng-if = "ctrl.state.canUseIngress" >
< table class = "table" style = "table-layout: fixed;" >
< tbody >
< tr class = "text-muted" >
< td style = "width: 33%; border-top: 0px;" > Ingress controller< / td >
< td style = "width: 66%; border-top: 0px;" >
Hostname
< portainer-tooltip
position="bottom"
message="Optional hostname associated to the ingress inside this resource pool. Users will be able to expose and access their applications over the ingress via this hostname or via IP address directly if not defined."
>
< / portainer-tooltip >
< / td >
< / tr >
< tr ng-repeat = "class in ctrl.formValues.IngressClasses" >
< td style = "width: 33%;" >
< div style = "margin: 5px;" >
< label class = "switch" style = "margin-right: 10px;" > < input type = "checkbox" ng-model = "class.Selected" / > < i > < / i > < / label >
{{ class.Name }}
< / div >
< / td >
< td style = "width: 66%;" >
< input class = "form-control" ng-model = "class.Host" placeholder = "host.com" / >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
< / div >
2020-07-05 23:21:03 +00:00
<!-- actions -->
2020-08-07 00:03:00 +00:00
< div ng-if = "ctrl.isAdmin && ctrl.isEditable" class = "col-sm-12 form-section-title" >
2020-07-05 23:21:03 +00:00
Actions
< / div >
2020-08-07 00:03:00 +00:00
< div ng-if = "ctrl.isAdmin && ctrl.isEditable" class = "form-group" >
2020-07-05 23:21:03 +00:00
< div class = "col-sm-12" >
< button
type="button"
class="btn btn-primary btn-sm"
2020-08-12 23:30:23 +00:00
ng-disabled="!resourcePoolEditForm.$valid || ctrl.state.actionInProgress || (ctrl.formValues.HasQuota & & !ctrl.isQuotaValid())"
2020-07-05 23:21:03 +00:00
ng-click="ctrl.updateResourcePool()"
button-spinner="ctrl.state.actionInProgress"
>
< span ng-hide = "ctrl.state.actionInProgress" > Update resource pool< / span >
< span ng-show = "ctrl.state.actionInProgress" > Update in progress...< / span >
< / button >
< / div >
< / div >
<!-- !actions -->
< / form >
< / uib-tab >
< uib-tab index = "1" classes = "btn-sm" select = "ctrl.selectTab(1)" >
< uib-tab-heading >
< i class = "fa fa-history space-right" aria-hidden = "true" > < / i > Events
< div ng-if = "ctrl.hasEventWarnings()" >
< i class = "fa fa-exclamation-circle orange-icon" aria-hidden = "true" style = "margin-right: 2px;" > < / i >
{{ ctrl.state.eventWarningCount }} warning(s)
< / div >
< / uib-tab-heading >
< kubernetes-events-datatable
title-text="Events"
title-icon="fa-history"
dataset="ctrl.events"
table-key="kubernetes.resourcepool.events"
order-by="Date"
reverse-order="true"
loading="ctrl.state.eventsLoading"
refresh-callback="ctrl.getEvents"
>< / kubernetes-events-datatable >
< / uib-tab >
< uib-tab index = "2" ng-if = "ctrl.pool.Yaml" select = "ctrl.showEditor()" classes = "btn-sm" >
< uib-tab-heading > < i class = "fa fa-code space-right" aria-hidden = "true" > < / i > YAML < / uib-tab-heading >
< div style = "padding-right: 25px;" ng-if = "ctrl.state.showEditorTab" >
< kubernetes-yaml-inspector key = "resource-pool-yaml" data = "ctrl.pool.Yaml" > < / kubernetes-yaml-inspector >
< / div >
< / uib-tab >
< / uib-tabset >
< / rd-widget-body >
< / rd-widget >
< / div >
< / div >
< div class = "row" ng-if = "ctrl.applications && ctrl.applications.length > 0" >
< div class = "col-sm-12" >
< kubernetes-resource-pool-applications-datatable
dataset="ctrl.applications"
table-key="kubernetes.resourcepool.applications"
order-by="Name"
refresh-callback="ctrl.getApplications"
loading="ctrl.state.applicationsLoading"
title-text="Applications running in this resource pool"
title-icon="fa-laptop-code"
>
< / kubernetes-resource-pool-applications-datatable >
< / div >
< / div >
2020-08-12 23:30:23 +00:00
< div class = "row" ng-if = "ctrl.ingresses && ctrl.ingresses.length > 0" >
< div class = "col-sm-12" >
< kubernetes-resource-pool-ingresses-datatable
dataset="ctrl.ingresses"
table-key="kubernetes.resourcepool.ingresses"
order-by="Name"
refresh-callback="ctrl.getIngresses"
loading="ctrl.state.ingressesLoading"
title-text="Ingress routes and applications"
title-icon="fa-route"
>
< / kubernetes-resource-pool-ingresses-datatable >
< / div >
< / div >
2020-07-05 23:21:03 +00:00
< / div >