2022-07-06 06:08:45 +00:00
< page-header
ng-if="ctrl.state.viewReady"
title="'Kubernetes features configuration'"
breadcrumbs="[
{ label:'Environments', link:'portainer.endpoints' },
{
label:ctrl.endpoint.Name,
link: 'portainer.endpoints.endpoint',
linkParams:{id: ctrl.endpoint.Id}
},
'Kubernetes configuration'
]"
reload="true"
>
< / page-header >
2020-07-05 23:21:03 +00:00
< 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 >
2020-08-17 00:27:06 +00:00
< form class = "form-horizontal" name = "kubernetesClusterSetupForm" >
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Networking < / div >
2020-08-04 22:08:11 +00:00
2020-07-05 23:21:03 +00:00
< div class = "form-group" >
< span class = "col-sm-12 text-muted small" >
2020-08-12 23:30:23 +00:00
Enabling the load balancer feature will allow users to expose application they deploy over an external IP address assigned by cloud provider.
2022-01-17 05:53:32 +00:00
< p style = "margin-top: 2px" >
< i class = "fa fa-exclamation-circle orange-icon" aria-hidden = "true" style = "margin-right: 2px" > < / i >
2020-07-05 23:21:03 +00:00
Ensure that your cloud provider allows you to create load balancers if you want to use this feature. Might incur costs.
< / p >
< / span >
2020-08-17 00:27:06 +00:00
2020-07-05 23:21:03 +00:00
< div class = "col-sm-12" >
2022-01-17 05:53:32 +00:00
< label class = "control-label text-left" > Allow users to use external load balancer < / label >
< label class = "switch" style = "margin-left: 20px" >
2021-09-24 01:00:55 +00:00
< input type = "checkbox" ng-model = "ctrl.formValues.UseLoadBalancer" / > < i data-cy = "kubeSetup-loadBalancerToggle" > < / i >
< / label >
2020-07-05 23:21:03 +00:00
< / div >
2020-08-04 22:08:11 +00:00
< / div >
2020-08-12 23:30:23 +00:00
< div class = "form-group" >
< span class = "col-sm-12 text-muted small" >
2021-01-10 23:51:46 +00:00
Configuring ingress controllers will allow users to expose application they deploy over a HTTP route.< br / >
2022-01-17 05:53:32 +00:00
< p style = "margin-top: 2px" >
< i class = "fa fa-exclamation-circle orange-icon" aria-hidden = "true" style = "margin-right: 2px" > < / i >
2020-08-20 00:51:14 +00:00
Ingress classes must be manually specified for each controller you want to use in the cluster. Make sure that each controller is running inside your cluster.
2020-08-12 23:30:23 +00:00
< / p >
< / span >
2020-08-20 00:51:14 +00:00
< / div >
< div class = "form-group" >
2020-08-12 23:30:23 +00:00
< div class = "col-sm-12" >
2020-08-20 00:51:14 +00:00
< label class = "control-label text-left" > Ingress controller< / label >
2022-01-17 05:53:32 +00:00
< span class = "label label-default interactive" style = "margin-left: 10px" ng-click = "ctrl.addIngressClass()" data-cy = "kubeSetup-congifIngressButton" >
2021-01-10 23:51:46 +00:00
< i class = "fa fa-plus-circle" aria-hidden = "true" > < / i > configure ingress controller
2020-08-20 00:51:14 +00:00
< / span >
2020-08-12 23:30:23 +00:00
< / div >
2020-08-17 00:27:06 +00:00
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-inline" style = "margin-top: 10px" >
< div ng-repeat-start = "ingressClass in ctrl.formValues.IngressClasses" style = "margin-top: 2px" >
2020-08-20 00:51:14 +00:00
< div class = "col-sm-7 input-group input-group-sm" ng-class = "{ striked: ingressClass.NeedsDeletion }" >
< span class = "input-group-addon" > Ingress class< / span >
< input
type="text"
class="form-control"
name="ingress_class_name_{{ $index }}"
ng-model="ingressClass.Name"
placeholder="nginx"
ng-pattern="/^[a-z]([-a-z0-9]*[a-z0-9])?$/"
ng-change="ctrl.onChangeIngressClassName($index)"
required
2021-09-24 01:00:55 +00:00
data-cy="kubeSetup-ingressClassName"
2020-08-20 00:51:14 +00:00
/>
< / div >
< div class = "col-sm-3 input-group input-group-sm" ng-class = "{ striked: ingressClass.NeedsDeletion }" >
< span class = "input-group-addon" > Type< / span >
< select
class="form-control"
name="ingress_class_type_{{ $index }}"
ng-model="ingressClass.Type"
ng-options="value as value for (key, value) in ctrl.IngressClassTypes"
required
2021-09-24 01:00:55 +00:00
data-cy="kubeSetup-ingressType"
2020-08-20 00:51:14 +00:00
>
< option selected disabled hidden value = "" > Select a type< / option >
< / select >
< / div >
< div class = "col-sm-1 input-group input-group-sm" >
2021-09-24 01:00:55 +00:00
< button
ng-if="!ingressClass.NeedsDeletion"
class="btn btn-sm btn-danger"
type="button"
ng-click="ctrl.removeIngressClass($index)"
data-cy="kubeSetup-deleteIngress"
>
2020-08-20 00:51:14 +00:00
< i class = "fa fa-trash-alt" aria-hidden = "true" > < / i >
< / button >
< button ng-if = "ingressClass.NeedsDeletion" class = "btn btn-sm btn-primary" type = "button" ng-click = "ctrl.restoreIngressClass($index)" >
< i class = "fa fa-trash-restore" aria-hidden = "true" > < / i >
< / button >
< / div >
< / div >
2020-08-17 00:27:06 +00:00
2020-08-20 00:51:14 +00:00
< div
ng-repeat-end
ng-show="
kubernetesClusterSetupForm['ingress_class_name_' + $index].$invalid ||
kubernetesClusterSetupForm['ingress_class_type_' + $index].$invalid ||
ctrl.state.duplicates.ingressClasses.refs[$index] !== undefined
"
>
< div class = "col-sm-7 input-group" >
< div
class="small text-warning"
2022-01-17 05:53:32 +00:00
style="margin-top: 5px"
2020-08-20 00:51:14 +00:00
ng-if="kubernetesClusterSetupForm['ingress_class_name_' + $index].$invalid || ctrl.state.duplicates.ingressClasses.refs[$index] !== undefined"
>
< div ng-messages = "kubernetesClusterSetupForm['ingress_class_name_'+$index].$error" >
< p ng-message = "required" > < i class = "fa fa-exclamation-triangle" aria-hidden = "true" > < / i > Ingress class name is required.< / p >
< p ng-message = "pattern"
>< i class = "fa fa-exclamation-triangle" aria-hidden = "true" > < / i > This field must consist of lower case alphanumeric characters or '-', start with an
alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123').< /p
>
< / div >
< p ng-if = "ctrl.state.duplicates.ingressClasses.refs[$index] !== undefined" >
< i class = "fa fa-exclamation-triangle" aria-hidden = "true" > < / i > This ingress class is already defined.
< / p >
< / div >
< / div >
< div class = "col-sm-3 input-group" >
2022-01-17 05:53:32 +00:00
< div class = "small text-warning" style = "margin-top: 5px" ng-if = "kubernetesClusterSetupForm['ingress_class_type_' + $index].$invalid" >
2020-08-20 00:51:14 +00:00
< div ng-messages = "kubernetesClusterSetupForm['ingress_class_type_'+$index].$error" >
< p ng-message = "required" > < i class = "fa fa-exclamation-triangle" aria-hidden = "true" > < / i > Ingress class type is required.< / p >
< / div >
< / div >
< / div >
2020-08-17 00:27:06 +00:00
< / div >
2020-08-12 23:30:23 +00:00
< / div >
< / div >
2020-08-20 09:24:12 +00:00
< div class = "form-group" ng-if = "ctrl.hasTraefikIngress()" >
< span class = "col-sm-12 text-muted small" >
< p >
2022-01-17 05:53:32 +00:00
< i class = "fa fa-flask blue-icon" aria-hidden = "true" style = "margin-right: 2px" > < / i >
2020-08-20 09:24:12 +00:00
Traefik support is experimental.
< / p >
< / span >
< / div >
2021-11-02 20:57:21 +00:00
<!-- auto update window -->
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Change Window Setting < / div >
2021-11-02 20:57:21 +00:00
< div class = "form-group" >
< div class = "col-sm-12" >
< por-switch-field
2021-12-14 19:14:53 +00:00
checked="ctrl.state.autoUpdateSettings.Enabled"
name="'disableSysctlSettingForRegularUsers'"
label="'Enable Change Window'"
feature-id="ctrl.limitedFeatureAutoWindow"
tooltip="'Specify a timeframe during which automatic updates can occur in this environment.'"
on-change="(ctrl.onToggleAutoUpdate)"
2021-11-02 20:57:21 +00:00
>
< / por-switch-field >
< / div >
< / div >
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Security < / div >
2020-12-14 01:31:59 +00:00
< div class = "form-group" >
< span class = "col-sm-12 text-muted small" >
By default, all the users have access to the default namespace. Enable this option to set accesses on the default namespace.
< / span >
< / div >
< div class = "form-group" >
< div class = "col-sm-12" >
2022-01-17 05:53:32 +00:00
< label class = "control-label text-left" > Restrict access to the default namespace < / label >
< label class = "switch" style = "margin-left: 20px" >
2021-09-24 01:00:55 +00:00
< input type = "checkbox" ng-model = "ctrl.formValues.RestrictDefaultNamespace" / > < i data-cy = "kubeSetup-restrictDefaultNsToggle" > < / i >
< / label >
2020-12-14 01:31:59 +00:00
< / div >
< / div >
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Resources and Metrics < / div >
2020-12-14 01:31:59 +00:00
< div class = "form-group" >
< span class = "col-sm-12 text-muted small" >
By ENABLING resource over-commit, you are able to assign more resources to namespaces than is physically available in the cluster. This may lead to unexpected
deployment failures if there is insufficient resource to service demand.
2022-01-17 05:53:32 +00:00
< p style = "margin-top: 2px" >
< i class = "fa fa-exclamation-circle orange-icon" aria-hidden = "true" style = "margin-right: 2px" > < / i >
2020-12-14 01:31:59 +00:00
By DISABLING resource over-commit (highly recommended), you are only able to assign resources to namespaces that are less (in aggregate) than the cluster total
minus any system resource reservation.
< / p >
< / span >
< / div >
< div class = "form-group" >
< div class = "col-sm-12" >
2021-10-06 06:24:26 +00:00
< por-switch-field
2021-12-14 19:14:53 +00:00
data-cy="'kubeSetup-resourceOverCommitToggle'"
label="'Allow resource over-commit'"
name="'resource-over-commit-switch'"
feature-id="ctrl.limitedFeature"
checked="ctrl.formValues.EnableResourceOverCommit"
on-change="(ctrl.onChangeEnableResourceOverCommit)"
2021-10-06 06:24:26 +00:00
>< / por-switch-field >
2020-12-14 01:31:59 +00:00
< / div >
2020-08-04 22:08:11 +00:00
< / div >
< div class = "form-group" >
< span class = "col-sm-12 text-muted small" >
2021-08-11 13:03:10 +00:00
Enabling this feature will allow users to use specific features like autoscaling and to see container and node resource usage.
2022-01-17 05:53:32 +00:00
< p style = "margin-top: 2px" >
< i class = "fa fa-exclamation-circle orange-icon" aria-hidden = "true" style = "margin-right: 2px" > < / i >
2021-08-11 13:03:10 +00:00
Ensure that < a href = "https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/#metrics-server" target = "_blank" > metrics server< / a > or
< a href = "https://github.com/kubernetes-sigs/prometheus-adapter" target = "_blank" > prometheus< / a > is running inside your cluster.
2020-08-04 22:08:11 +00:00
< / p >
< / span >
< / div >
< div class = "form-group" >
< div class = "col-sm-12" >
2022-01-17 05:53:32 +00:00
< label class = "control-label text-left" > Enable features using the metrics API < / label >
< label class = "switch" style = "margin-left: 20px" >
2021-09-24 01:00:55 +00:00
< input type = "checkbox" ng-model = "ctrl.formValues.UseServerMetrics" ng-change = "ctrl.enableMetricsServer()" / > < i data-cy = "kubeSetup-metricsToggle" > < / i >
2021-04-29 01:10:14 +00:00
< / label >
< / div >
2022-01-17 05:53:32 +00:00
< div ng-if = "ctrl.state.metrics.pending && ctrl.state.metrics.userClick" class = "col-sm-12 small text-muted" style = "margin-top: 5px" >
Checking metrics API... < i class = "fa fa-spinner fa-spin" style = "margin-left: 2px" > < / i >
2021-04-29 01:10:14 +00:00
< / div >
< div
ng-if="!ctrl.state.metrics.pending & & ctrl.state.metrics.isServerRunning & & ctrl.state.metrics.userClick"
class="col-sm-12 small text-muted"
2022-01-17 05:53:32 +00:00
style="margin-top: 5px"
2021-04-29 01:10:14 +00:00
>
2022-01-17 05:53:32 +00:00
< i class = "fa fa-check green-icon" aria-hidden = "true" style = "margin-right: 2px" > < / i > Successfully reached metrics API
2021-04-29 01:10:14 +00:00
< / div >
< div
ng-if="!ctrl.state.metrics.pending & & !ctrl.state.metrics.isServerRunning & & ctrl.state.metrics.userClick"
class="col-sm-12 small text-muted"
2022-01-17 05:53:32 +00:00
style="margin-top: 5px"
2021-04-29 01:10:14 +00:00
>
2022-01-17 05:53:32 +00:00
< i class = "fa fa-times red-icon" aria-hidden = "true" style = "margin-right: 2px" > < / i > Unable to reach metrics API, make sure metrics server is properly deployed inside
2021-04-29 01:10:14 +00:00
that cluster.
2020-08-04 22:08:11 +00:00
< / div >
2020-07-05 23:21:03 +00:00
< / div >
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Available storage options < / div >
2020-07-05 23:21:03 +00:00
< div class = "form-group" ng-if = "!ctrl.storageClassAvailable()" >
< div class = "col-sm-12 small text-muted" >
2022-01-17 05:53:32 +00:00
< i class = "fa fa-exclamation-circle orange-icon" aria-hidden = "true" style = "margin-right: 2px" > < / i >
2020-07-05 23:21:03 +00:00
Unable to detect any storage class available to persist data. Users won't be able to persist application data inside this cluster.
< / div >
< / div >
< div class = "form-group" ng-if = "ctrl.storageClassAvailable()" >
< span class = "col-sm-12 text-muted small" >
< p >
Select which storage options will be available for use when deploying applications. Have a look at your storage driver documentation to figure out which access
2020-08-07 04:40:24 +00:00
policy to configure and if the volume expansion capability is supported.
2020-07-05 23:21:03 +00:00
< / p >
< p >
You can find more information about access modes
< a href = "https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" target = "_blank" > in the official Kubernetes documentation< / a > .
< / p >
< / span >
< / div >
< div class = "form-group" ng-if = "ctrl.storageClassAvailable()" >
2022-01-17 05:53:32 +00:00
< div style = "margin-top: 10px" class = "col-sm-12" >
< table class = "table" style = "table-layout: fixed" >
2020-07-05 23:21:03 +00:00
< tbody >
< tr class = "text-muted" >
< td > Storage< / td >
< td > Shared access policy< / td >
2020-08-07 04:40:24 +00:00
< td > Volume expansion< / td >
2020-07-05 23:21:03 +00:00
< / tr >
< tr ng-repeat = "class in ctrl.StorageClasses" >
< td >
2022-01-17 05:53:32 +00:00
< div style = "margin: 5px" >
< label class = "switch" style = "margin-right: 10px" >
2021-09-24 01:00:55 +00:00
< input type = "checkbox" ng-model = "class.selected" / > < i data-cy = "kubeSetup-storageToggle{{ class.Name }}" > < / i >
< / label >
2020-07-05 23:21:03 +00:00
< span > {{ class.Name }}< / span >
< / div >
< / td >
< td >
< span
isteven-multi-select
input-model="class.availableAccessModes"
output-model="class.AccessModes"
button-label="Name"
item-label="Description"
tick-property="selected"
directive-id="{{ class.Name }}"
helper-elements=""
translation="{nothingSelected: 'Not configured'}"
2021-09-24 01:00:55 +00:00
data-cy="kubeSetup-storageAccessSelect{{ class.Name }}"
2020-07-05 23:21:03 +00:00
>
< / span >
< / td >
2020-08-07 04:40:24 +00:00
< td >
2022-01-17 05:53:32 +00:00
< div style = "margin: 5px" >
2021-09-24 01:00:55 +00:00
< label class = "switch"
>< input type = "checkbox" ng-model = "class.AllowVolumeExpansion" / > < i data-cy = "kubeSetup-storageExpansionToggle{{ class.Name }}" > < / i >
< / label >
2020-08-07 04:40:24 +00:00
< / div >
< / td >
2020-07-05 23:21:03 +00:00
< / tr >
< / tbody >
< / table >
< / div >
< div class = "col-sm-12" >
2022-01-17 05:53:32 +00:00
< span ng-if = "!ctrl.hasValidStorageConfiguration()" style = "margin-left: 5px" class = "text-muted small" >
< i class = "fa fa-exclamation-circle orange-icon" aria-hidden = "true" style = "margin-right: 2px" > < / i >
2020-07-05 23:21:03 +00:00
Shared access policy configuration required
< / span >
< / div >
< / div >
2022-01-17 05:53:32 +00:00
< div class = "col-sm-12 form-section-title" > Actions < / div >
2020-07-05 23:21:03 +00:00
<!-- actions -->
< div class = "form-group" >
< div class = "col-sm-12" >
< button
type="submit"
class="btn btn-primary btn-sm"
ng-click="ctrl.configure()"
2020-08-17 00:27:06 +00:00
ng-disabled="ctrl.state.actionInProgress || !kubernetesClusterSetupForm.$valid || !ctrl.hasValidStorageConfiguration()"
2020-07-05 23:21:03 +00:00
button-spinner="ctrl.state.actionInProgress"
2021-09-05 10:03:48 +00:00
analytics-on
analytics-if="ctrl.restrictDefaultToggledOn()"
analytics-category="kubernetes"
analytics-event="kubernetes-configure"
analytics-properties="{ metadata: { restrictAccessToDefaultNamespace: ctrl.formValues.RestrictDefaultNamespace } }"
2021-09-24 01:00:55 +00:00
data-cy="kubeSetup-saveConfigurationButton"
2020-07-05 23:21:03 +00:00
>
< span ng-hide = "ctrl.state.actionInProgress" > Save configuration< / span >
< span ng-show = "ctrl.state.actionInProgress" > Saving configuration...< / span >
< / button >
< / div >
< / div >
< / form >
< / rd-widget-body >
< / rd-widget >
< / div >
< / div >
< / div >