-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] Add cloud providers via configuration #1553
base: master
Are you sure you want to change the base?
Conversation
@grolu You need rebase this pull request with latest master branch. Please check. |
# Conflicts: # frontend/src/components/ShootWorkers/GManageWorkers.vue # frontend/src/views/GNewShoot.vue
# Conflicts: # frontend/src/composables/useShootContext.js
Gardener landscape administrators should have the possibility to change icons and names of vendors (cloud providers, image vendors, etc.). This enables the administrator to adjust vendors and apply company or context-specific values. An example of use could be a locally hosted OpenStack infrastructure that should appear as `MyCustomCloud` with a custom icon in the Dashboard, so that the user immediately identifies it as `MyCustomCloud` as they might not be familiar with the term `OpenStack`. | ||
|
||
## Vendor Configuration | ||
It is possible to change the name and icon of built-in vendors in the Gardener Dashboard (e.g., AWS, Ubuntu, etc.) when using the [helm chart](https://github.com/gardener/dashboard/blob/master/charts/gardener-dashboard) in the `frontend.vendors` map. You can add a key for each vendor that you want to customize. The key equals the vendor type. The following configuration properties are supported: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to change the name and icon of built-in vendors in the Gardener Dashboard (e.g., AWS, Ubuntu, etc.) when using the [helm chart](https://github.com/gardener/dashboard/blob/master/charts/gardener-dashboard) in the `frontend.vendors` map. You can add a key for each vendor that you want to customize. The key equals the vendor type. The following configuration properties are supported: | |
You can change the name and icon of built-in vendors in the Gardener Dashboard (e.g., AWS, Ubuntu) by configuring the `frontendConfig.vendors` map in the [Helm chart](https://github.com/gardener/dashboard/blob/master/charts/gardener-dashboard). To customize a vendor, add a key corresponding to the vendor type. The following configuration properties are supported: |
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: dashboard-vendor-assets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to configmap-assets.spec.js
, add tests for vendor-assets
# # cloudProviderList - configure available cloud providers. This allows to change order and to add additional (not built-in providers), see also customCloudProviders | ||
# cloudProviderList: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# # cloudProviderList - configure available cloud providers. This allows to change order and to add additional (not built-in providers), see also customCloudProviders | |
# cloudProviderList: | |
# # cloudProviderList - configure available cloud providers. This allows to change order and to add additional (not built-in providers), see also customCloudProviders | |
# cloudProviderList: |
# path: spec.provider.extra | ||
# hint: Enter Additional data | ||
# label: Additional Information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# path: spec.provider.extra | |
# hint: Enter Additional data | |
# label: Additional Information | |
# path: spec.provider.extra | |
# hint: Enter Additional data | |
# label: Additional Information |
/* customCloudProvider */ | ||
// const customCloudProviderData = reactive({}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
@blur="v$.fieldData[key].$touch()" | ||
/> | ||
<v-select | ||
v-if="type === 'select' || type === 'select-multiple'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v-if="type === 'select' || type === 'select-multiple'" | |
v-else-if="type === 'select' || type === 'select-multiple'" |
@blur="v$.fieldData[key].$touch()" | ||
/> | ||
<v-textarea | ||
v-if="type === 'yaml' || type === 'json'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v-if="type === 'yaml' || type === 'json'" | |
v-else-if="type === 'yaml' || type === 'json'" |
It is possible to define input fields with data validation for the `Infrastructure Details` section on the create cluster page as well as for the infrastructure secret dialog. The array can contain field definitions with the following properties: | ||
| name | description | | ||
| ---- | ----------- | | ||
| `key` | Unique key for the input field. Used as the secret data key if defined as part of infrastructure secret dialog. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used as the secret data key if defined as part of infrastructure secret dialog.
Not sure if this sentence can easily be understood.
}, | ||
set (value) { | ||
forEach(customCloudProviderFields.value, ({ key, path }) => { | ||
set(manifest.value, [`${path}.${key}`], get(value, [key])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[`${path}.${key}`]
a bug sneaked in after you have adapted for the changes introduced with #2029
Now, a top level property with dots would be set
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
<template> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
introduce GGenericInputField.vue component that handles one field for better readability. Not sure if a component like GGenericInputFields.vue is then still necessary
values: | ||
- foo | ||
- bar | ||
specTemplate: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not get the specTemplate
to work, the following was my config (snipped)
customCloudProviders:
custom-provider:
shoot:
specTemplate:
provider:
type: DUMMY
networking:
nodes: 9.8.7.6
# Conflicts: # charts/__tests__/gardener-dashboard/runtime/dashboard/__snapshots__/configmap.spec.js.snap # frontend/src/components/Secrets/GSecretDialogAzure.vue
# Conflicts: # backend/lib/routes/config.js # frontend/src/components/GVendorIcon.vue # frontend/src/components/NewShoot/GNewShootInfrastructureDetails.vue # frontend/src/components/Secrets/GSecretDialog.vue # frontend/src/components/Secrets/GSecretDialogGeneric.vue # frontend/src/composables/useShootContext.js # frontend/src/views/GSecrets.vue
108bf87
to
d6e5d0a
Compare
What this PR does / why we need it:
On top of PR #1434 this PR adds logic to define additional cloud providers via configuration (
customCloudProviders
).It is possible to define a custom secret dialog including (simple) validation and help texts.
It is also possible to configure custom input fields that are added to the
Infrastructure Details
section of the create cluster page.Supported input types:
text
: Simple plain text input.password
: Hidden plain text input.select
: List of values that the user can select.select-multiple
: Allow to select multiple values from a list.json
: Object data in JSON format.yaml
: Object data in YAML input.Supported validations:
required
requiredIf
(ref to other field)regex
isValidObject
(depends on the type - valid json or a yaml object)See example configuration below for more details.
A custom cloud provider icon can be defined using an image resource mounted via asset configuration.
This way it is also possible to overwrite icons as well as names for build-in cloud providers (like aws, gpc, etc) and for machine image vendors (ubuntu, gardenlinux, etc.)
It is possible to provide additional required static data for the shoot template of a custom cloud provider via configuration.
For additional required configurable data, input fields for the custom cloud provider can be defined that will appear on the create cluster page.
This PR also adds a configuration option for the available cloud providers (
cloudProviderList
). This allows to add additional cloud providers as well as configure their order in the Dashboard. It is possible to add cloud providers without additional configuration, the secret dialog and logo will fallback to generic input / icon.This PR removes the logic that filters cloud profiles without a matching seed in the backend. All cloud profiles show up in the frontend. Cloud profiles without matching seed will show a hint to the user.
Example dashboard configuration for a cloud provider with name
custom
Icons can be provided as base64 encoded values when using the helm chart in the frontendConfig.vendorAssets map. Those icons can then be refrenced in the vendor configurations as well as the help html as shown above.
You can also use data: scheme for development. For production it is recommended to provide static assets.
Cloud provider
custom
rendered in the DashboardWhich issue(s) this PR fixes:
Fixes #1445 Fixes #554 Fixes #1707 Fixes #207
Special notes for your reviewer:
Release note: