@@ -209,7 +209,7 @@ Kuba provides several commands to help you manage your configuration:
209209- ` completion ` : Generates shell completion scripts for Kuba
210210- ` config ` : Manages global Kuba configuration options such as:
211211 - ` cache ` : Enable or disable local caching of secrets
212- - ` convert ` : Converts existing ** dotenv** (` .env* ` ) files to ` kuba.yaml ` format
212+ - ` convert ` : Converts existing configuration sources (e.g. ** dotenv** (` .env* ` ), ** Knative Service ** manifests) to ` kuba.yaml ` format
213213- ` help ` : Displays help information for Kuba and its commands
214214- ` init ` : Initializes a new ` kuba.yaml ` configuration file in the current directory
215215- ` run ` : Runs an application with environment variables fetched from secrets
@@ -567,6 +567,30 @@ kuba convert --infile .env
567567kuba convert --infile .env.staging --outfile my-kuba.yaml --env staging
568568` ` `
569569
570+ # ## Converting Knative Service (`ksvc`) manifests
571+
572+ If you already have a Knative Service (for example a Cloud Run service) with all
573+ your environment variables defined, you can generate a `kuba.yaml` from that
574+ manifest :
575+
576+ ` ` ` sh
577+ # Convert a Knative Service manifest to kuba.yaml for the production environment
578+ kuba convert --from ksvc --infile service.yaml --env production
579+ ` ` `
580+
581+ Kuba will :
582+
583+ - Read the container `env` section of the Service template.
584+ - Convert hard-coded `value` entries into `value` mappings in `kuba.yaml`.
585+ - Convert `valueFrom.secretKeyRef` entries into `secret-key` mappings, using the
586+ Kubernetes Secret name as the secret identifier.
587+
588+ For Knative Services running on GCP (Cloud Run), the generated environment will
589+ default to :
590+
591+ - `provider : gcp`
592+ - `project` : the Service `metadata.namespace` (typically the GCP project number)
593+
570594# ## Show effective environment variables
571595
572596You can use the `show` subcommand to display the
0 commit comments