2021-04-27 08:12:34 +00:00
< kubernetes-view-header title = "Namespace details" state = "kubernetes.resourcePools.resourcePool" view-ready = "ctrl.state.viewReady" >
< a ui-sref = "kubernetes.resourcePools" > Namespaces< / a > > {{ ctrl.pool.Namespace.Name }}
2020-07-05 23:21:03 +00:00
< / 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)" >
2021-04-27 08:12:34 +00:00
< uib-tab-heading > < i class = "fa fa-layer-group space-right" aria-hidden = "true" > < / i > Namespace < / uib-tab-heading >
2020-07-05 23:21:03 +00:00
< 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 >
2021-02-26 15:50:33 +00:00
< div ng-if = "ctrl.formValues.HasQuota" >
< kubernetes-resource-reservation
ng-if="ctrl.pool.Quota"
2021-04-27 08:12:34 +00:00
description="Resource reservation represents the total amount of resource assigned to all the applications deployed inside this namespace."
2021-02-26 15:50:33 +00:00
cpu="ctrl.state.cpuUsed"
memory="ctrl.state.memoryUsed"
cpu-limit="ctrl.formValues.CpuLimit"
memory-limit="ctrl.formValues.MemoryLimit"
>
< / kubernetes-resource-reservation >
< / div >
2020-07-05 23:21:03 +00:00
<!-- !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"
2021-02-26 15:50:33 +00:00
floor="ctrl.ResourceQuotaDefaults.MemoryLimit"
2020-07-05 23:21:03 +00:00
ceil="ctrl.state.sliderMaxMemory"
step="128"
ng-if="ctrl.state.sliderMaxMemory"
>< / slider >
< / div >
< div class = "col-sm-2" >
< input
name="memory_limit"
type="number"
2021-02-26 15:50:33 +00:00
min="{{ ctrl.ResourceQuotaDefaults.MemoryLimit }}"
2020-07-05 23:21:03 +00:00
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
2021-02-26 15:50:33 +00:00
>< i class = "fa fa-exclamation-triangle" aria-hidden = "true" > < / i > Value must be between {{ ctrl.ResourceQuotaDefaults.MemoryLimit }} and
2020-07-05 23:21:03 +00:00
{{ 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"
2021-02-26 15:50:33 +00:00
floor="ctrl.ResourceQuotaDefaults.CpuLimit"
2020-07-05 23:21:03 +00:00
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 >
2021-02-26 15:50:33 +00:00
<!-- #region LOADBALANCERS -->
< div class = "col-sm-12 form-section-title" >
Load balancers
2020-07-05 23:21:03 +00:00
< / div >
2021-02-26 15:50:33 +00:00
< div class = "form-group" >
< span class = "col-sm-12 text-muted small" >
< i class = "fa fa-info-circle blue-icon" aria-hidden = "true" style = "margin-right: 2px;" > < / i >
2021-04-27 08:12:34 +00:00
You can set a quota on the amount of external load balancers that can be created inside this namespace. Set this quota to 0 to effectively disable the use of
load balancers in this namespace.
2021-02-26 15:50:33 +00:00
< / span >
< / div >
< div class = "form-group" >
< div class = "col-sm-12" >
< label class = "control-label text-left" >
Load Balancer quota
< / label >
< label class = "switch" style = "margin-left: 20px;" > < input type = "checkbox" disabled / > < i > < / i > < / label >
< span class = "text-muted small" style = "margin-left: 15px;" >
< i class = "fa fa-user" aria-hidden = "true" > < / i >
This feature is available in < a href = "https://www.portainer.io/business-upsell?from=k8s-resourcepool-lbquota" target = "_blank" > Portainer Business Edition< / a > .
< / span >
< / div >
< / div >
<!-- #endregion -->
2020-08-20 00:51:14 +00:00
< div ng-if = "ctrl.isAdmin && ctrl.isEditable && ctrl.state.canUseIngress" >
2020-08-12 23:30:23 +00:00
< div class = "col-sm-12 form-section-title" >
Ingresses
< / div >
2020-08-20 00:51:14 +00:00
<!-- #region INGRESSES -->
< div class = "form-group" ng-if = "ctrl.formValues.IngressClasses.length === 0" >
2020-08-12 23:30:23 +00:00
< 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
2021-04-27 08:12:34 +00:00
this namespace.
2020-08-12 23:30:23 +00:00
< / div >
< / div >
2020-08-20 00:51:14 +00:00
< div class = "form-group" ng-if = "ctrl.formValues.IngressClasses.length > 0" >
< div class = "col-sm-12 small text-muted" >
< p >
< i class = "fa fa-info-circle blue-icon" aria-hidden = "true" style = "margin-right: 2px;" > < / i >
Enable and configure ingresses available to users when deploying applications.
< / p >
< / div >
< / div >
2021-04-27 17:51:13 +00:00
< div class = "form-group" ng-repeat-start = "ic in ctrl.formValues.IngressClasses track by ic.IngressClass.Name" >
2020-08-20 00:51:14 +00:00
< div class = "text-muted col-sm-12" style = "width: 100%;" >
< div style = "border-bottom: 1px solid #cdcdcd; padding-bottom: 5px;" >
< i class = "fa fa-route" aria-hidden = "true" style = "margin-right: 2px;" > < / i > {{ ic.IngressClass.Name }}
< / div >
< / div >
< div class = "col-sm-12" style = "margin-top: 10px;" >
< label class = "control-label text-left" >
Allow users to use this ingress
< / label >
< label class = "switch" style = "margin-left: 20px;" > < input type = "checkbox" ng-model = "ic.Selected" / > < i > < / i > < / label >
< / div >
< / div >
< div ng-if = "ic.Selected" >
< div class = "form-group" >
2021-04-27 17:51:13 +00:00
< div class = "col-sm-12" >
< label class = "control-label text-left" >
Hostnames
< portainer-tooltip
position="bottom"
2021-04-27 08:12:34 +00:00
message="Hostnames associated to the ingress inside this namespace. Users will be able to expose and access their applications over the ingress via one of these hostname."
2021-04-27 17:51:13 +00:00
>
< / portainer-tooltip >
< / label >
< span class = "label label-default interactive" style = "margin-left: 10px;" ng-click = "ctrl.addHostname(ic)" >
< i class = "fa fa-plus-circle" aria-hidden = "true" > < / i > add hostname
< / span >
2020-08-20 00:51:14 +00:00
< / div >
2021-04-27 17:51:13 +00:00
< div class = "col-sm-12" style = "margin-top: 10px;" >
< div ng-repeat = "item in ic.Hosts track by $index" style = "margin-top: 2px;" >
< div class = "form-inline" >
< div class = "col-sm-10 input-group input-group-sm" ng-class = "{ striked: item.NeedsDeletion }" >
< span class = "input-group-addon" > Hostname< / span >
< input
type="text"
class="form-control"
name="hostname_{{ ic.IngressClass.Name }}_{{ $index }}"
ng-model="item.Host"
ng-change="ctrl.onChangeIngressHostname()"
placeholder="foo"
required
/>
< / div >
< div class = "col-sm-1 input-group input-group-sm" ng-if = "$index > 0" >
< button ng-if = "!item.NeedsDeletion" class = "btn btn-sm btn-danger" type = "button" ng-click = "ctrl.removeHostname(ic, $index)" >
< i class = "fa fa-trash-alt" aria-hidden = "true" > < / i >
< / button >
< button ng-if = "item.NeedsDeletion" class = "btn btn-sm btn-primary" type = "button" ng-click = "ctrl.restoreHostname(item)" >
< i class = "fa fa-trash-restore" aria-hidden = "true" > < / i >
< / button >
< / div >
< / div >
< div
class="small text-warning"
style="margin-top: 5px;"
ng-show="resourcePoolEditForm['hostname_' + ic.IngressClass.Name + '_' + $index].$invalid || item.Duplicate"
>
< ng-messages for = "resourcePoolEditForm['hostname_' + ic.IngressClass.Name + '_' + $index].$error" >
< p ng-message = "required" > < i class = "fa fa-exclamation-triangle" aria-hidden = "true" > < / i > Hostname is required.< / p >
< / ng-messages >
< p ng-if = "item.Duplicate" >
< i class = "fa fa-exclamation-triangle" aria-hidden = "true" > < / i >
This hostname is already used.
< / p >
< / div >
2020-08-20 09:24:12 +00:00
< / div >
2020-08-20 00:51:14 +00:00
< / div >
< / div >
2020-08-20 09:24:12 +00:00
< div class = "form-group" ng-if = "ic.IngressClass.Type === ctrl.IngressClassTypes.NGINX" >
2020-08-20 00:51:14 +00:00
< div class = "col-sm-12" >
< label class = "control-label text-left" >
Redirect published routes to / in application
< portainer-tooltip
position="bottom"
message="Enables the redirection of any route published via ingress to the root path of the application, e.g. /path remaps to /"
>
< / portainer-tooltip >
< / label >
< label class = "switch" style = "margin-left: 20px;" > < input type = "checkbox" ng-model = "ic.RewriteTarget" / > < i > < / i > < / label >
< / div >
< / div >
< / div >
< div ng-repeat-end class = "form-group" ng-if = "ic.Selected" style = "margin-bottom: 20px;" >
< div class = "col-sm-12" >
< p >
< a class = "small interactive" ng-if = "!ic.AdvancedConfig" ng-click = "ic.AdvancedConfig = true" >
< i class = "fa fa-plus space-right" aria-hidden = "true" > < / i > Advanced configuration
< / a >
< a class = "small interactive" ng-if = "ic.AdvancedConfig" ng-click = "ic.AdvancedConfig = false" >
< i class = "fa fa-minus space-right" aria-hidden = "true" > < / i > Hide configuration
< / a >
< / p >
< / div >
< div class = "col-sm-12 small text-muted" ng-if = "ic.AdvancedConfig" style = "margin-top: 5px;" >
< p >
< i class = "fa fa-info-circle blue-icon" aria-hidden = "true" style = "margin-right: 2px;" > < / i >
You can specify a list of annotations that will be associated to the ingress.
< / p >
< / div >
< div class = "col-sm-12" ng-if = "ic.AdvancedConfig" >
< label class = "control-label text-left" > Annotations< / label >
< span class = "label label-default interactive" style = "margin-left: 10px;" ng-click = "ctrl.addAnnotation(ic)" >
< i class = "fa fa-plus-circle" aria-hidden = "true" > < / i > add annotation
< / span >
< / div >
< div class = "col-sm-12 form-inline" style = "margin-top: 10px;" ng-if = "ic.AdvancedConfig" >
< div ng-repeat = "annotation in ic.Annotations track by $index" style = "margin-top: 2px;" >
< div class = "input-group col-sm-5 input-group-sm" >
< span class = "input-group-addon" > Key< / span >
< input type = "text" class = "form-control" ng-model = "annotation.Key" placeholder = "nginx.ingress.kubernetes.io/rewrite-target" required / >
< / div >
< div class = "input-group col-sm-5 input-group-sm" >
< span class = "input-group-addon" > Value< / span >
< input type = "text" class = "form-control" ng-model = "annotation.Value" placeholder = "/$1" required / >
< / div >
< div class = "col-sm-1 input-group input-group-sm" >
< button class = "btn btn-sm btn-danger" type = "button" ng-click = "ctrl.removeAnnotation(ic, $index)" >
< i class = "fa fa-trash-alt" aria-hidden = "true" > < / i >
< / button >
< / div >
< / div >
< / div >
2020-08-12 23:30:23 +00:00
< / div >
2020-08-20 00:51:14 +00:00
<!-- #endregion -->
2020-08-12 23:30:23 +00:00
< / div >
2021-07-14 09:15:21 +00:00
<!-- #region REGISTRIES -->
< div >
< div class = "col-sm-12 form-section-title" >
Registries
< / div >
< div class = "form-group" ng-if = "!ctrl.isAdmin" >
< label class = "col-sm-3 col-lg-2 control-label text-left" style = "padding-top: 0;" >
Selected registries
< / label >
< div class = "col-sm-9 col-lg-4" >
{{ ctrl.selectedRegistries }}
< / div >
< / div >
< div ng-if = "ctrl.isAdmin" >
< div class = "form-group" >
< div class = "col-sm-12 small text-muted" >
< p >
< i class = "fa fa-info-circle blue-icon" aria-hidden = "true" style = "margin-right: 2px;" > < / i >
Define which registry can be used by users who have access to this namespace.
< / p >
< / div >
< / div >
< div class = "form-group" >
< label class = "col-sm-3 col-lg-2 control-label text-left" style = "padding-top: 0;" >
Select registries
< / label >
< div class = "col-sm-9 col-lg-4" >
< span class = "small text-muted" ng-if = "!ctrl.registries.length && ctrl.state.isAdmin" >
No registries available. Head over < a ui-sref = "portainer.registries" > registry view< / a > to define container registry.
< / span >
< span class = "small text-muted" ng-if = "!ctrl.registries.length && !ctrl.state.isAdmin" >
No registries available. Contact your administrator to create a container registry.
< / span >
< span
isteven-multi-select
ng-if="ctrl.registries.length"
input-model="ctrl.registries"
output-model="ctrl.formValues.Registries"
button-label="Name"
item-label="Name"
tick-property="Checked"
helper-elements="filter"
search-property="Name"
translation="{nothingSelected: 'Select one or more registry', search: 'Search...'}"
>
< / span >
< / div >
< / div >
< / div >
< / div >
<!-- #endregion -->
2021-02-26 15:50:33 +00:00
<!-- #region STORAGES -->
2020-12-14 01:31:59 +00:00
< div class = "col-sm-12 form-section-title" >
Storages
< / div >
< div class = "form-group" >
< span class = "col-sm-12 text-muted small" >
< i class = "fa fa-info-circle blue-icon" aria-hidden = "true" style = "margin-right: 2px;" > < / i >
Quotas can be set on each storage option to prevent users from exceeding a specific threshold when deploying applications. You can set a quota to 0 to
2021-04-27 08:12:34 +00:00
effectively prevent the usage of a specific storage option inside this namespace.
2020-12-14 01:31:59 +00:00
< / span >
< / div >
< div class = "col-sm-12 form-section-title" >
< i class = "fa fa-route" aria-hidden = "true" style = "margin-right: 2px;" > < / i >
standard
< / div >
< div class = "form-group" >
< div class = "col-sm-12" >
< label class = "control-label text-left" >
Enable quota
< / label >
< label class = "switch" style = "margin-left: 20px;" > < input type = "checkbox" disabled / > < i > < / i > < / label >
< span class = "text-muted small" style = "margin-left: 15px;" >
< i class = "fa fa-user" aria-hidden = "true" > < / i >
This feature is available in
< a href = "https://www.portainer.io/business-upsell?from=k8s-resourcepool-storagequota" target = "_blank" > Portainer Business Edition< / a > .
< / span >
< / div >
< / div >
<!-- #endregion -->
2021-06-09 22:38:23 +00:00
<!-- summary -->
< kubernetes-summary-view
ng-if="resourcePoolEditForm.$valid & & !ctrl.isUpdateButtonDisabled()"
form-values="ctrl.formValues"
old-form-values="ctrl.savedFormValues"
>< / kubernetes-summary-view >
<!-- !summary -->
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-20 00:51:14 +00:00
ng-disabled="!resourcePoolEditForm.$valid || ctrl.isUpdateButtonDisabled()"
2020-07-05 23:21:03 +00:00
ng-click="ctrl.updateResourcePool()"
button-spinner="ctrl.state.actionInProgress"
>
2021-04-27 08:12:34 +00:00
< span ng-hide = "ctrl.state.actionInProgress" > Update namespace< / span >
2020-07-05 23:21:03 +00:00
< 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"
2021-04-27 08:12:34 +00:00
title-text="Applications running in this namespace"
2020-07-05 23:21:03 +00:00
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 >