Commit Graph

87 Commits

Author SHA1 Message Date
Francesco Torchia b5ec434a42
- Add providerSummary getter to machinedeployment model
- Hide provider labels for Harvester clusters

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-01-02 15:17:35 +01:00
Shavindra 2e69430808
Fix fleet cluster state (#10162)
* Display cluster state.

* Display cluster repo status badge.

* Fix typo.

* Fix typo.

* Fix linting.

* Fix linting.

* Removed type from request.

* Reverted change.
2023-12-18 10:52:11 +01:00
momesgin 807e2dc96c
scaling down to zero restrictions for RKE1 (#10017)
* disable scale down to zero

* scaling down to zero restrictions for RKE1

* removed extra optional chaining

* removed wrong condition for minus button

* added unit tests

* combined rke1 and rke2 scale down modals + more tests + minor refactor

* delete unused file ScaleRke1NodeDownDialog.vue

* moved logic from created to data + used nameDisplay for both rke1 and rke2

---------

Co-authored-by: Mo Mesgin <mmesgin@Mos-M2-MacBook-Pro.local>
2023-12-14 10:08:34 -08:00
momesgin 19ef9f262c
fixed scale up button not showing up (#10019)
Co-authored-by: Mo Mesgin <mmesgin@Mos-M2-MacBook-Pro.local>
2023-11-13 07:55:49 -08:00
Richard Cox df9c4be595
Merge pull request #9714 from torchiaf/9665-provissioning-actions-error
Fix 'Scale Down' crash in cluster provisioning details page
2023-09-28 16:06:56 +01:00
Francesco Torchia 09168d3683
Add empty availableActions to fake rows in cluster provisioning details page
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2023-09-14 17:38:41 +02:00
Francesco Torchia 92cbdf86a9
Add unit tests for HPA details page
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2023-09-05 16:57:49 +02:00
Francesco Torchia f861aa05b4
Fix Current Metrics array, get values by metric name
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2023-09-05 16:57:49 +02:00
Alexandre Alves 871bca5f9f
RKE1 / RKE2 custom clusters tab redirect (#9586)
* add missing conditions for rke1 custom cluster to redirect to regsitration tab when there's no machines registered

* address pr comments

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-08-28 16:14:02 +01:00
Richard Cox e304434e34 Fix issue causing node detail page to be unreachable
- caused by localisation missing required strings
- also fixed width of image list
2023-08-10 18:37:08 +01:00
Shavindra f9a954a263
#4683 - Add fleet gitrepo resource age per cluster. (#9299)
* Add fleet gitrepo resource age per cluster.
2023-07-20 14:24:20 +02:00
Bastian Hofmann df28349726
Merge branch 'master' into embed-project-monitoring-dashboards 2023-07-13 15:37:34 +02:00
Alexandre Alves be22353ed9
fix broken pod details page (#9315)
Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-07-13 12:39:12 +01:00
Richard Cox e60d02009a
Merge pull request #9033 from bashofmann/hpa-behavior
Add HorizontalPodAutoscaler scaling behavior support
2023-07-12 16:06:17 +01:00
Alexandre Alves 90cb245c08
Wire in extension table column feature to cluster `node` list and other hardcoded places (#9186)
* add logic to support new table cols via extensions hook on resource table instead of type-map so that we can capture table with locally defined headers like the nodes list

* cleanup

* address PR comments

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-07-12 14:35:34 +01:00
Neil MacDougall c9e1a19396
Extension support for custom provisioning (#9246)
* Extension support for custom provisioning

* FIx lint issues

* Discovery / Tweaks
- fix issue where namespacesOverride was lost
- tidy up PROVIDER
- try to handle missing provider=type url param (could be missing extension-params)
- added a few comments to comments to come back to

* Names and typings
- change param --> customParam to make it clearer it's not url params
- add labels-annotations to shell types

* Wire in provider detailTabs
- as per original readme this should be made generic (extension point working directly with ResourceTabs)

* Update IClusterProvisioner & docs

* Improvements / Changes to support proving out DO extension
- cluster hooks optional
- buff up save hook (and pass in cluster when calling apply fn)
- move normalizeName into generic place
- bring back async create machine config
- hack for do extension (map example provider to do provider)

* updates, add optional saveCluster, add missing kube file
- saveCluster complements hooks, doesn't skip handling of addons, etc
- ensure register hooks take the `this` context in all worlds

* Adding docs

* Updates
- location config based changes
  - change customParams to context
  - add query param
- add new extention point to add tabs to cluster create cluster config section
- fixed some typing
- fixed issue where cluster was not passed to before / after hooks (only important if 'this' changes

* Changes following review, fix `t` in plugins

* Fix linting

* Docs updates, pass through more edit/view things

* Conditionally show the namespace grouping in the cluster list
- means users can differentiate between clusters with same name in different namespaces
- useful when clusters created via extension provisioner where ns can be selected

* docs tweaks, actually include the provisioning page in docs

---------

Co-authored-by: Richard Cox <richard.cox@suse.com>
2023-07-11 22:17:57 +01:00
Bastian Hofmann 47f5d51c04
Fix styling
Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>
2023-07-10 16:48:40 +02:00
Bastian Hofmann 10a9c31fbc
Add HorizontalPodAutoscaler scaling behavior support
* Adds form fields to edit the autoscaling behavior in the HPA edit form
* Adds autoscaling behavior information on the HPA detail page

Fixes https://github.com/rancher/dashboard/issues/9032

Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>
2023-07-10 16:33:04 +02:00
Mo Mesgin 0afe229af5 remove overlay loading from pod details 2023-07-07 09:54:49 -07:00
Bastian Hofmann 57e4caa704
ClusterRepo detail page: Add git commit hash for git repos (#8985)
Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>
2023-06-29 10:07:37 +01:00
Giuseppe Leo 01eeb0548f
Add recommended lint rules globally (#8997)
* Update configuration

* Create default config for eslint

* Restore plugin:vue/recommended

* Add exceptions and overrides

* Correct manually remaining issues

* Adding further picked exceptions groupped up

* Fix or disable specific cases manually and singularly

* Add naming linting exception

* Remove unused variable in component

* Move rules to default

* Autocorrect rancher/components linting issues

* Configure VSCode to use multiple files, to display linting for rancher components

* Disable jest lint hook restriction for string list component

* Autofix
2023-06-23 17:02:55 +02:00
Nancy Butler e00489165a use projecthelmchart dashboardValues for grafana url 2023-06-21 13:44:17 -07:00
Bastian Hofmann 6c72d379d8
Embed project monitoring metric dashboards
This embeds the project monitoring Grafana metric dashboards if they are present and user has no access to cluster monitoring.

Fixes https://github.com/rancher/dashboard/issues/7286

Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>
2023-06-09 16:29:23 +02:00
Giuseppe Leo 1e5057460f
Automation: Cronjob Run Now does generate resources in Jobs Detail page (#9026)
* Fix import issues

* Add cron job tests

* Add redirection test
2023-06-05 11:34:34 +02:00
Giuseppe Leo 312529d463
Updated memory value for node with reserved instead of capacity (#9014) 2023-06-01 17:32:43 +02:00
Bastian Hofmann 101bd9320a
Fix prometheus links on project monitor detail page (#8351)
If alertmanager is deactivated, the prometheus links should not be disabled. Previously all links were disabled as soon as the alertmanager was disabled, because it picked the namespace from the alertmanager url, which is empty if disabled.

Fixes https://github.com/rancher/dashboard/issues/8350

Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>
2023-05-24 10:26:16 +01:00
Phillip Rak ade3c9f4e7 Replace all instances of `v-tooltip` with `v-clean-tooltip`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2023-05-18 15:39:14 -07:00
Bastian Hofmann 3c955e6f52
Improve OPA Gatekeeper constraint detail page (#8586)
This adds the following functionality to the violations list on the OPA Gatekeeper constraint detail page:

* Add a namespace column to the violations
* Make the violations list searchable
* Allow to download the violations as a CSV, similar to CIS scanner violations

Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>
2023-04-27 09:27:37 +01:00
Alexandre Alves d29f5ca2e2
add missing dispatch to fetch fleet workspaces (#8641)
Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-04-06 18:30:13 +01:00
Phillip Rak 7cecbc0f62 Replace all instances of `v-html` with `v-clean-html`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2023-03-22 08:30:15 -07:00
Alexandre Alves 128ca36f91
Fix scaling of deployment in bad state (#8260)
* change condition to check if buttons for scale up/scale down deployment are enabled

* revert changes

* change condition to check if buttons for scale up/scale down deployment are enabled

* `canUpdate` exists in inherited `resource-class` class
- I've confirmed this change is ok with Alex

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
Co-authored-by: Richard Cox <ricox@suse.com>
2023-03-17 16:40:14 +00:00
Neil MacDougall 2859ad0214
Fix OPA Gatekeeper constraint inconsistencies (#7979) 2023-03-09 21:24:36 +00:00
Shavindra e12939115e
Allow basic fleet user to manage fleet without cluster permissions. (#7446)
* Allow basic fleet user to manage fleet without cluster permissions.

* Handle no workspaces.

* Add Fleet bundle namespace mapping - fleet.cattle.io.bundlenamespacemapping

* Add git repo restrictions.

* Handle auth errors for checkSchemasForFindAllHash.

* Fix workspace switcher and handle fleetworkspaces 401 issues.

* Update workspace switcher.

* Fix Gitrepo restriction creation from the Workspace create

* Disable workspace creation
* Fix workspace loading after creation

* Fix Bundle creation error.

* Remove redudant FLEET.TOKEN request.
2023-02-23 14:15:32 +00:00
Richard Cox 95fdf80dcb
Merge pull request #8224 from richard-cox/stale-management-resources
Fix stale management cluster resources
2023-02-23 11:58:24 +00:00
Shavindra d7e5dc50c4
[2.7.2] Handle nodeGroups undefined for imported EKS cluster (#8196)
* Handle nodeGroups undefined for manually imported RKE cluster.

* Forward part changes from #8222

---------

Co-authored-by: Neil MacDougall <nmacdougall@suse.com>
2023-02-22 15:41:12 +00:00
Richard Cox 6ce6632e13 Fix update of machines/pools in cluster detail Pools tab
- fix issue where ..
  - state 1 - X machines + Y fake machines = total
  - state 2 - X+1 machines + Y-1 fake machines = same total
- same total meant sortable table `arrangedRows` value wasn't updating
- fix is to ensure the sort generation changes so `arrangedRows` doesn't return the cached rows
- this is the same method used for the project/namespace list
2023-02-20 17:09:52 +00:00
Alexandre Alves 5f91d46762
Node Pool fake machines bug (#8151)
* update fakeMachines naming matching function

* update code based on PR comment

* Final tweak
- isElementalCluster will always result in the same `machinePoolInfName.includes(machineFullName)`, so exit early with it
- tidy up var names

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
Co-authored-by: Richard Cox <ricox@suse.com>
2023-02-15 14:01:32 +00:00
Alexandre Alves 0e33fd4c13
getting elemental changes on cluster provisioning back to rancher dashboard (#7543)
* getting elemental changes on cluster provisioning back to rancher dashboard

* code cleanup

* apiversion created from machineCconfig schema attributes

* add machine-config loader to load it from an extension

* fix issue where elemental cluster details could not be displayed + minor changes and fixes

* fix bug where elemental infrastructureRef.name for elemental start with nc- and therefore was generating a fake machine when it shouldnt + cleanup prov cluster model

* prevent code change

* getting k8s file back up to master state to avoid complex merge conflicts

* getting k8s file back up to master state to avoid complex merge conflicts

* applying changes to cluster.x-k8s.io.machinedeployment

* Address PR feedback

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
Co-authored-by: Neil MacDougall <nmacdougall@suse.com>
2023-01-27 16:12:47 +00:00
Catherine Luse 71eab01346
Merge pull request #7962 from catherineluse/helm-chart-versions
Avoid saving duplicate Helm chart versions
2023-01-19 10:51:04 -07:00
richa eeb8fa1d86
Added scale down promt confirmation on RKE clusters (#7926)
* Added scale down promt confirmation on RKE clusters

* Removed extra test code

* Modify toggleScaleDownModal function

* Added promt to RKE cluster
2023-01-19 13:34:16 +01:00
Catherine Luse 87174680c5 Avoid saving duplicate Helm chart versions 2023-01-19 03:19:09 -07:00
Sean-McQ ca1b810c7b
Moves sockets into the advanced worker (#7760)
* Moves sockets into the advanced worker

* worker can die peacefully now, making switching between cluster work.

* Make waitFor generic, wire in to waitForTestFn

* General Changes
- Fixes for switching cluster
  - includes using common getPerformanceSetting
  - avoid new code to unsub before socket disconnect
- handle `watch` `stop` requests
- lots of TODO's (questions, work, checks, test, etc)
- use common

* Switch socket fixes
- isAdvancedWorker should only be true for cluster store
- advancedWorker to be wired in

* Fix socket id for cluster workers
- sockets use an incremented local var for id
- when we nuke the socket file within the worker this resets, so they all ahve id of 1
- work around this by applying the unix time

* Fix handling of new partical counts response
- seen in dex cluster explorer dashboard
- count cards would be removed when partial counts response received

* Make resourceWatcher the sole location for watch state
- getters canWatch, watchStarted now are worked around (they look at state in the UI thread)
  - we now don't call resource.stop or restart.start in subscription
- tidied up `forgetType`
- moved clearFromQueue from steve mutations into subscription mutations (better location)
- added and removed some TODOs
- fixed watch (stop handler should be higher up, include force watch handling)

* pushes the csrf value into worker and adds it to fetch request headers.

* refactors batchChanges to address ref concerns and be more performant

* Maintain schema reference whilst updating
- This change mutates input in a function, which is bad...
- but ensures the reference isn't broken, which is needed to maintain similar functionality as before

* Fix waitForTestFn
- Seen when creating or viewing clusters

* On unwatch ensure any pending watch requests are removed from the queue
- the probably would have been a problem if the worker wasn't nuked
- however as the codes there lets make it safe

Also added `trace` feature in advanced worker, will probably bring out to other places as well

* Fix navigation from cluster manager world to any cluster
- Ensure that we handle the case where the advanced worker was created but the resource watcher wasn't
- ... but fix case where this was happening (aka ensure that a blank cluster context is ignored)

* Tidy some TODOs

* Add perf settings page
- This will help test normal flow (when advanced worker is disabled)
- Note - setting is now in a bag. This may help us better support further settings (enable client side pagination, etc)
  ```
  advancedWorker: { enabled: false },
  ```

* FIX - Nav from cluster dashboard --> specific event --> cluster dashboard and events not re-subbed
- Ensure we block default handling of resource.start (keep state in resource watcher)

* Tidying up some TODOs

* Adds in a cache and uses it to validate SCHEMA messages before batching.

* Forgot to actually save CSRF to the resourceWatcher when instantiated.

* an empty resource in a batchChange to signal remove

* Move addSchemaIndexFields to and created removeSchemaIndexFields in new file
- this avoids bringing class files into the worker

* Fix disconnect/reconnect
- Remove `syncWatch` (do the watch/unwatch straight away)
- Test/Fix re-sub on reconnect
- Test/Fix growls on disconnect

* Tidying up some TODO's
- including clean of workerQueue on resource.stop (this is SUPER defensive)

* batchChanges will now handle aliases

* Fix pods list - WIP
- ensure podsByNamespace is updated on batchChange

TODO
- the final update to the pod is ignored
- removing a namespace cleans the cache correctly
- disabling advanced worker still works

* Fix pods list - fixes
- ensure podsByNamespace is updated on batchChange

Tested / Fixed
- the final update to the pod is ignored
- removing a namespace cleans the cache correctly
- disabling advanced worker still works

* Tidying TODOs

* Remove default same-origin header
- https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials

* Fixed TODO description

* Refactor subscribe, make it clear which vuex feature relates to what

* Lots of Fixes
- batchChanges fixes
  - fix index is 0 issues (!/!!index)
  - only `set` if we have to
  - ensure we set the correct index after pushing to list
  - ensure map is updated after reducing list size with limit
- podsByNamespace fixes
  - ensure when ew replace... we don't use the same referenced object
- general service resource fixes
  - ensure service's pods list stays up to date with store

* Multiple improvements/fixes
- resourceCache - store the hash instead of the whole object. This means longer load time be reduces memory footprint
- resourceWatcher
  - don't re-sub on socket reconnect if watcher is in error
  - don't sub if watcher is in error
  - don't unwatch for 'failed to find schema' and 'too old' errors
    - this clears the error, we won't to keep it to ensure we don't watch
- Remove #5997 comments, follow on work #7917

* toggle debug, remap alias types, cleaned up comments and console

* Unit tests for batchChanges
Much more scope for some crazy content

* Logging tweaks
- disable logging by default
- initWorker comes in too late to affect initial trace, so just rely on the `debug` to toggle at runtime

Co-authored-by: Richard Cox <richard.cox@suse.com>
2023-01-13 16:03:00 -05:00
richa b89bcb595f
Prompt node pool (#7772)
* Added prompt in machinedeployment

* Save users promptConfirmation in cookies

* Changed pormpt size

* Added comments to the code, replace mounted function with create

* Fixed review comments

* Removed cookies added scale pool promt variable in prefs file

* Corrected pref variable name format and update comments

* Added confirmation prompt option in pref page
2023-01-11 15:51:47 +01:00
codyrancher 5d75ccf83d
Merge pull request #7672 from codyrancher/catalog
This fixes an issue where catalog/charts were stale after a repo was updated
2022-12-09 13:50:47 -07:00
Catherine Luse dc136f2bcd
Merge pull request #7385 from catherineluse/ec2-ip
Show both internal and external IP in list of nodes
2022-12-09 12:34:03 -07:00
Cody Jackson 90ca1209f4 This fixes an issue where catalog/charts were stale after a repo was updated
The catalog.cattle.io.clusterrepos/{repo} resource doesn't subscribe to updates. We now force a full request in the areas where it's appropriate to do so.

fixes #7668
2022-12-09 08:38:28 -07:00
richa c792d21dd9
Fixed icon size (#7557)
* Fixed icon size

* Add node inactive warning indicator (#7548)

* StringList, delete item on editing

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Bump @rancher/components version

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Add manage button to home page (#7546)

* Add manage button to home page

* Fix button spacing

* Make buttons smaller - looks better with extra button

* Fixed icon size in simplebox

* icon fix in GrowlManager.vue

* Add node inactive warning indicator (#7548)

* StringList, delete item on editing

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Bump @rancher/components version

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Add manage button to home page (#7546)

* Add manage button to home page

* Fix button spacing

* Make buttons smaller - looks better with extra button

* Fixed close icon size

* Fixed more icons sizes

* Fixed icon size in namespaces filter

* Reverd css changes in LabeledSelect component

* Fix on Header

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
Co-authored-by: Neil MacDougall <nwmac@users.noreply.github.com>
Co-authored-by: Francesco Torchia <francesco.torchia@suse.com>
Co-authored-by: Richa Bisht <RBISHT@Richas-MacBook-Pro.local>
2022-12-08 16:52:53 +01:00
Catherine Luse aaf65b60c6 Show both internal and external IPs in list of nodes 2022-12-07 09:53:50 -07:00
Nancy ac4f997a51
do not attempt to hide recent events tab when there are no events (#7540) 2022-11-29 08:53:37 -07:00
Shavindra 7601340ecc
Fix RKE2 Node status in cluster management. (#7169)
* Fix RKE2 Node status.
2022-11-29 14:21:13 +00:00