diff --git a/api/http/handler/kubernetes/configmaps_and_secrets.go b/api/http/handler/kubernetes/configmaps_and_secrets.go index 11f9a5605..fc2580875 100644 --- a/api/http/handler/kubernetes/configmaps_and_secrets.go +++ b/api/http/handler/kubernetes/configmaps_and_secrets.go @@ -9,21 +9,6 @@ import ( "github.com/portainer/libhttp/response" ) -// @id getKubernetesConfigMapsAndSecrets -// @summary Get ConfigMaps and Secrets -// @description Get all ConfigMaps and Secrets for a given namespace -// @description **Access policy**: authenticated -// @tags kubernetes -// @security ApiKeyAuth -// @security jwt -// @accept json -// @produce json -// @param id path int true "Environment (Endpoint) identifier" -// @param namespace path string true "Namespace name" -// @success 200 {array} kubernetes.K8sConfigMapOrSecret "Success" -// @failure 400 "Invalid request" -// @failure 500 "Server error" -// @router /kubernetes/{id}/namespaces/{namespace}/configuration [get] func (handler *Handler) getKubernetesConfigMapsAndSecrets(w http.ResponseWriter, r *http.Request) *httperror.HandlerError { endpointID, err := request.RetrieveNumericRouteVariableValue(r, "id") if err != nil { diff --git a/app/kubernetes/__module.js b/app/kubernetes/__module.js index 9ccdbcc8a..86fc7dc8a 100644 --- a/app/kubernetes/__module.js +++ b/app/kubernetes/__module.js @@ -223,30 +223,64 @@ angular.module('portainer.kubernetes', ['portainer.app', registriesModule, custo const configurations = { name: 'kubernetes.configurations', - url: '/configurations', + url: '/configurations?tab', views: { 'content@': { - component: 'kubernetesConfigurationsView', + component: 'kubernetesConfigMapsAndSecretsView', }, }, + params: { + tab: null, + }, + }; + const configmaps = { + name: 'kubernetes.configmaps', + url: '/configmaps', + abstract: true, }; - const configurationCreation = { - name: 'kubernetes.configurations.new', + const configMapCreation = { + name: 'kubernetes.configmaps.new', url: '/new', views: { 'content@': { - component: 'kubernetesCreateConfigurationView', + component: 'kubernetesCreateConfigMapView', }, }, }; - const configuration = { - name: 'kubernetes.configurations.configuration', + const configMap = { + name: 'kubernetes.configmaps.configmap', url: '/:namespace/:name', views: { 'content@': { - component: 'kubernetesConfigurationView', + component: 'kubernetesConfigMapView', + }, + }, + }; + + const secrets = { + name: 'kubernetes.secrets', + url: '/secrets', + abstract: true, + }; + + const secretCreation = { + name: 'kubernetes.secrets.new', + url: '/new', + views: { + 'content@': { + component: 'kubernetesCreateSecretView', + }, + }, + }; + + const secret = { + name: 'kubernetes.secrets.secret', + url: '/:namespace/:name', + views: { + 'content@': { + component: 'kubernetesSecretView', }, }, }; @@ -293,7 +327,7 @@ angular.module('portainer.kubernetes', ['portainer.app', registriesModule, custo const deploy = { name: 'kubernetes.deploy', - url: '/deploy?templateId&referrer', + url: '/deploy?templateId&referrer&tab', views: { 'content@': { component: 'kubernetesDeployView', @@ -418,8 +452,12 @@ angular.module('portainer.kubernetes', ['portainer.app', registriesModule, custo $stateRegistryProvider.register(stack); $stateRegistryProvider.register(stackLogs); $stateRegistryProvider.register(configurations); - $stateRegistryProvider.register(configurationCreation); - $stateRegistryProvider.register(configuration); + $stateRegistryProvider.register(configmaps); + $stateRegistryProvider.register(configMapCreation); + $stateRegistryProvider.register(secrets); + $stateRegistryProvider.register(secretCreation); + $stateRegistryProvider.register(configMap); + $stateRegistryProvider.register(secret); $stateRegistryProvider.register(cluster); $stateRegistryProvider.register(dashboard); $stateRegistryProvider.register(deploy); diff --git a/app/kubernetes/components/datatables/configurations-datatable/configurationsDatatable.js b/app/kubernetes/components/datatables/configurations-datatable/configurationsDatatable.js deleted file mode 100644 index bf68244e0..000000000 --- a/app/kubernetes/components/datatables/configurations-datatable/configurationsDatatable.js +++ /dev/null @@ -1,13 +0,0 @@ -angular.module('portainer.kubernetes').component('kubernetesConfigurationsDatatable', { - templateUrl: './configurationsDatatable.html', - controller: 'KubernetesConfigurationsDatatableController', - bindings: { - titleText: '@', - titleIcon: '@', - dataset: '<', - tableKey: '@', - orderBy: '@', - refreshCallback: '<', - removeAction: '<', - }, -}); diff --git a/app/kubernetes/models/application/formValues.js b/app/kubernetes/models/application/formValues.js index 3b6a30bac..692bc84ef 100644 --- a/app/kubernetes/models/application/formValues.js +++ b/app/kubernetes/models/application/formValues.js @@ -1,5 +1,5 @@ import { PorImageRegistryModel } from '@/docker/models/porImageRegistry'; -import { KubernetesApplicationDataAccessPolicies, KubernetesApplicationDeploymentTypes, KubernetesApplicationPublishingTypes, KubernetesApplicationPlacementTypes } from './models'; +import { KubernetesApplicationDataAccessPolicies, KubernetesApplicationDeploymentTypes, KubernetesApplicationPlacementTypes } from './models'; /** * KubernetesApplicationFormValues Model @@ -22,8 +22,8 @@ export function KubernetesApplicationFormValues() { this.EnvironmentVariables = []; // KubernetesApplicationEnvironmentVariableFormValue lis; this.DataAccessPolicy = KubernetesApplicationDataAccessPolicies.ISOLATED; this.PersistedFolders = []; // KubernetesApplicationPersistedFolderFormValue lis; - this.Configurations = []; // KubernetesApplicationConfigurationFormValue lis; - this.PublishingType = KubernetesApplicationPublishingTypes.CLUSTER_IP; + this.ConfigMaps = []; + this.Secrets = []; this.PublishedPorts = []; // KubernetesApplicationPublishedPortFormValue lis; this.PlacementType = KubernetesApplicationPlacementTypes.PREFERRED; this.Placements = []; // KubernetesApplicationPlacementFormValue lis; diff --git a/app/kubernetes/react/views/index.ts b/app/kubernetes/react/views/index.ts index 59d9699ae..981d6ef3d 100644 --- a/app/kubernetes/react/views/index.ts +++ b/app/kubernetes/react/views/index.ts @@ -6,9 +6,10 @@ import { withReactQuery } from '@/react-tools/withReactQuery'; import { withUIRouter } from '@/react-tools/withUIRouter'; import { IngressesDatatableView } from '@/react/kubernetes/ingresses/IngressDatatable'; import { CreateIngressView } from '@/react/kubernetes/ingresses/CreateIngressView'; -import { DashboardView } from '@/react/kubernetes/DashboardView'; -import { ServicesView } from '@/react/kubernetes/ServicesView'; +import { DashboardView } from '@/react/kubernetes/dashboard/DashboardView'; +import { ServicesView } from '@/react/kubernetes/services/ServicesView'; import { ConsoleView } from '@/react/kubernetes/applications/ConsoleView'; +import { ConfigmapsAndSecretsView } from '@/react/kubernetes/configs/ListView/ConfigmapsAndSecretsView'; export const viewsModule = angular .module('portainer.kubernetes.react.views', []) @@ -27,6 +28,13 @@ export const viewsModule = angular 'kubernetesIngressesCreateView', r2a(withUIRouter(withReactQuery(withCurrentUser(CreateIngressView))), []) ) + .component( + 'kubernetesConfigMapsAndSecretsView', + r2a( + withUIRouter(withReactQuery(withCurrentUser(ConfigmapsAndSecretsView))), + [] + ) + ) .component( 'kubernetesDashboardView', r2a(withUIRouter(withReactQuery(withCurrentUser(DashboardView))), []) diff --git a/app/kubernetes/views/applications/create/createApplication.html b/app/kubernetes/views/applications/create/createApplication.html index cb77338f0..b643556be 100644 --- a/app/kubernetes/views/applications/create/createApplication.html +++ b/app/kubernetes/views/applications/create/createApplication.html @@ -349,28 +349,28 @@ - +
- +
-
+
- Portainer will automatically expose all the keys of a ConfigMap or Secret as environment variables. This behavior can be overridden to filesystem mounts for - each key via the override option. + Portainer will automatically expose all the keys of a ConfigMap as environment variables. This behavior can be overridden to filesystem mounts for each key + via the override option.
-
+
name @@ -380,7 +380,7 @@