import { useEnvironmentId } from '@/react/hooks/useEnvironmentId'; import { useEnvironmentDeploymentOptions } from '@/react/portainer/environments/queries/useEnvironment'; import { useAuthorizations } from '@/react/hooks/useUser'; import { WebEditorForm } from '@@/WebEditorForm'; import { TextTip } from '@@/Tip/TextTip'; type StackFileContent = string; type Props = { values: StackFileContent; onChange: (values: StackFileContent) => void; isComposeFormat?: boolean; }; export function EditYamlFormSection({ values, onChange, isComposeFormat, }: Props) { // check if the user is allowed to edit the yaml const environmentId = useEnvironmentId(); const { data: deploymentOptions } = useEnvironmentDeploymentOptions(environmentId); const { authorized: roleHasAuth } = useAuthorizations('K8sYAMLW'); const isAllowedToEdit = roleHasAuth && !deploymentOptions?.hideWebEditor; const formId = 'kubernetes-deploy-editor'; return (
Portainer no longer supports{' '} docker-compose {' '} format manifests for Kubernetes deployments, and we have removed the{' '} Kompose {' '} conversion tool which enables this. The reason for this is because Kompose now poses a security risk, since it has a number of Common Vulnerabilities and Exposures (CVEs).
Unfortunately, while the Kompose project has a maintainer and is part of the CNCF, it is not being actively maintained. Releases are very infrequent and new pull requests to the project (including ones we've submitted) are taking months to be merged, with new CVEs arising in the meantime.
We advise installing your own instance of Kompose in a sandbox environment, performing conversions of your Docker Compose files to Kubernetes manifests and using those manifests to set up applications.
This feature allows you to deploy any kind of Kubernetes resource in this environment (Deployment, Secret, ConfigMap...).
You can get more information about Kubernetes file format in the{' '} official documentation .