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' },
2022-08-12 18:22:45 +00:00
{
2022-07-06 06:08:45 +00:00
label:ctrl.endpoint.Name,
2022-08-12 18:22:45 +00:00
link: 'portainer.endpoints.endpoint',
2022-07-06 06:08:45 +00:00
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" >
2022-07-22 02:16:50 +00:00
< div class = "col-sm-12 text-muted small" >
< p > Enabling the load balancer feature will allow users to expose application they deploy over an external IP address assigned by cloud provider. < / p >
< p class = "mt-1 vertical-center" >
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'alert-circle'" mode = "'warning'" > < / pr-icon >
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 >
2022-07-22 02:16:50 +00:00
< / div >
2020-08-17 00:27:06 +00:00
2020-07-05 23:21:03 +00:00
< div class = "col-sm-12" >
2022-08-12 18:22:45 +00:00
< label class = "control-label text-left col-sm-5 col-lg-4 px-0" > Allow users to use external load balancer < / label >
2022-09-26 19:43:24 +00:00
< label class = "switch col-sm-8 mb-0" >
2022-07-22 02:16:50 +00:00
< input type = "checkbox" ng-model = "ctrl.formValues.UseLoadBalancer" / > < span class = "slider round" data-cy = "kubeSetup-loadBalancerToggle" > < / span >
2021-09-24 01:00:55 +00:00
< / label >
2020-07-05 23:21:03 +00:00
< / div >
2020-08-04 22:08:11 +00:00
< / div >
2022-09-26 19:43:24 +00:00
< ingress-class-datatable
2022-10-24 20:41:30 +00:00
on-change-controllers="(ctrl.onChangeControllers)"
allow-none-ingress-class="ctrl.formValues.AllowNoneIngressClass"
2022-09-26 19:43:24 +00:00
ingress-controllers="ctrl.originalIngressControllers"
2022-10-03 23:13:56 +00:00
is-loading="ctrl.isIngressControllersLoading"
2022-09-26 19:43:24 +00:00
description="'Enabling ingress controllers in your cluster allows them to be available in the Portainer UI for users to publish applications over HTTP/HTTPS. A controller must have a class name for it to be included here.'"
no-ingress-controller-label="'No supported ingress controllers found.'"
view="'cluster'"
>< / ingress-class-datatable >
2022-10-24 20:41:30 +00:00
< label htmlFor = "foldingButtonIngControllerSettings" class = "col-sm-12 form-section-title cursor-pointer flex items-center" >
< button
id="foldingButtonIngControllerSettings"
type="button"
class="border-0 mx-2 bg-transparent inline-flex justify-center items-center w-2 !ml-0"
ng-click="ctrl.toggleAdvancedIngSettings()"
>
2022-11-28 02:00:28 +00:00
< pr-icon ng-if = "!ctrl.state.isIngToggleSectionExpanded" icon = "'chevron-right'" > < / pr-icon >
< pr-icon ng-if = "ctrl.state.isIngToggleSectionExpanded" icon = "'chevron-down'" > < / pr-icon >
2022-10-24 20:41:30 +00:00
< / button >
More settings
< / label >
< div ng-if = "ctrl.state.isIngToggleSectionExpanded" class = "ml-4" >
< div class = "form-group" >
< div class = "col-sm-12" >
< por-switch-field
checked="ctrl.formValues.AllowNoneIngressClass"
name="'allowNoIngressClass'"
label="'Allow ingress class to be set to " none" '"
tooltip="'This allows users setting up ingresses to select " none" as the ingress class.'"
on-change="(ctrl.onToggleAllowNoneIngressClass)"
label-class="'col-sm-5 col-lg-4 px-0 !m-0'"
switch-class="'col-sm-8'"
>
< / por-switch-field >
< / div >
< / div >
< div class = "form-group" >
< div class = "col-sm-12" >
< por-switch-field
checked="ctrl.formValues.IngressAvailabilityPerNamespace"
name="'ingressAvailabilityPerNamespace'"
label="'Configure ingress controller availability per namespace'"
tooltip="'This allows an administrator to configure, in each namespace, which ingress controllers will be available for users to select when setting up ingresses for applications.'"
on-change="(ctrl.onToggleIngressAvailabilityPerNamespace)"
label-class="'col-sm-5 col-lg-4 px-0 !m-0'"
switch-class="'col-sm-8'"
>
< / por-switch-field >
< / div >
2020-08-12 23:30:23 +00:00
< / div >
< / div >
2021-11-02 20:57:21 +00:00
<!-- auto update window -->
2022-07-22 02:16:50 +00:00
< div class = "col-sm-12 form-section-title" > Change Window Settings < / 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"
2022-09-26 19:43:24 +00:00
tooltip="'Automatic updates to stacks or applications outside the defined change window will not occur.'"
2021-12-14 19:14:53 +00:00
on-change="(ctrl.onToggleAutoUpdate)"
2022-08-12 18:22:45 +00:00
label-class="'col-sm-5 col-lg-4 px-0 !m-0'"
2022-09-14 23:09:19 +00:00
switch-class="'col-sm-8 text-muted'"
2021-11-02 20:57:21 +00:00
>
< / por-switch-field >
< / div >
< / div >
2022-07-22 02:16:50 +00:00
< time-window-picker ng-show = "ctrl.state.autoUpdateSettings.Enabled" time-window = "ctrl.state.autoUpdateSettings" time-zone = "ctrl.state.timeZone" > < / time-window-picker >
<!-- #region SECURITY -->
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
2022-12-07 02:53:06 +00:00
< div
ng-if="!ctrl.isRBACEnabled"
class="mt-1 mb-6 p-4 w-full border border-solid bg-warning-2 border-warning-5 text-warning-8 th-dark:bg-yellow-11 th-dark:text-white th-highcontrast:bg-yellow-11 th-highcontrast:text-white small flex gap-1 rounded-lg"
>
< div class = "mt-0.5" >
< pr-icon icon = "'alert-triangle'" feather = "true" class-name = "'text-warning-7 th-dark:text-white th-highcontrast:text-white'" > < / pr-icon >
< / div >
< div >
< p > Your cluster does not have Kubernetes role-based access control (RBAC) enabled. < / p >
< p > This means you can't use Portainer RBAC functionality to regulate access to environment resources based on user roles. < / p >
< p class = "mb-0" >
To enable RBAC, start the < a
class="th-dark:text-blue-7 th-highcontrast:text-blue-4"
href="https://kubernetes.io/docs/concepts/overview/components/#kube-apiserver"
target="_blank"
>API server< /a
> with the < code class = "box-decoration-clone bg-gray-4 th-dark:bg-black th-highcontrast:bg-black" > --authorization-mode< / code > flag set to a
comma-separated list that includes < code class = "bg-gray-4 th-dark:bg-black th-highcontrast:bg-black" > RBAC< / code > , for example:
< code class = "box-decoration-clone bg-gray-4 th-dark:bg-black th-highcontrast:bg-black" > kube-apiserver --authorization-mode=Example1,RBAC,Example2< / code > .
< / p >
< / div >
< / 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 >
2022-07-22 02:16:50 +00:00
2020-12-14 01:31:59 +00:00
< div class = "form-group" >
< div class = "col-sm-12" >
2022-12-07 02:53:06 +00:00
< por-switch-field
checked="ctrl.formValues.RestrictDefaultNamespace"
name="'restrictDefaultNs'"
label="'Restrict access to the default namespace'"
on-change="(ctrl.onToggleRestrictNs)"
label-class="'col-sm-5 col-lg-4 px-0 !m-0'"
switch-class="'col-sm-8 text-muted'"
data-cy="kubeSetup-restrictDefaultNsToggle"
disabled="!ctrl.isRBACEnabled"
>
< / por-switch-field >
2020-12-14 01:31:59 +00:00
< / div >
2022-11-15 07:57:01 +00:00
< div class = "col-sm-12 mt-5" >
< por-switch-field
name="'restrictStandardUserIngressW'"
2022-12-04 21:47:56 +00:00
label="'Only allow admins to deploy ingresses'"
2022-11-15 07:57:01 +00:00
tooltip="'Enforces only allowing admins to deploy ingresses (and disallows standard users from doing so).'"
label-class="'col-sm-5 col-lg-4 px-0 !m-0'"
switch-class="'col-sm-8 text-muted'"
data-cy="kubeSetup-restrictStandardUserIngressWToggle"
feature-id="ctrl.limitedFeatureIngressDeploy"
2022-12-07 02:53:06 +00:00
disabled="!ctrl.isRBACEnabled"
2022-11-15 07:57:01 +00:00
>< / por-switch-field >
< / div >
2020-12-14 01:31:59 +00:00
< / div >
2022-07-22 02:16:50 +00:00
<!-- #endregion -->
2020-12-14 01:31:59 +00:00
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" >
2022-07-22 02:16:50 +00:00
< div class = "col-sm-12 text-muted small" >
< p >
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.
< / p >
< p class = "mt-1 vertical-center" >
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'alert-circle'" mode = "'warning'" > < / pr-icon >
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 >
2022-07-22 02:16:50 +00:00
< / div >
2020-12-14 01:31:59 +00:00
< 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)"
2022-08-12 18:22:45 +00:00
label-class="'col-sm-5 col-lg-4 px-0 !m-0'"
2022-07-22 02:16:50 +00:00
switch-class="'col-sm-8'"
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" >
2022-07-22 02:16:50 +00:00
< div class = "col-sm-12 text-muted small" >
< p > Enabling this feature will allow users to use specific features like autoscaling and to see container and node resource usage. < / p >
< p class = "vertical-center mt-1" >
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'alert-circle'" mode = "'warning'" > < / pr-icon >
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 >
2022-07-22 02:16:50 +00:00
< / div >
2020-08-04 22:08:11 +00:00
< / div >
< div class = "form-group" >
< div class = "col-sm-12" >
2022-08-12 18:22:45 +00:00
< label class = "control-label text-left col-sm-5 col-lg-4 px-0" > Enable features using the metrics API < / label >
2022-07-22 02:16:50 +00:00
< label class = "switch col-sm-8" >
< input type = "checkbox" ng-model = "ctrl.formValues.UseServerMetrics" ng-change = "ctrl.enableMetricsServer()" / >
< span class = "slider round" data-cy = "kubeSetup-metricsToggle" > < / span >
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" >
2022-11-28 02:00:28 +00:00
Checking metrics API... < pr-icon icon = "'loader'" class-name = "'ml-0.5'" > < / pr-icon >
2021-04-29 01:10:14 +00:00
< / div >
< div
ng-if="!ctrl.state.metrics.pending & & ctrl.state.metrics.isServerRunning & & ctrl.state.metrics.userClick"
2022-07-22 02:16:50 +00:00
class="col-sm-12 small text-muted vertical-center"
2022-01-17 05:53:32 +00:00
style="margin-top: 5px"
2021-04-29 01:10:14 +00:00
>
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'check'" mode = "'success'" > < / pr-icon > 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"
2022-07-22 02:16:50 +00:00
class="col-sm-12 small text-muted vertical-center mt-2"
2021-04-29 01:10:14 +00:00
>
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'x'" mode = "'danger'" > < / pr-icon > Unable to reach metrics API, make sure metrics server is properly deployed inside 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()" >
2022-07-22 02:16:50 +00:00
< div class = "col-sm-12 small text-muted vertical-center" >
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'alert-circle'" mode = "'warning'" > < / pr-icon >
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-09-28 21:26:25 +00:00
< div class = "flex flex-row items-center h-full" >
2022-07-22 02:16:50 +00:00
< label class = "switch mr-2 mb-0" >
< input type = "checkbox" ng-model = "class.selected" / > < span class = "slider round" data-cy = "kubeSetup-storageToggle{{ class.Name }}" > < / span >
2021-09-24 01:00:55 +00:00
< / label >
2020-07-05 23:21:03 +00:00
< span > {{ class.Name }}< / span >
< / div >
< / td >
< td >
2022-09-21 07:10:58 +00:00
< storage-access-mode-selector
options="ctrl.availableAccessModes"
value="class.AccessModes"
on-change="(ctrl.onChangeStorageClassAccessMode)"
storage-class-name="class.Name"
>< / storage-access-mode-selector >
2020-07-05 23:21:03 +00:00
< / td >
2020-08-07 04:40:24 +00:00
< td >
2022-09-28 21:26:25 +00:00
< div class = "flex flex-row items-center h-full" >
2022-07-22 02:16:50 +00:00
< label class = "switch mr-2 mb-0"
>< input type = "checkbox" ng-model = "class.AllowVolumeExpansion" / > < span
class="slider round"
data-cy="kubeSetup-storageExpansionToggle{{ class.Name }}"
>< / span >
2021-09-24 01:00:55 +00:00
< / 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-07-22 02:16:50 +00:00
< span ng-if = "!ctrl.hasValidStorageConfiguration()" class = "text-muted small vertical-center mt-2" >
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'alert-circle'" mode = "'warning'" > < / pr-icon >
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"
2022-08-12 18:22:45 +00:00
class="btn btn-primary btn-sm !ml-0"
2020-07-05 23:21:03 +00:00
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 >