@rancher/shell 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/styles/global/_button.scss +5 -1
- package/assets/styles/global/_columns.scss +4 -0
- package/assets/styles/global/_gauges.scss +1 -1
- package/assets/styles/global/_layout.scss +5 -2
- package/assets/styles/global/_select.scss +1 -4
- package/assets/styles/themes/_dark.scss +5 -4
- package/assets/styles/themes/_light.scss +4 -3
- package/assets/styles/themes/_suse.scss +1 -1
- package/assets/styles/vendor/vue-select.scss +4 -3
- package/assets/translations/en-us.yaml +673 -73
- package/assets/translations/zh-hans.yaml +720 -207
- package/chart/monitoring/steps/uninstall-v1.vue +2 -2
- package/cloud-credential/azure.vue +23 -0
- package/cloud-credential/harvester.vue +25 -62
- package/cloud-credential/pnap.vue +80 -0
- package/components/.DS_Store +0 -0
- package/components/ActionMenu.vue +28 -7
- package/components/AdvancedSection.vue +9 -2
- package/components/Alert.vue +2 -2
- package/components/ButtonDropdown.vue +0 -2
- package/components/ButtonGroup.vue +1 -0
- package/components/CollapsibleCard.vue +0 -1
- package/components/CruResource.vue +41 -4
- package/components/DetailTop.vue +72 -4
- package/components/DisableAuthProviderModal.vue +106 -0
- package/{rancher-components/components/Utils/DraggableZone → components}/DraggableZone.vue +0 -0
- package/components/ExplorerMembers.vue +253 -30
- package/components/ExplorerProjectsNamespaces.vue +77 -33
- package/components/ExtensionPanel.vue +42 -0
- package/components/GrowlManager.vue +3 -3
- package/components/IconOrSvg.vue +178 -0
- package/components/LogItem.vue +69 -0
- package/components/PodSecurityAdmission.vue +302 -0
- package/components/PromptModal.vue +1 -0
- package/components/ResourceDetail/Masthead.vue +69 -4
- package/components/ResourceDetail/index.vue +12 -5
- package/components/ResourceList/Masthead.vue +11 -1
- package/components/ResourceList/ResourceLoadingIndicator.vue +12 -2
- package/components/ResourceList/index.vue +66 -12
- package/components/ResourceList/resource-list.config.js +7 -0
- package/components/ResourceTable.vue +33 -6
- package/components/SimpleBox.vue +1 -1
- package/components/SortableTable/THead.vue +21 -14
- package/components/SortableTable/filtering.js +1 -1
- package/components/SortableTable/index.vue +21 -10
- package/components/SortableTable/selection.js +15 -3
- package/components/Tabbed/Tab.vue +1 -1
- package/components/Tabbed/index.vue +20 -15
- package/components/__tests__/.DS_Store +0 -0
- package/components/__tests__/AsyncButton.test.ts +140 -0
- package/components/__tests__/BackLink.test.ts +33 -0
- package/components/__tests__/ButtonGroup.test.ts +124 -0
- package/components/__tests__/ClusterBadge.test.ts +32 -0
- package/components/__tests__/CollapsibleCard.test.ts +64 -0
- package/components/__tests__/ConsumptionGauge.test.ts +88 -0
- package/components/__tests__/CruResource.test.ts +3 -2
- package/components/__tests__/FixedBanner.test.ts +129 -0
- package/components/__tests__/GrowlManager.test.ts +147 -0
- package/components/__tests__/NamespaceFilter.test.ts +33 -25
- package/components/__tests__/PercentageBar.test.ts +32 -0
- package/components/__tests__/PodSecurityAdmission.test.ts +398 -0
- package/components/auth/AuthBanner.vue +20 -10
- package/components/auth/RoleDetailEdit.vue +26 -17
- package/components/auth/SelectPrincipal.vue +36 -5
- package/components/form/ArrayList.vue +3 -35
- package/components/form/ArrayListGrouped.vue +13 -4
- package/components/form/ArrayListSelect.vue +5 -5
- package/components/form/Error.vue +8 -0
- package/components/form/KeyValue.vue +39 -7
- package/components/form/LabeledSelect.vue +5 -2
- package/components/form/Labels.vue +46 -16
- package/components/form/Members/ClusterPermissionsEditor.vue +17 -17
- package/components/form/Members/MembershipEditor.vue +12 -12
- package/components/form/NameNsDescription.vue +1 -1
- package/components/form/NodeScheduling.vue +1 -1
- package/components/form/Probe.vue +3 -3
- package/components/form/ResourceQuota/Project.vue +6 -6
- package/components/form/ResourceTabs/index.vue +24 -6
- package/components/form/Security.vue +7 -6
- package/components/form/Select.vue +3 -2
- package/components/form/SelectOrCreateAuthSecret.vue +22 -29
- package/components/form/ServicePorts.vue +8 -0
- package/components/form/WorkloadPorts.vue +7 -1
- package/components/form/__tests__/ArrayList.test.ts +74 -0
- package/components/form/__tests__/ArrayListGrouped.test.ts +6 -4
- package/components/formatter/Checked.vue +1 -1
- package/components/formatter/ClusterLink.vue +5 -0
- package/components/formatter/IconIsDefault.vue +2 -2
- package/components/formatter/InternalExternalIP.vue +11 -8
- package/components/formatter/LiveDuration.vue +78 -0
- package/components/formatter/WorkloadHealthScale.vue +5 -3
- package/components/nav/Header.vue +74 -7
- package/components/nav/NamespaceFilter.vue +146 -63
- package/components/nav/TopLevelMenu.vue +22 -19
- package/components/nav/WindowManager/ContainerLogs.vue +83 -126
- package/components/nav/WindowManager/ContainerShell.vue +9 -7
- package/components/nav/WindowManager/Window.vue +2 -0
- package/components/nav/WindowManager/index.vue +10 -0
- package/config/elemental-types.js +9 -0
- package/config/features.js +2 -0
- package/config/home-links.js +4 -1
- package/config/pod-security-admission.ts +82 -0
- package/config/product/apps.js +1 -1
- package/config/product/auth.js +6 -5
- package/config/product/backup.js +1 -1
- package/config/product/explorer.js +6 -6
- package/config/product/fleet.js +1 -1
- package/config/product/manager.js +6 -2
- package/config/query-params.js +1 -0
- package/config/secret.js +0 -1
- package/config/settings.ts +26 -9
- package/config/table-headers.js +22 -11
- package/config/types.js +4 -1
- package/config/uiplugins.js +3 -3
- package/content/docs/zh-hans/getting-started.md +113 -137
- package/content/docs/zh-hans/whats-new.md +8 -46
- package/core/plugin-helpers.js +171 -0
- package/core/plugin.ts +61 -1
- package/core/plugins.js +33 -0
- package/core/types.ts +128 -2
- package/creators/pkg/package-lock.json +37 -0
- package/creators/pkg/package.json +1 -1
- package/detail/catalog.cattle.io.app.vue +1 -1
- package/detail/pod.vue +1 -1
- package/detail/provisioning.cattle.io.cluster.vue +35 -9
- package/detail/service.vue +2 -9
- package/detail/workload/index.vue +0 -1
- package/dialog/AddClusterMemberDialog.vue +22 -28
- package/dialog/AddProjectMemberDialog.vue +53 -9
- package/dialog/DiagnosticTimingsDialog.vue +8 -7
- package/dialog/DrainNode.vue +44 -48
- package/dialog/ForceMachineRemoveDialog.vue +5 -7
- package/dialog/GenericPrompt.vue +15 -20
- package/dialog/RollbackWorkloadDialog.vue +15 -46
- package/dialog/RotateCertificatesDialog.vue +5 -7
- package/dialog/RotateEncryptionKeyDialog.vue +5 -9
- package/dialog/SaveAsRKETemplateDialog.vue +5 -13
- package/dialog/ScaleMachineDownDialog.vue +1 -1
- package/dialog/ScalePoolDownDialog.vue +121 -0
- package/edit/__tests__/management.cattle.io.setting.test.ts +3 -3
- package/edit/auth/azuread.vue +16 -16
- package/edit/auth/github.vue +8 -0
- package/edit/auth/googleoauth.vue +10 -1
- package/edit/auth/ldap/index.vue +10 -0
- package/edit/auth/oidc.vue +10 -0
- package/edit/auth/saml.vue +10 -0
- package/edit/autoscaling.horizontalpodautoscaler/index.vue +1 -1
- package/edit/catalog.cattle.io.clusterrepo.vue +3 -0
- package/edit/cloudcredential.vue +3 -7
- package/edit/logging-flow/Match.vue +39 -8
- package/edit/logging-flow/index.vue +27 -4
- package/edit/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +107 -0
- package/edit/management.cattle.io.project.vue +8 -1
- package/edit/management.cattle.io.setting.vue +5 -2
- package/edit/management.cattle.io.user.vue +7 -1
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +36 -8
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +2 -2
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +14 -6
- package/edit/namespace.vue +18 -4
- package/edit/networking.k8s.io.ingress/Certificate.vue +1 -0
- package/edit/networking.k8s.io.ingress/IngressClass.vue +8 -6
- package/edit/networking.k8s.io.ingress/RulePath.vue +12 -6
- package/edit/networking.k8s.io.ingress/index.vue +8 -6
- package/edit/persistentvolume/index.vue +30 -27
- package/edit/persistentvolume/plugins/cephfs.vue +29 -29
- package/edit/persistentvolume/plugins/csi.vue +102 -62
- package/edit/persistentvolume/plugins/fc.vue +19 -19
- package/edit/persistentvolume/plugins/iscsi.vue +45 -45
- package/edit/persistentvolume/plugins/rbd.vue +39 -39
- package/edit/persistentvolumeclaim.vue +78 -75
- package/edit/provisioning.cattle.io.cluster/MachinePool.vue +11 -7
- package/edit/provisioning.cattle.io.cluster/RegistryConfigs.vue +10 -1
- package/edit/provisioning.cattle.io.cluster/RegistryMirrors.vue +87 -27
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +3 -6
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +96 -0
- package/edit/provisioning.cattle.io.cluster/import.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/index.vue +29 -6
- package/edit/provisioning.cattle.io.cluster/rke2.vue +445 -154
- package/edit/secret/index.vue +3 -7
- package/edit/service.vue +3 -1
- package/edit/storage.k8s.io.storageclass/index.vue +100 -16
- package/edit/storage.k8s.io.storageclass/provisioners/driver.harvesterhci.io.vue +114 -0
- package/edit/workload/__tests__/index.test.ts +98 -0
- package/edit/workload/index.vue +58 -8
- package/edit/workload/mixins/workload.js +107 -70
- package/edit/workload/storage/ContainerMountPaths.vue +0 -10
- package/edit/workload/storage/emptyDir.vue +88 -0
- package/edit/workload/storage/ephemeralVolume/index.vue +1 -1
- package/edit/workload/storage/index.vue +8 -0
- package/edit/workload/storage/persistentVolumeClaim/index.vue +1 -1
- package/layouts/default.vue +57 -44
- package/list/__tests__/workload.test.ts +5 -2
- package/list/catalog.cattle.io.app.vue +1 -0
- package/list/cis.cattle.io.clusterscan.vue +1 -0
- package/list/fleet.cattle.io.bundle.vue +5 -6
- package/list/fleet.cattle.io.cluster.vue +6 -3
- package/list/fleet.cattle.io.clusterregistrationtoken.vue +5 -6
- package/list/fleet.cattle.io.gitrepo.vue +4 -9
- package/list/helm.cattle.io.projecthelmchart.vue +1 -5
- package/list/logging.banzaicloud.io.clusterflow.vue +4 -1
- package/list/logging.banzaicloud.io.flow.vue +6 -5
- package/list/management.cattle.io.cluster.vue +1 -0
- package/list/management.cattle.io.feature.vue +3 -4
- package/list/management.cattle.io.podsecurityadmissionconfigurationtemplate.vue +47 -0
- package/list/management.cattle.io.setting.vue +2 -2
- package/list/management.cattle.io.user.vue +4 -10
- package/list/monitoring.coreos.com.alertmanagerconfig.vue +2 -7
- package/list/node.vue +8 -5
- package/list/persistentvolume.vue +3 -3
- package/list/persistentvolumeclaim.vue +3 -4
- package/list/provisioning.cattle.io.cluster.vue +18 -19
- package/list/service.vue +6 -14
- package/list/workload.vue +43 -38
- package/machine-config/azure.vue +429 -60
- package/machine-config/pnap.vue +288 -0
- package/mixins/auth-config.js +1 -3
- package/mixins/browser-tab-visibility.js +8 -14
- package/mixins/chart.js +1 -1
- package/mixins/create-edit-view/impl.js +4 -0
- package/mixins/create-edit-view/index.js +4 -2
- package/mixins/resource-fetch-namespaced.js +98 -0
- package/mixins/resource-fetch.js +79 -45
- package/mixins/resource-manager.js +1 -23
- package/models/apps.controllerrevision.js +7 -0
- package/models/apps.daemonset.js +18 -0
- package/models/apps.deployment.js +44 -0
- package/models/apps.replicaset.js +7 -0
- package/models/apps.statefulset.js +18 -0
- package/models/batch.job.js +7 -14
- package/models/cluster/node.js +10 -2
- package/models/cluster.x-k8s.io.machine.js +26 -4
- package/models/cluster.x-k8s.io.machinedeployment.js +12 -2
- package/models/event.js +7 -0
- package/models/logging.banzaicloud.io.flow.js +4 -0
- package/models/management.cattle.io.cluster.js +1 -1
- package/models/management.cattle.io.clusterroletemplatebinding.js +1 -1
- package/models/management.cattle.io.globalrole.js +2 -2
- package/models/management.cattle.io.node.js +37 -2
- package/models/management.cattle.io.podsecurityadmissionconfigurationtemplate.ts +4 -0
- package/models/management.cattle.io.project.js +30 -11
- package/models/management.cattle.io.setting.js +1 -1
- package/models/management.cattle.io.user.js +37 -1
- package/models/namespace.js +42 -5
- package/models/persistentvolume.js +14 -2
- package/models/pod.js +15 -0
- package/models/projectroletemplatebinding.js +7 -0
- package/models/provisioning.cattle.io.cluster.js +61 -10
- package/models/rke-machine.cattle.io.pnapmachinetemplate.js +15 -0
- package/models/service.js +14 -13
- package/models/storage.k8s.io.storageclass.js +33 -18
- package/models/workload.js +38 -7
- package/nuxt.config.js +27 -17
- package/package.json +7 -7
- package/pages/about.vue +14 -2
- package/pages/c/_cluster/apps/charts/index.vue +21 -3
- package/pages/c/_cluster/apps/charts/install.vue +59 -22
- package/pages/c/_cluster/auth/config/_id.vue +6 -0
- package/pages/c/_cluster/auth/config/index.vue +8 -6
- package/pages/c/_cluster/auth/group.principal/assign-edit.vue +1 -1
- package/pages/c/_cluster/auth/roles/index.vue +1 -1
- package/pages/c/_cluster/explorer/index.vue +51 -6
- package/pages/c/_cluster/longhorn/index.vue +1 -1
- package/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue +15 -4
- package/pages/c/_cluster/monitoring/index.vue +1 -1
- package/pages/c/_cluster/neuvector/index.vue +1 -1
- package/pages/c/_cluster/settings/performance.vue +48 -2
- package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +2 -0
- package/pages/c/_cluster/uiplugins/InstallDialog.vue +3 -0
- package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +42 -2
- package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +2 -0
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +1 -0
- package/pages/c/_cluster/uiplugins/UninstallDialog.vue +2 -0
- package/pages/c/_cluster/uiplugins/index.vue +42 -3
- package/pages/diagnostic.vue +5 -4
- package/pages/home.vue +105 -30
- package/pages/prefs.vue +23 -12
- package/pages/rio/mesh.vue +1 -1
- package/pkg/dynamic-importer.lib.js +8 -0
- package/pkg/vue.config.js +4 -0
- package/plugins/dashboard-store/__tests__/mutations.spec.js +406 -0
- package/plugins/dashboard-store/actions.js +32 -25
- package/plugins/dashboard-store/getters.js +50 -33
- package/plugins/dashboard-store/mutations.js +134 -28
- package/plugins/dashboard-store/resource-class.js +37 -42
- package/plugins/steve/actions.js +30 -0
- package/plugins/steve/caches/resourceCache.js +60 -0
- package/plugins/steve/getters.js +44 -1
- package/plugins/steve/mutations.js +97 -36
- package/plugins/steve/resourceWatcher.js +277 -0
- package/plugins/steve/schema.utils.js +25 -0
- package/plugins/steve/subscribe.js +288 -115
- package/plugins/steve/worker/index.js +17 -0
- package/plugins/steve/worker/web-worker.advanced.js +302 -0
- package/plugins/steve/{web-worker.steve-sub-worker.js → worker/web-worker.basic.js} +3 -44
- package/rancher-components/Card/Card.vue +3 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +1 -0
- package/rancher-components/StringList/StringList.test.ts +45 -420
- package/rancher-components/StringList/StringList.vue +1 -10
- package/rancher-components/components/Banner/Banner.test.ts +44 -0
- package/rancher-components/components/Banner/Banner.vue +130 -61
- package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +13 -22
- package/rancher-components/components/Form/Checkbox/Checkbox.vue +8 -6
- package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +9 -9
- package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +0 -1
- package/rancher-components/components/StringList/StringList.test.ts +7 -7
- package/rancher-components/components/StringList/StringList.vue +21 -15
- package/scripts/test-plugins-build.sh +8 -0
- package/static/loading-indicator.html +1 -1
- package/store/action-menu.js +4 -3
- package/store/index.js +54 -3
- package/store/plugins.js +0 -17
- package/store/pnap.js +128 -0
- package/store/prefs.js +4 -2
- package/store/type-map.js +81 -13
- package/types/pod-security-admission.ts +36 -0
- package/types/shell/index.d.ts +497 -396
- package/utils/__tests__/object.test.ts +17 -1
- package/utils/__tests__/pod-security-admission.test.ts +61 -0
- package/utils/async.ts +36 -0
- package/utils/color.js +45 -0
- package/utils/crypto/browserHashUtils.js +18 -0
- package/utils/dynamic-importer.js +8 -0
- package/utils/install-redirect.js +1 -1
- package/utils/object.js +24 -0
- package/utils/pod-security-admission.ts +39 -0
- package/utils/socket.js +61 -24
- package/utils/string.js +2 -0
- package/utils/svg-filter.js +301 -0
- package/utils/time.js +49 -0
- package/utils/validators/cidr.js +4 -0
- package/utils/validators/formRules/__tests__/index.test.ts +23 -3
- package/utils/validators/formRules/index.ts +14 -0
- package/config/product/harvester-manager.js +0 -162
- package/edit/harvesterhci.io.management.cluster.vue +0 -153
- package/list/harvesterhci.io.management.cluster.vue +0 -241
- package/machine-config/harvester.vue +0 -693
- package/models/harvesterhci.io.management.cluster.js +0 -228
- package/pages/c/_cluster/harvesterManager/index.vue +0 -24
- package/rancher-components/Card/Card.test.ts +0 -39
- package/rancher-components/Utils/DraggableZone/DraggableZone.vue +0 -181
- package/rancher-components/Utils/DraggableZone/index.ts +0 -1
- package/rancher-components/components/Utils/DraggableZone/index.ts +0 -1
|
@@ -4,7 +4,6 @@ import throttle from 'lodash/throttle';
|
|
|
4
4
|
import isArray from 'lodash/isArray';
|
|
5
5
|
import merge from 'lodash/merge';
|
|
6
6
|
import { mapGetters } from 'vuex';
|
|
7
|
-
|
|
8
7
|
import CreateEditView from '@shell/mixins/create-edit-view';
|
|
9
8
|
import FormValidation from '@shell/mixins/form-validation';
|
|
10
9
|
|
|
@@ -29,6 +28,7 @@ import { sortBy } from '@shell/utils/sort';
|
|
|
29
28
|
import { camelToTitle, nlToBr } from '@shell/utils/string';
|
|
30
29
|
import { compare, sortable } from '@shell/utils/version';
|
|
31
30
|
import { isHarvesterSatisfiesVersion } from '@shell/utils/cluster';
|
|
31
|
+
import * as VERSION from '@shell/utils/version';
|
|
32
32
|
|
|
33
33
|
import ArrayList from '@shell/components/form/ArrayList';
|
|
34
34
|
import ArrayListGrouped from '@shell/components/form/ArrayListGrouped';
|
|
@@ -66,6 +66,8 @@ import RegistryConfigs from './RegistryConfigs';
|
|
|
66
66
|
import RegistryMirrors from './RegistryMirrors';
|
|
67
67
|
import S3Config from './S3Config';
|
|
68
68
|
import SelectCredential from './SelectCredential';
|
|
69
|
+
import AdvancedSection from '@shell/components/AdvancedSection.vue';
|
|
70
|
+
import { ELEMENTAL_SCHEMA_IDS, KIND, ELEMENTAL_CLUSTER_PROVIDER } from '../../config/elemental-types';
|
|
69
71
|
|
|
70
72
|
const PUBLIC = 'public';
|
|
71
73
|
const PRIVATE = 'private';
|
|
@@ -77,6 +79,7 @@ const HARVESTER_CLOUD_PROVIDER = 'harvester-cloud-provider';
|
|
|
77
79
|
export default {
|
|
78
80
|
components: {
|
|
79
81
|
ACE,
|
|
82
|
+
AdvancedSection,
|
|
80
83
|
AgentEnv,
|
|
81
84
|
ArrayList,
|
|
82
85
|
ArrayListGrouped,
|
|
@@ -136,6 +139,10 @@ export default {
|
|
|
136
139
|
hash.allPSPs = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.POD_SECURITY_POLICY_TEMPLATE });
|
|
137
140
|
}
|
|
138
141
|
|
|
142
|
+
if (this.$store.getters['management/canList'](MANAGEMENT.PSA)) {
|
|
143
|
+
hash.allPSAs = await this.$store.dispatch('management/findAll', { type: MANAGEMENT.PSA });
|
|
144
|
+
}
|
|
145
|
+
|
|
139
146
|
// Get the latest versions from the global settings if possible
|
|
140
147
|
const globalSettings = await this.$store.getters['management/all'](MANAGEMENT.SETTING) || [];
|
|
141
148
|
const defaultRke2Setting = globalSettings.find(setting => setting.id === 'rke2-default-version') || {};
|
|
@@ -157,6 +164,7 @@ export default {
|
|
|
157
164
|
const res = await allHash(hash);
|
|
158
165
|
|
|
159
166
|
this.allPSPs = res.allPSPs || [];
|
|
167
|
+
this.allPSAs = res.allPSAs || [];
|
|
160
168
|
this.rke2Versions = res.rke2Versions.data || [];
|
|
161
169
|
this.k3sVersions = res.k3sVersions.data || [];
|
|
162
170
|
|
|
@@ -230,6 +238,10 @@ export default {
|
|
|
230
238
|
set(this.value.spec, 'defaultPodSecurityPolicyTemplateName', '');
|
|
231
239
|
}
|
|
232
240
|
|
|
241
|
+
if ( this.value.spec.defaultPodSecurityAdmissionConfigurationTemplateName === undefined ) {
|
|
242
|
+
set(this.value.spec, 'defaultPodSecurityAdmissionConfigurationTemplateName', '');
|
|
243
|
+
}
|
|
244
|
+
|
|
233
245
|
await this.initAddons();
|
|
234
246
|
await this.initRegistry();
|
|
235
247
|
|
|
@@ -266,34 +278,43 @@ export default {
|
|
|
266
278
|
set(this.value.spec, 'rkeConfig.machineSelectorConfig', [{ config: {} }]);
|
|
267
279
|
}
|
|
268
280
|
|
|
281
|
+
// Store the initial PSP template name, so we can set it back if needed
|
|
282
|
+
const lastDefaultPodSecurityPolicyTemplateName = this.value.spec.defaultPodSecurityPolicyTemplateName;
|
|
283
|
+
const previousKubernetesVersion = this.value.spec.kubernetesVersion;
|
|
284
|
+
|
|
269
285
|
return {
|
|
270
|
-
loadedOnce:
|
|
271
|
-
lastIdx:
|
|
272
|
-
allPSPs:
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
286
|
+
loadedOnce: false,
|
|
287
|
+
lastIdx: 0,
|
|
288
|
+
allPSPs: null,
|
|
289
|
+
allPSAs: [],
|
|
290
|
+
nodeComponent: null,
|
|
291
|
+
credentialId: null,
|
|
292
|
+
credential: null,
|
|
293
|
+
machinePools: null,
|
|
294
|
+
rke2Versions: null,
|
|
295
|
+
k3sVersions: null,
|
|
296
|
+
defaultRke2: '',
|
|
297
|
+
defaultK3s: '',
|
|
298
|
+
s3Backup: false,
|
|
299
|
+
versionInfo: {},
|
|
300
|
+
membershipUpdate: {},
|
|
301
|
+
showDeprecatedPatchVersions: false,
|
|
302
|
+
systemRegistry: null,
|
|
303
|
+
registryHost: null,
|
|
304
|
+
showCustomRegistryInput: false,
|
|
305
|
+
showCustomRegistryAdvancedInput: false,
|
|
306
|
+
registrySecret: null,
|
|
307
|
+
userChartValues: {},
|
|
308
|
+
userChartValuesTemp: {},
|
|
309
|
+
addonsRev: 0,
|
|
310
|
+
clusterIsAlreadyCreated: !!this.value.id,
|
|
311
|
+
fvFormRuleSets: [{
|
|
294
312
|
path: 'metadata.name', rules: ['subDomain'], translationKey: 'nameNsDescription.name.label'
|
|
295
313
|
}],
|
|
296
314
|
harvesterVersionRange: {},
|
|
315
|
+
lastDefaultPodSecurityPolicyTemplateName,
|
|
316
|
+
previousKubernetesVersion,
|
|
317
|
+
harvesterVersion: ''
|
|
297
318
|
};
|
|
298
319
|
},
|
|
299
320
|
|
|
@@ -309,6 +330,10 @@ export default {
|
|
|
309
330
|
return this.value.spec.rkeConfig;
|
|
310
331
|
},
|
|
311
332
|
|
|
333
|
+
isElementalCluster() {
|
|
334
|
+
return this.provider === ELEMENTAL_CLUSTER_PROVIDER || this.value?.machineProvider?.toLowerCase() === KIND.MACHINE_INV_SELECTOR_TEMPLATES.toLowerCase();
|
|
335
|
+
},
|
|
336
|
+
|
|
312
337
|
advancedTitleAlt() {
|
|
313
338
|
const machineSelectorLength = this.rkeConfig.machineSelectorConfig.length;
|
|
314
339
|
|
|
@@ -327,9 +352,34 @@ export default {
|
|
|
327
352
|
return this.value.agentConfig;
|
|
328
353
|
},
|
|
329
354
|
|
|
355
|
+
/**
|
|
356
|
+
* Return need of PSA if RKE and min k8s version
|
|
357
|
+
*/
|
|
358
|
+
needsPSA() {
|
|
359
|
+
const release = this.value?.spec?.kubernetesVersion || '';
|
|
360
|
+
const version = release.match(/\d+/g);
|
|
361
|
+
const isRequiredVersion = version?.length ? +version[0] > 1 || +version[1] >= 23 : false;
|
|
362
|
+
|
|
363
|
+
return isRequiredVersion;
|
|
364
|
+
},
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Restrict use of PSP based on min k8s version
|
|
368
|
+
*/
|
|
369
|
+
needsPSP() {
|
|
370
|
+
const release = this.value?.spec?.kubernetesVersion || '';
|
|
371
|
+
const version = release.match(/\d+/g);
|
|
372
|
+
const isRequiredVersion = version?.length ? +version[0] === 1 && +version[1] < 25 : false;
|
|
373
|
+
|
|
374
|
+
return isRequiredVersion;
|
|
375
|
+
},
|
|
376
|
+
|
|
330
377
|
// kubeletConfigs() {
|
|
331
378
|
// return this.value.spec.rkeConfig.machineSelectorConfig.filter(x => !!x.machineLabelSelector);
|
|
332
379
|
// },
|
|
380
|
+
/**
|
|
381
|
+
* Check if k8s release version used is RKE2 ^1.25
|
|
382
|
+
*/
|
|
333
383
|
|
|
334
384
|
unsupportedSelectorConfig() {
|
|
335
385
|
let global = 0;
|
|
@@ -419,7 +469,10 @@ export default {
|
|
|
419
469
|
return { label: x, value: x };
|
|
420
470
|
});
|
|
421
471
|
|
|
422
|
-
out.unshift({
|
|
472
|
+
out.unshift({
|
|
473
|
+
label: this.$store.getters['i18n/t']('cluster.rke2.cisProfile.option'),
|
|
474
|
+
value: ''
|
|
475
|
+
});
|
|
423
476
|
|
|
424
477
|
return out;
|
|
425
478
|
},
|
|
@@ -429,7 +482,10 @@ export default {
|
|
|
429
482
|
return null;
|
|
430
483
|
}
|
|
431
484
|
|
|
432
|
-
const out = [{
|
|
485
|
+
const out = [{
|
|
486
|
+
label: this.$store.getters['i18n/t']('cluster.rke2.defaultPodSecurityPolicyTemplateName.option'),
|
|
487
|
+
value: ''
|
|
488
|
+
}];
|
|
433
489
|
|
|
434
490
|
if ( this.allPSPs ) {
|
|
435
491
|
for ( const pspt of this.allPSPs ) {
|
|
@@ -449,6 +505,35 @@ export default {
|
|
|
449
505
|
return out;
|
|
450
506
|
},
|
|
451
507
|
|
|
508
|
+
/**
|
|
509
|
+
* Convert PSA templates into options, sorting and flagging if any selected
|
|
510
|
+
*/
|
|
511
|
+
psaOptions() {
|
|
512
|
+
if ( !this.needsPSA ) {
|
|
513
|
+
return [];
|
|
514
|
+
}
|
|
515
|
+
const out = [{
|
|
516
|
+
label: this.$store.getters['i18n/t']('cluster.rke2.defaultPodSecurityAdmissionConfigurationTemplateName.option'),
|
|
517
|
+
value: ''
|
|
518
|
+
}];
|
|
519
|
+
|
|
520
|
+
if ( this.allPSAs ) {
|
|
521
|
+
for ( const psa of this.allPSAs ) {
|
|
522
|
+
out.push({
|
|
523
|
+
label: psa.nameDisplay,
|
|
524
|
+
value: psa.id,
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
const cur = this.value.spec.defaultPodSecurityAdmissionConfigurationTemplateName;
|
|
529
|
+
|
|
530
|
+
if ( cur && !out.find(x => x.value === cur) ) {
|
|
531
|
+
out.unshift({ label: `${ cur } (Current)`, value: cur });
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
return out;
|
|
535
|
+
},
|
|
536
|
+
|
|
452
537
|
disableOptions() {
|
|
453
538
|
return this.serverArgs.disable.options.map((value) => {
|
|
454
539
|
return {
|
|
@@ -459,7 +544,10 @@ export default {
|
|
|
459
544
|
},
|
|
460
545
|
|
|
461
546
|
cloudProviderOptions() {
|
|
462
|
-
const out = [{
|
|
547
|
+
const out = [{
|
|
548
|
+
label: this.$store.getters['i18n/t']('cluster.rke2.cloudProvider.defaultValue.label'),
|
|
549
|
+
value: '',
|
|
550
|
+
}];
|
|
463
551
|
|
|
464
552
|
const preferred = this.$store.getters['plugins/cloudProviderForDriver'](this.provider);
|
|
465
553
|
|
|
@@ -506,11 +594,7 @@ export default {
|
|
|
506
594
|
},
|
|
507
595
|
|
|
508
596
|
haveArgInfo() {
|
|
509
|
-
|
|
510
|
-
return true;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
return false;
|
|
597
|
+
return Boolean(this.selectedVersion?.serverArgs && this.selectedVersion?.agentArgs);
|
|
514
598
|
},
|
|
515
599
|
|
|
516
600
|
serverArgs() {
|
|
@@ -526,20 +610,11 @@ export default {
|
|
|
526
610
|
},
|
|
527
611
|
|
|
528
612
|
showCisProfile() {
|
|
529
|
-
return this.provider === 'custom' && ( this.serverArgs.profile || this.agentArgs.profile );
|
|
530
|
-
},
|
|
531
|
-
|
|
532
|
-
registryOptions() {
|
|
533
|
-
return [PUBLIC, PRIVATE, ADVANCED].map((opt) => {
|
|
534
|
-
return {
|
|
535
|
-
label: this.$store.getters['i18n/withFallback'](`cluster.privateRegistry.mode."${ opt }"`, null, opt),
|
|
536
|
-
value: opt,
|
|
537
|
-
};
|
|
538
|
-
});
|
|
613
|
+
return (this.provider === 'custom' || this.isElementalCluster) && ( this.serverArgs.profile || this.agentArgs.profile );
|
|
539
614
|
},
|
|
540
615
|
|
|
541
616
|
needCredential() {
|
|
542
|
-
if ( this.provider === 'custom' || this.provider === 'import' || this.mode === _VIEW ) {
|
|
617
|
+
if ( this.provider === 'custom' || this.provider === 'import' || this.isElementalCluster || this.mode === _VIEW ) {
|
|
543
618
|
return false;
|
|
544
619
|
}
|
|
545
620
|
|
|
@@ -559,13 +634,17 @@ export default {
|
|
|
559
634
|
},
|
|
560
635
|
|
|
561
636
|
machineConfigSchema() {
|
|
637
|
+
let schema;
|
|
638
|
+
|
|
562
639
|
if ( !this.hasMachinePools ) {
|
|
563
640
|
return null;
|
|
641
|
+
} else if (this.isElementalCluster) {
|
|
642
|
+
schema = ELEMENTAL_SCHEMA_IDS.MACHINE_INV_SELECTOR_TEMPLATES;
|
|
643
|
+
} else {
|
|
644
|
+
schema = `${ CAPI.MACHINE_CONFIG_GROUP }.${ this.provider }config`;
|
|
564
645
|
}
|
|
565
646
|
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
return schema;
|
|
647
|
+
return this.$store.getters['management/schemaFor'](schema);
|
|
569
648
|
},
|
|
570
649
|
|
|
571
650
|
nodeTotals() {
|
|
@@ -824,6 +903,7 @@ export default {
|
|
|
824
903
|
},
|
|
825
904
|
|
|
826
905
|
isHarvesterIncompatible() {
|
|
906
|
+
const CompareVersion = '<v1.2';
|
|
827
907
|
let ccmRke2Version = (this.chartVersions['harvester-cloud-provider'] || {})['version'];
|
|
828
908
|
let csiRke2Version = (this.chartVersions['harvester-csi-driver'] || {})['version'];
|
|
829
909
|
|
|
@@ -839,8 +919,12 @@ export default {
|
|
|
839
919
|
}
|
|
840
920
|
|
|
841
921
|
if (ccmVersion && csiVersion) {
|
|
842
|
-
if (semver.satisfies(
|
|
843
|
-
|
|
922
|
+
if (semver.satisfies(this.harvesterVersion, CompareVersion) || !(this.harvesterVersion || '').startsWith('v')) {
|
|
923
|
+
// When harveste version is less than `CompareVersion`, compatibility is not determined,
|
|
924
|
+
// At the same time, version numbers like this will not be checked: master-14bbee2c-head
|
|
925
|
+
return false;
|
|
926
|
+
} else if (semver.satisfies(ccmRke2Version, ccmVersion) &&
|
|
927
|
+
semver.satisfies(csiRke2Version, csiVersion)) {
|
|
844
928
|
return false;
|
|
845
929
|
} else {
|
|
846
930
|
return true;
|
|
@@ -849,6 +933,19 @@ export default {
|
|
|
849
933
|
return false;
|
|
850
934
|
}
|
|
851
935
|
},
|
|
936
|
+
|
|
937
|
+
displayInvalidPspsBanner() {
|
|
938
|
+
const version = VERSION.parse(this.value.spec.kubernetesVersion);
|
|
939
|
+
|
|
940
|
+
const major = parseInt(version?.[0] || 0);
|
|
941
|
+
const minor = parseInt(version?.[1] || 0);
|
|
942
|
+
|
|
943
|
+
if (major === 1 && minor >= 25) {
|
|
944
|
+
return this.allPSPs?.length > 0;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
return false;
|
|
948
|
+
}
|
|
852
949
|
},
|
|
853
950
|
|
|
854
951
|
watch: {
|
|
@@ -943,8 +1040,16 @@ export default {
|
|
|
943
1040
|
|
|
944
1041
|
if ( existing?.length ) {
|
|
945
1042
|
for ( const pool of existing ) {
|
|
946
|
-
|
|
1043
|
+
let type;
|
|
1044
|
+
|
|
1045
|
+
if (this.isElementalCluster) {
|
|
1046
|
+
type = ELEMENTAL_SCHEMA_IDS.MACHINE_INV_SELECTOR_TEMPLATES;
|
|
1047
|
+
} else {
|
|
1048
|
+
type = `${ CAPI.MACHINE_CONFIG_GROUP }.${ pool.machineConfigRef.kind.toLowerCase() }`;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
947
1051
|
let config;
|
|
1052
|
+
let configMissing = false;
|
|
948
1053
|
|
|
949
1054
|
if ( this.$store.getters['management/canList'](type) ) {
|
|
950
1055
|
try {
|
|
@@ -954,6 +1059,12 @@ export default {
|
|
|
954
1059
|
});
|
|
955
1060
|
} catch (e) {
|
|
956
1061
|
// Some users can't see the config, that's ok.
|
|
1062
|
+
// we will display a banner for a 404 only for elemental
|
|
1063
|
+
if (e?.status === 404) {
|
|
1064
|
+
if (this.isElementalCluster) {
|
|
1065
|
+
configMissing = true;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
957
1068
|
}
|
|
958
1069
|
}
|
|
959
1070
|
|
|
@@ -967,6 +1078,7 @@ export default {
|
|
|
967
1078
|
update: true,
|
|
968
1079
|
pool: clone(pool),
|
|
969
1080
|
config: config ? await this.$store.dispatch('management/clone', { resource: config }) : null,
|
|
1081
|
+
configMissing
|
|
970
1082
|
});
|
|
971
1083
|
}
|
|
972
1084
|
}
|
|
@@ -1014,6 +1126,11 @@ export default {
|
|
|
1014
1126
|
if (this.provider === 'vmwarevsphere') {
|
|
1015
1127
|
pool.pool.machineOS = 'linux';
|
|
1016
1128
|
}
|
|
1129
|
+
|
|
1130
|
+
if (this.isElementalCluster) {
|
|
1131
|
+
pool.pool.machineConfigRef.apiVersion = `${ this.machineConfigSchema.attributes.group }/${ this.machineConfigSchema.attributes.version }`;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1017
1134
|
this.machinePools.push(pool);
|
|
1018
1135
|
|
|
1019
1136
|
this.$nextTick(() => {
|
|
@@ -1086,6 +1203,11 @@ export default {
|
|
|
1086
1203
|
entry.config = await entry.config.save();
|
|
1087
1204
|
}
|
|
1088
1205
|
|
|
1206
|
+
// Ensure Elemental clusters have a hostname prefix
|
|
1207
|
+
if (this.isElementalCluster && !entry.pool.hostnamePrefix ) {
|
|
1208
|
+
entry.pool.hostnamePrefix = `${ prefix }-`;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1089
1211
|
finalPools.push(entry.pool);
|
|
1090
1212
|
}
|
|
1091
1213
|
|
|
@@ -1111,7 +1233,7 @@ export default {
|
|
|
1111
1233
|
},
|
|
1112
1234
|
|
|
1113
1235
|
validationPassed() {
|
|
1114
|
-
return (this.provider === 'custom' || !!this.credentialId);
|
|
1236
|
+
return (this.provider === 'custom' || this.isElementalCluster || !!this.credentialId);
|
|
1115
1237
|
},
|
|
1116
1238
|
|
|
1117
1239
|
cancelCredential() {
|
|
@@ -1205,6 +1327,7 @@ export default {
|
|
|
1205
1327
|
url: `/k8s/clusters/${ clusterId }/v1/harvester/kubeconfig`,
|
|
1206
1328
|
method: 'POST',
|
|
1207
1329
|
data: {
|
|
1330
|
+
csiClusterRoleName: 'harvesterhci.io:csi-driver',
|
|
1208
1331
|
clusterRoleName: 'harvesterhci.io:cloudprovider',
|
|
1209
1332
|
namespace,
|
|
1210
1333
|
serviceAccountName: this.value.metadata.name,
|
|
@@ -1393,13 +1516,23 @@ export default {
|
|
|
1393
1516
|
},
|
|
1394
1517
|
|
|
1395
1518
|
async initRegistry() {
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
let registrySecret = null;
|
|
1399
|
-
let regs = this.rkeConfig.registries;
|
|
1519
|
+
// Check for an existing cluster scoped registry
|
|
1520
|
+
const clusterRegistry = this.agentConfig?.['system-default-registry'] || '';
|
|
1400
1521
|
|
|
1522
|
+
// Check for the global registry
|
|
1401
1523
|
this.systemRegistry = (await this.$store.dispatch('management/find', { type: MANAGEMENT.SETTING, id: SETTING.SYSTEM_DEFAULT_REGISTRY })).value || '';
|
|
1402
1524
|
|
|
1525
|
+
// The order of precedence is to use the cluster scoped registry
|
|
1526
|
+
// if it exists, then use the global scoped registry as a fallback
|
|
1527
|
+
if (clusterRegistry) {
|
|
1528
|
+
this.registryHost = clusterRegistry;
|
|
1529
|
+
} else {
|
|
1530
|
+
this.registryHost = this.systemRegistry;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
let registrySecret = null;
|
|
1534
|
+
let regs = this.rkeConfig.registries;
|
|
1535
|
+
|
|
1403
1536
|
if ( !regs ) {
|
|
1404
1537
|
regs = {};
|
|
1405
1538
|
set(this.rkeConfig, 'registries', regs);
|
|
@@ -1413,75 +1546,85 @@ export default {
|
|
|
1413
1546
|
set(regs, 'mirrors', {});
|
|
1414
1547
|
}
|
|
1415
1548
|
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1549
|
+
const hostname = Object.keys(regs.configs)[0];
|
|
1550
|
+
const config = regs.configs[hostname];
|
|
1551
|
+
|
|
1552
|
+
if ( config ) {
|
|
1553
|
+
registrySecret = config.authConfigSecretName;
|
|
1421
1554
|
}
|
|
1422
1555
|
|
|
1423
|
-
|
|
1424
|
-
registryMode = ADVANCED;
|
|
1425
|
-
} else {
|
|
1426
|
-
const hostname = Object.keys(regs.configs)[0];
|
|
1427
|
-
const config = regs.configs[hostname];
|
|
1556
|
+
this.registrySecret = registrySecret;
|
|
1428
1557
|
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1558
|
+
const hasMirrorsOrAuthConfig = Object.keys(regs.configs).length > 0 || Object.keys(regs.mirrors).length > 0;
|
|
1559
|
+
|
|
1560
|
+
if (this.registryHost || registrySecret || hasMirrorsOrAuthConfig) {
|
|
1561
|
+
this.showCustomRegistryInput = true;
|
|
1562
|
+
|
|
1563
|
+
if (hasMirrorsOrAuthConfig) {
|
|
1564
|
+
this.showCustomRegistryAdvancedInput = true;
|
|
1436
1565
|
}
|
|
1437
1566
|
}
|
|
1438
|
-
|
|
1439
|
-
this.registryHost = registryHost;
|
|
1440
|
-
this.registryMode = registryMode;
|
|
1441
|
-
this.registrySecret = registrySecret;
|
|
1442
1567
|
},
|
|
1443
1568
|
|
|
1444
1569
|
setRegistryConfig() {
|
|
1445
1570
|
const hostname = (this.registryHost || '').trim();
|
|
1446
1571
|
|
|
1447
|
-
if ( this.
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
} else if ( !hostname || hostname === this.systemRegistry ) {
|
|
1572
|
+
if ( this.systemRegistry ) {
|
|
1573
|
+
// Empty string overrides the system default to nothing
|
|
1574
|
+
set(this.agentConfig, 'system-default-registry', '');
|
|
1575
|
+
} else {
|
|
1576
|
+
// No need to set anything
|
|
1577
|
+
set(this.agentConfig, 'system-default-registry', undefined);
|
|
1578
|
+
}
|
|
1579
|
+
if ( !hostname || hostname === this.systemRegistry ) {
|
|
1456
1580
|
// Undefined removes the key which uses the global setting without hardcoding it into the config
|
|
1457
1581
|
set(this.agentConfig, 'system-default-registry', undefined);
|
|
1458
1582
|
} else {
|
|
1459
1583
|
set(this.agentConfig, 'system-default-registry', hostname);
|
|
1460
1584
|
}
|
|
1461
1585
|
|
|
1462
|
-
if ( this.
|
|
1463
|
-
//
|
|
1464
|
-
|
|
1465
|
-
|
|
1586
|
+
if ( hostname && this.registrySecret ) {
|
|
1587
|
+
// For a registry with basic auth, but no mirrors,
|
|
1588
|
+
// add a single registry config with the basic auth secret.
|
|
1589
|
+
const basicAuthConfig = {
|
|
1590
|
+
[hostname]: {
|
|
1591
|
+
authConfigSecretName: this.registrySecret,
|
|
1592
|
+
caBundle: null,
|
|
1593
|
+
insecureSkipVerify: false,
|
|
1594
|
+
tlsSecretName: null,
|
|
1595
|
+
}
|
|
1596
|
+
};
|
|
1466
1597
|
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1598
|
+
const rkeConfig = this.value.spec.rkeConfig;
|
|
1599
|
+
|
|
1600
|
+
if (!rkeConfig) {
|
|
1601
|
+
this.value.spec.rkeConfig = { registries: { configs: basicAuthConfig } };
|
|
1602
|
+
} else if (rkeConfig.registries.configs && Object.keys(rkeConfig.registries.configs).length > 0) {
|
|
1603
|
+
// If some existing authentication secrets are already configured
|
|
1604
|
+
// for registry mirrors, the basic auth is added to the existing ones.
|
|
1605
|
+
const existingConfigs = rkeConfig.registries.configs;
|
|
1606
|
+
|
|
1607
|
+
this.value.spec.rkeConfig.registries.configs = { ...basicAuthConfig, ...existingConfigs };
|
|
1476
1608
|
} else {
|
|
1477
|
-
|
|
1609
|
+
const existingMirrorAndAuthConfig = this.value.spec.rkeConfig.registries;
|
|
1610
|
+
|
|
1611
|
+
this.value.spec.rkeConfig.registries = {
|
|
1612
|
+
...existingMirrorAndAuthConfig,
|
|
1613
|
+
configs: basicAuthConfig
|
|
1614
|
+
};
|
|
1478
1615
|
}
|
|
1479
|
-
} else {
|
|
1480
|
-
set(this.rkeConfig.registries, 'configs', {});
|
|
1481
|
-
set(this.rkeConfig.registries, 'mirrors', {});
|
|
1482
1616
|
}
|
|
1483
1617
|
},
|
|
1484
1618
|
|
|
1619
|
+
updateConfigs(configs) {
|
|
1620
|
+
// Update authentication configuration
|
|
1621
|
+
// for each mirror
|
|
1622
|
+
if (!this.value.spec?.rkeConfig) {
|
|
1623
|
+
this.value.spec.rkeConfig = { registries: {} };
|
|
1624
|
+
}
|
|
1625
|
+
set(this.value.spec.rkeConfig.registries, 'configs', configs);
|
|
1626
|
+
},
|
|
1627
|
+
|
|
1485
1628
|
getAllOptionsAfterMinVersion(versions, minVersion, defaultVersion) {
|
|
1486
1629
|
const out = (versions || []).filter(obj => !!obj.serverArgs).map((obj) => {
|
|
1487
1630
|
let disabled = false;
|
|
@@ -1614,7 +1757,10 @@ export default {
|
|
|
1614
1757
|
const res = await this.$store.dispatch('cluster/request', { url: `${ url }/${ HCI.SETTING }s` });
|
|
1615
1758
|
|
|
1616
1759
|
const version = (res?.data || []).find(s => s.id === 'harvester-csi-ccm-versions');
|
|
1760
|
+
// get harvester server-version
|
|
1761
|
+
const serverVersion = (res?.data || []).find(s => s.id === 'server-version');
|
|
1617
1762
|
|
|
1763
|
+
this.harvesterVersion = serverVersion.value;
|
|
1618
1764
|
if (version) {
|
|
1619
1765
|
this.harvesterVersionRange = JSON.parse(version.value || version.default || '{}');
|
|
1620
1766
|
} else {
|
|
@@ -1623,6 +1769,59 @@ export default {
|
|
|
1623
1769
|
}
|
|
1624
1770
|
this.setHarvesterDefaultCloudProvider();
|
|
1625
1771
|
},
|
|
1772
|
+
toggleCustomRegistry(e) {
|
|
1773
|
+
if (this.registryHost) {
|
|
1774
|
+
this.registryHost = null;
|
|
1775
|
+
this.registrySecret = null;
|
|
1776
|
+
} else {
|
|
1777
|
+
this.initRegistry();
|
|
1778
|
+
}
|
|
1779
|
+
},
|
|
1780
|
+
updateCisProfile() {
|
|
1781
|
+
// If the user selects any Worker CIS Profile,
|
|
1782
|
+
// protect-kernel-defaults should be set to false
|
|
1783
|
+
// in the RKE2 worker/agent config.
|
|
1784
|
+
const selectedCisProfile = this.agentConfig?.profile;
|
|
1785
|
+
|
|
1786
|
+
if (selectedCisProfile) {
|
|
1787
|
+
set(this.agentConfig, 'protect-kernel-defaults', true);
|
|
1788
|
+
} else {
|
|
1789
|
+
set(this.agentConfig, 'protect-kernel-defaults', false);
|
|
1790
|
+
}
|
|
1791
|
+
},
|
|
1792
|
+
|
|
1793
|
+
/**
|
|
1794
|
+
* Handle k8s changes side effects, like PSP and PSA resets
|
|
1795
|
+
*/
|
|
1796
|
+
handleKubernetesChange(value) {
|
|
1797
|
+
if (value) {
|
|
1798
|
+
const version = VERSION.parse(value);
|
|
1799
|
+
const major = parseInt(version?.[0] || 0);
|
|
1800
|
+
const minor = parseInt(version?.[1] || 0);
|
|
1801
|
+
|
|
1802
|
+
// Reset PSA if not RKE2
|
|
1803
|
+
if (!value.includes('rke2')) {
|
|
1804
|
+
set(this.value.spec, 'defaultPodSecurityPolicyTemplateName', '');
|
|
1805
|
+
} else {
|
|
1806
|
+
// Reset PSP if it's legacy due k8s version 1.25+
|
|
1807
|
+
if (major === 1 && minor >= 25) {
|
|
1808
|
+
set(this.value.spec, 'defaultPodSecurityPolicyTemplateName', '');
|
|
1809
|
+
} else {
|
|
1810
|
+
set(this.value.spec, 'defaultPodSecurityPolicyTemplateName', this.lastDefaultPodSecurityPolicyTemplateName);
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
this.previousKubernetesVersion = value;
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
},
|
|
1817
|
+
|
|
1818
|
+
/**
|
|
1819
|
+
* Keep last PSP value
|
|
1820
|
+
*/
|
|
1821
|
+
handlePspChange(value) {
|
|
1822
|
+
this.lastDefaultPodSecurityPolicyTemplateName = value;
|
|
1823
|
+
},
|
|
1824
|
+
|
|
1626
1825
|
},
|
|
1627
1826
|
};
|
|
1628
1827
|
</script>
|
|
@@ -1652,12 +1851,14 @@ export default {
|
|
|
1652
1851
|
@cancel="cancel"
|
|
1653
1852
|
@error="fvUnreportedValidationErrors"
|
|
1654
1853
|
>
|
|
1655
|
-
<
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1854
|
+
<div class="header-warnings">
|
|
1855
|
+
<Banner
|
|
1856
|
+
v-if="isEdit"
|
|
1857
|
+
color="warning"
|
|
1858
|
+
>
|
|
1859
|
+
<span v-html="t('cluster.banner.rke2-k3-reprovisioning', {}, true)" />
|
|
1860
|
+
</Banner>
|
|
1861
|
+
</div>
|
|
1661
1862
|
<SelectCredential
|
|
1662
1863
|
v-if="needCredential"
|
|
1663
1864
|
v-model="credentialId"
|
|
@@ -1690,6 +1891,7 @@ export default {
|
|
|
1690
1891
|
{{ appsOSWarning }}
|
|
1691
1892
|
</Banner>
|
|
1692
1893
|
|
|
1894
|
+
<!-- Pools Extras -->
|
|
1693
1895
|
<template v-if="hasMachinePools">
|
|
1694
1896
|
<div class="clearfix">
|
|
1695
1897
|
<h2
|
|
@@ -1723,6 +1925,7 @@ export default {
|
|
|
1723
1925
|
</div>
|
|
1724
1926
|
</div>
|
|
1725
1927
|
|
|
1928
|
+
<!-- Extra Tabs for Machine Pool -->
|
|
1726
1929
|
<Tabbed
|
|
1727
1930
|
ref="pools"
|
|
1728
1931
|
:side-tabs="true"
|
|
@@ -1752,17 +1955,19 @@ export default {
|
|
|
1752
1955
|
</Tab>
|
|
1753
1956
|
</template>
|
|
1754
1957
|
<div v-if="!unremovedMachinePools.length">
|
|
1755
|
-
|
|
1958
|
+
{{ t('cluster.machinePool.noPoolsDisclaimer') }}
|
|
1756
1959
|
</div>
|
|
1757
1960
|
</Tabbed>
|
|
1758
1961
|
<div class="spacer" />
|
|
1759
1962
|
</template>
|
|
1760
1963
|
|
|
1964
|
+
<!-- Cluster Tabs -->
|
|
1761
1965
|
<h2 v-t="'cluster.tabs.cluster'" />
|
|
1762
1966
|
<Tabbed
|
|
1763
1967
|
:side-tabs="true"
|
|
1764
1968
|
class="min-height"
|
|
1765
1969
|
>
|
|
1970
|
+
<!-- Basic -->
|
|
1766
1971
|
<Tab
|
|
1767
1972
|
name="basic"
|
|
1768
1973
|
label-key="cluster.tabs.basic"
|
|
@@ -1772,7 +1977,7 @@ export default {
|
|
|
1772
1977
|
<Banner
|
|
1773
1978
|
v-if="!haveArgInfo"
|
|
1774
1979
|
color="warning"
|
|
1775
|
-
label="
|
|
1980
|
+
:label="t('cluster.banner.haveArgInfo')"
|
|
1776
1981
|
/>
|
|
1777
1982
|
<Banner
|
|
1778
1983
|
v-if="showk8s21LegacyWarning"
|
|
@@ -1794,6 +1999,7 @@ export default {
|
|
|
1794
1999
|
:mode="mode"
|
|
1795
2000
|
:options="versionOptions"
|
|
1796
2001
|
label-key="cluster.kubernetesVersion.label"
|
|
2002
|
+
@input="handleKubernetesChange($event)"
|
|
1797
2003
|
/>
|
|
1798
2004
|
<Checkbox
|
|
1799
2005
|
v-model="showDeprecatedPatchVersions"
|
|
@@ -1868,16 +2074,56 @@ export default {
|
|
|
1868
2074
|
<h3>
|
|
1869
2075
|
{{ t('cluster.rke2.security.header') }}
|
|
1870
2076
|
</h3>
|
|
1871
|
-
<
|
|
2077
|
+
<Banner
|
|
2078
|
+
v-if="isEdit && displayInvalidPspsBanner"
|
|
2079
|
+
color="warning"
|
|
2080
|
+
>
|
|
2081
|
+
<span v-html="t('cluster.banner.invalidPsps', {}, true)" />
|
|
2082
|
+
</Banner>
|
|
2083
|
+
<Banner
|
|
2084
|
+
v-else-if="isCreate && !needsPSP"
|
|
2085
|
+
color="info"
|
|
2086
|
+
>
|
|
2087
|
+
<span v-html="t('cluster.banner.removedPsp', {}, true)" />
|
|
2088
|
+
</Banner>
|
|
2089
|
+
<Banner
|
|
2090
|
+
v-else-if="isCreate"
|
|
2091
|
+
color="info"
|
|
2092
|
+
>
|
|
2093
|
+
<span v-html="t('cluster.banner.deprecatedPsp', {}, true)" />
|
|
2094
|
+
</Banner>
|
|
2095
|
+
<div
|
|
2096
|
+
v-if="needsPSA"
|
|
2097
|
+
class="row mb-10"
|
|
2098
|
+
>
|
|
1872
2099
|
<div class="col span-6">
|
|
2100
|
+
<!-- PSA template selector -->
|
|
2101
|
+
<LabeledSelect
|
|
2102
|
+
v-model="value.spec.defaultPodSecurityAdmissionConfigurationTemplateName"
|
|
2103
|
+
:mode="mode"
|
|
2104
|
+
data-testid="rke2-custom-edit-psa"
|
|
2105
|
+
:options="psaOptions"
|
|
2106
|
+
:label="t('cluster.rke2.defaultPodSecurityAdmissionConfigurationTemplateName.label')"
|
|
2107
|
+
/>
|
|
2108
|
+
</div>
|
|
2109
|
+
</div>
|
|
2110
|
+
|
|
2111
|
+
<div class="row">
|
|
2112
|
+
<div
|
|
2113
|
+
v-if="pspOptions && needsPSP"
|
|
2114
|
+
class="col span-6"
|
|
2115
|
+
>
|
|
2116
|
+
<!-- PSP template selector -->
|
|
1873
2117
|
<LabeledSelect
|
|
1874
|
-
v-if="pspOptions"
|
|
1875
2118
|
v-model="value.spec.defaultPodSecurityPolicyTemplateName"
|
|
2119
|
+
data-testid="rke2-custom-edit-psp"
|
|
1876
2120
|
:mode="mode"
|
|
1877
2121
|
:options="pspOptions"
|
|
1878
2122
|
:label="t('cluster.rke2.defaultPodSecurityPolicyTemplateName.label')"
|
|
2123
|
+
@input="handlePspChange($event)"
|
|
1879
2124
|
/>
|
|
1880
2125
|
</div>
|
|
2126
|
+
|
|
1881
2127
|
<div
|
|
1882
2128
|
v-if="showCisProfile"
|
|
1883
2129
|
class="col span-6"
|
|
@@ -1894,7 +2140,8 @@ export default {
|
|
|
1894
2140
|
v-model="agentConfig.profile"
|
|
1895
2141
|
:mode="mode"
|
|
1896
2142
|
:options="profileOptions"
|
|
1897
|
-
label="
|
|
2143
|
+
:label="t('cis.workerProfile')"
|
|
2144
|
+
@input="updateCisProfile"
|
|
1898
2145
|
/>
|
|
1899
2146
|
</div>
|
|
1900
2147
|
</div>
|
|
@@ -1951,6 +2198,7 @@ export default {
|
|
|
1951
2198
|
</div>
|
|
1952
2199
|
</Tab>
|
|
1953
2200
|
|
|
2201
|
+
<!-- Member Roles -->
|
|
1954
2202
|
<Tab
|
|
1955
2203
|
v-if="canManageMembers"
|
|
1956
2204
|
name="memberRoles"
|
|
@@ -1970,6 +2218,7 @@ export default {
|
|
|
1970
2218
|
/>
|
|
1971
2219
|
</Tab>
|
|
1972
2220
|
|
|
2221
|
+
<!-- etcd -->
|
|
1973
2222
|
<Tab
|
|
1974
2223
|
name="etcd"
|
|
1975
2224
|
label-key="cluster.tabs.etcd"
|
|
@@ -2047,6 +2296,7 @@ export default {
|
|
|
2047
2296
|
</div>
|
|
2048
2297
|
</Tab>
|
|
2049
2298
|
|
|
2299
|
+
<!-- Networking -->
|
|
2050
2300
|
<Tab
|
|
2051
2301
|
v-if="haveArgInfo"
|
|
2052
2302
|
name="networking"
|
|
@@ -2148,6 +2398,7 @@ export default {
|
|
|
2148
2398
|
/>
|
|
2149
2399
|
</Tab>
|
|
2150
2400
|
|
|
2401
|
+
<!-- Upgrade -->
|
|
2151
2402
|
<Tab
|
|
2152
2403
|
name="upgrade"
|
|
2153
2404
|
label-key="cluster.tabs.upgrade"
|
|
@@ -2192,55 +2443,91 @@ export default {
|
|
|
2192
2443
|
</div>
|
|
2193
2444
|
</Tab>
|
|
2194
2445
|
|
|
2446
|
+
<!-- Registries -->
|
|
2195
2447
|
<Tab
|
|
2196
2448
|
name="registry"
|
|
2197
2449
|
label-key="cluster.tabs.registry"
|
|
2198
2450
|
>
|
|
2199
|
-
<
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
:register-before-hook="registerBeforeHook"
|
|
2219
|
-
:hook-priority="1"
|
|
2220
|
-
:mode="mode"
|
|
2221
|
-
in-store="management"
|
|
2222
|
-
:allow-ssh="false"
|
|
2223
|
-
:allow-rke="true"
|
|
2224
|
-
:vertical="true"
|
|
2225
|
-
:namespace="value.metadata.namespace"
|
|
2226
|
-
generate-name="registryconfig-auth-"
|
|
2227
|
-
/>
|
|
2228
|
-
<template v-else-if="registryMode === ADVANCED">
|
|
2229
|
-
<RegistryMirrors
|
|
2230
|
-
v-model="value"
|
|
2231
|
-
class="mt-20"
|
|
2232
|
-
:mode="mode"
|
|
2233
|
-
/>
|
|
2234
|
-
|
|
2235
|
-
<RegistryConfigs
|
|
2236
|
-
v-model="value"
|
|
2237
|
-
class="mt-20"
|
|
2238
|
-
:mode="mode"
|
|
2239
|
-
:cluster-register-before-hook="registerBeforeHook"
|
|
2451
|
+
<div class="row">
|
|
2452
|
+
<h3>Registry for Rancher System Container Images</h3>
|
|
2453
|
+
</div>
|
|
2454
|
+
<div class="row">
|
|
2455
|
+
<div class="col span-12">
|
|
2456
|
+
<Banner
|
|
2457
|
+
:closable="false"
|
|
2458
|
+
class="cluster-tools-tip"
|
|
2459
|
+
color="info"
|
|
2460
|
+
label-key="cluster.privateRegistry.description"
|
|
2461
|
+
/>
|
|
2462
|
+
</div>
|
|
2463
|
+
</div>
|
|
2464
|
+
<div class="row">
|
|
2465
|
+
<Checkbox
|
|
2466
|
+
v-model="showCustomRegistryInput"
|
|
2467
|
+
class="mb-20"
|
|
2468
|
+
:label="t('cluster.privateRegistry.label')"
|
|
2469
|
+
@input="toggleCustomRegistry"
|
|
2240
2470
|
/>
|
|
2471
|
+
</div>
|
|
2472
|
+
<div
|
|
2473
|
+
v-if="showCustomRegistryInput"
|
|
2474
|
+
class="row"
|
|
2475
|
+
>
|
|
2476
|
+
<div class="col span-6">
|
|
2477
|
+
<LabeledInput
|
|
2478
|
+
v-model="registryHost"
|
|
2479
|
+
label-key="catalog.chart.registry.custom.inputLabel"
|
|
2480
|
+
placeholder-key="catalog.chart.registry.custom.placeholder"
|
|
2481
|
+
:min-height="30"
|
|
2482
|
+
/>
|
|
2483
|
+
<SelectOrCreateAuthSecret
|
|
2484
|
+
v-model="registrySecret"
|
|
2485
|
+
:register-before-hook="registerBeforeHook"
|
|
2486
|
+
:hook-priority="1"
|
|
2487
|
+
:mode="mode"
|
|
2488
|
+
in-store="management"
|
|
2489
|
+
:allow-ssh="false"
|
|
2490
|
+
:allow-rke="true"
|
|
2491
|
+
:vertical="true"
|
|
2492
|
+
:namespace="value.metadata.namespace"
|
|
2493
|
+
generate-name="registryconfig-auth-"
|
|
2494
|
+
/>
|
|
2495
|
+
</div>
|
|
2496
|
+
</div>
|
|
2497
|
+
<template>
|
|
2498
|
+
<div
|
|
2499
|
+
v-if="showCustomRegistryInput"
|
|
2500
|
+
class="row"
|
|
2501
|
+
>
|
|
2502
|
+
<AdvancedSection
|
|
2503
|
+
class="col span-12 advanced"
|
|
2504
|
+
:is-open-by-default="showCustomRegistryAdvancedInput"
|
|
2505
|
+
:mode="mode"
|
|
2506
|
+
>
|
|
2507
|
+
<Banner
|
|
2508
|
+
:closable="false"
|
|
2509
|
+
class="cluster-tools-tip"
|
|
2510
|
+
color="info"
|
|
2511
|
+
:label-key="isK3s ? 'cluster.privateRegistry.docsLinkK3s' : 'cluster.privateRegistry.docsLinkRke2'"
|
|
2512
|
+
/>
|
|
2513
|
+
<RegistryMirrors
|
|
2514
|
+
v-model="value"
|
|
2515
|
+
class="mt-20"
|
|
2516
|
+
:mode="mode"
|
|
2517
|
+
/>
|
|
2518
|
+
<RegistryConfigs
|
|
2519
|
+
v-model="value"
|
|
2520
|
+
class="mt-20"
|
|
2521
|
+
:mode="mode"
|
|
2522
|
+
:cluster-register-before-hook="registerBeforeHook"
|
|
2523
|
+
@updateConfigs="updateConfigs"
|
|
2524
|
+
/>
|
|
2525
|
+
</AdvancedSection>
|
|
2526
|
+
</div>
|
|
2241
2527
|
</template>
|
|
2242
2528
|
</Tab>
|
|
2243
2529
|
|
|
2530
|
+
<!-- Add-on Config -->
|
|
2244
2531
|
<Tab
|
|
2245
2532
|
name="addons"
|
|
2246
2533
|
label-key="cluster.tabs.addons"
|
|
@@ -2304,6 +2591,7 @@ export default {
|
|
|
2304
2591
|
</div>
|
|
2305
2592
|
</Tab>
|
|
2306
2593
|
|
|
2594
|
+
<!-- Advanced -->
|
|
2307
2595
|
<Tab
|
|
2308
2596
|
v-if="haveArgInfo || agentArgs['protect-kernel-defaults']"
|
|
2309
2597
|
name="advanced"
|
|
@@ -2420,4 +2708,7 @@ export default {
|
|
|
2420
2708
|
.patch-version {
|
|
2421
2709
|
margin-top: 5px;
|
|
2422
2710
|
}
|
|
2711
|
+
.header-warnings .banner {
|
|
2712
|
+
margin-bottom: 0;
|
|
2713
|
+
}
|
|
2423
2714
|
</style>
|