Skip to content
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

[PoC] Add cloud providers via configuration #1436

Closed
wants to merge 18 commits into from

Conversation

grolu
Copy link
Contributor

@grolu grolu commented Mar 7, 2023

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 validation and help texts.
A custom cloud provider icon can be defined using an image resource mounted via asset configuration

This PR also adds a configuration option for the available cloud providers (cloudProviderList). This allows to add additional cloud providers as well as 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.

Current Limitations:
No additional input fields on create cluster page, see #1445

Example dashboard configuration for a cloud provider with name custom

cloudProviderList:
  - gcp
  - aws
  - custom
customCloudProviders:
  custom:
    icon: https://upload.wikimedia.org/wikipedia/commons/7/71/Cloud_Logo.png
    zoned: false
    shoot:
      specTemplate:
        provider:
          type: custom
          infrastructureConfig:
            apiVersion: custom.provider.extensions.gardener.cloud/v1alpha1
            kind: InfrastructureConfig
            networks:
              vpc:
                cidr: ${workerCIDR}
          controlPlaneConfig:
            apiVersion: custom.provider.extensions.gardener.cloud/v1alpha1
            kind: ControlPlaneConfig
        networking:
          nodes: ${workerCIDR}
          foo: bar
    secret:
      fields:
      - key: namespace
        hint: Enter a valid namespace
        label: Namespace
        validators:
          required: .+
          isNamespace: .+--.+
        validationErrors:
          required: Namespace is required
          isNamespace: Must be a valid namespace with format a--b
      - key: token 
        hint: Enter a valid token
        label: token
        password: true
        validators:
          required: .+
          isToken: ^.{10}$
        validationErrors:
          required: token is required
          isToken: Must be a valid token with length 10
      help: |
        #Custom Cloud Provider
        <br />
        <img src="https://upload.wikimedia.org/wikipedia/commons/7/71/Cloud_Logo.png" width="100px" />
        <br />
        ## Namespace
        Please enter a valid namespace with format a--b
        <br />
        ## Token
        Please enter a valid token with exactly 10 chars

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.

Cloud provider custom rendered in the Dashboard
Screenshot 2023-03-06 at 16 51 34
Screenshot 2023-03-06 at 16 53 47
Screenshot 2023-03-06 at 16 54 20

Which issue(s) this PR fixes:
Fixes

Special notes for your reviewer:

Release note:

Define order, name and icon of cloud providers in dashboard configuration
Define additional cloud providers in dashboard configuration

@gardener-robot gardener-robot added needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) labels Mar 7, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 7, 2023
return undefined

try {
return require(`@/assets/${this.value}.svg`)
Copy link
Member

@holgerkoser holgerkoser Mar 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this. I think it will not work as expected because there is a webpack build step involved which creates hash values for the assets and returns a pathname with the hash value. In this case webpack cannot know the path and the require will not work at runtime??

Copy link
Contributor Author

@grolu grolu Mar 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are probably right. I did not think about the webpack build step. I need to adjust this anyway to support images mounted via configuration. I will revert the other changes
Edit: I checked this with a production build and it seems to work... although I'm actually not sure why. Maybe we should not do it anyway as I do not have a good feeling about this.

@gardener-robot gardener-robot added the needs/rebase Needs git rebase label Mar 10, 2023
@gardener-robot
Copy link

@grolu You need rebase this pull request with latest master branch. Please check.

Base automatically changed from enh/generic_cloudprovider to master March 15, 2023 12:00
@gardener-robot-ci-2 gardener-robot-ci-2 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Mar 15, 2023
# Conflicts:
#	backend/lib/services/cloudProviderSecrets.js
#	backend/lib/services/cloudprofiles.js
#	docs/development/local-setup.md
#	frontend/src/components/dialogs/SecretDialogGeneric.vue
#	frontend/src/store/index.js
#	frontend/src/views/NewShoot.vue
#	frontend/src/views/Secrets.vue
@gardener-robot gardener-robot added size/l Size of pull request is large (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else and removed size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) labels Mar 15, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 15, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 15, 2023
Added possibility to configure required dependencies between multiple fields
Added possibility to configure yaml and json textarea inputs
Removed hard-coded fallback yaml input field. Now this is also generated
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Mar 17, 2023
# Conflicts:
#	frontend/src/components/VendorIcon.vue
#	frontend/src/store/index.js
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 17, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 17, 2023
Implemented all required chart template changes and tests
@gardener-robot gardener-robot added size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) and removed size/l Size of pull request is large (see gardener-robot robot/bots/size.py) labels Mar 21, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 21, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 21, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Mar 22, 2023
# Conflicts:
#	charts/__tests__/gardener-dashboard/runtime/dashboard/__snapshots__/configmap.spec.js.snap
#	charts/__tests__/gardener-dashboard/runtime/dashboard/configmap.spec.js
#	charts/gardener-dashboard/charts/runtime/templates/dashboard/configmap.yaml
#	charts/gardener-dashboard/values.yaml
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Mar 22, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Mar 22, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Mar 23, 2023
@grolu grolu added the area/ipcei IPCEI (Important Project of Common European Interest) label Mar 29, 2023
# Conflicts:
#	frontend/src/components/ShootWorkers/WorkerConfiguration.vue
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 30, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 30, 2023
@grolu
Copy link
Contributor Author

grolu commented Sep 11, 2023

Closed in favor of #1553 (adopted to vue3 branch)

@grolu grolu closed this Sep 11, 2023
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Sep 11, 2023
@grolu grolu deleted the enh/configure_cloudprovider branch January 11, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ipcei IPCEI (Important Project of Common European Interest) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/rebase Needs git rebase needs/review Needs review needs/second-opinion Needs second review by someone else size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants