diff --git a/assemblies/cli-guide/assembly_generating-assets.adoc b/assemblies/cli-guide/assembly_generating-assets.adoc index bf9db15d..a0b01b03 100644 --- a/assemblies/cli-guide/assembly_generating-assets.adoc +++ b/assemblies/cli-guide/assembly_generating-assets.adoc @@ -17,7 +17,15 @@ endif::[] Starting from {ProductShortName} version 7.3.0, you can use the `discover` and `generate` commands in containerless mode to automatically generate the manifests needed to deploy a Cloud Foundry (CF) application in the {ocp-short}: -* Use the `discover` command to generate the discovery manifest in the YAML format from the CF application manifest. The discovery manifest preserves the specifications found in the CF manifest that define the metadata, runtime, and platform configurations. +* Use the `discover` command to generate the discovery manifest in the YAML format directly from a CF instance or from either of the following manifest files: + +** A single application manifest +** A CF manifest +** A path to the directory with multiple manifest files, for example, with application manifests, CF manifests, or both of these manifest types. + ++ +The discovery manifest preserves the specifications found in the CF manifest. The specifications define the metadata, runtime, and platform configurations. + * Use the `generate` command to generate the deployment manifest for {ocp} deployments by using the discovery manifest. The deployment manifest is generated by using a templating engine, such as Helm, that converts the discovery manifest into a Kubernetes-native format. You can also use this command to generate non-Kubernetes manifests, such as a Dockerfile or a configuration file. :FeatureName: Generating platform assets for application deployment @@ -35,6 +43,10 @@ Generating deployment assets has the following benefits: include::topics/mta-cli/proc_generating-discovery-manifest.adoc[leveloffset=+1] +include::topics/mta-cli/proc_performing-a-live-discovery.adoc[leveloffset=+1] + +include::topics/mta-cli/proc_concealing-sensitive-information.adoc[leveloffset=+1] + include::topics/mta-cli/proc_generating-deployment-manifest.adoc[leveloffset=+1] include::topics/mta-cli/ref_discover-generate-command-options.adoc[leveloffset=+1] diff --git a/docs/topics/mta-cli/proc_concealing-sensitive-information.adoc b/docs/topics/mta-cli/proc_concealing-sensitive-information.adoc new file mode 100644 index 00000000..f1b17625 --- /dev/null +++ b/docs/topics/mta-cli/proc_concealing-sensitive-information.adoc @@ -0,0 +1,80 @@ +:_newdoc-version: 2.18.5 +:_template-generated: 2025-07-22 +:_mod-docs-content-type: PROCEDURE + +[id="concealing-sensitive-information_{context}"] += Concealing sensitive information in a discovery manifest + +You can conceal sensitive information, for example, services and docker credentials, in a Cloud Foundry (CF) discovery manifest by using the `mta-cli discover cloud-foundry --conceal-sensitive-data` command. This command generates the following files: + +* A discovery manifest +* A file with concealed data + +NOTE: If you do not specify the `--conceal-sensitive-data` option, the option is automatically set to `false`. + + + +.Procedure +. Display the contents of the CF manifest and locate sensitive data: ++ +[subs="+quotes"] +.... +$ *cat __.yaml* +name: __ +disk_quota: 512M +memory: 500M +timeout: 10 +docker: + image:myregistry/myapp:latest + username: *docker-registry-user* +.... + +. Generate the discovery manifest for the CF application as an output file and conceal sensitive data: ++ +[subs="+quotes"] +.... +$ *mta-cli discover cloud-foundry --conceal-sensitive-data=true --input __ --output-dir __* +.... + + + +.Verification +. Display the repository structure: ++ +[subs="+quotes,macros"] +.... +$ *tree __* +__ +├── discover_manifestpass:[_]__.yaml +├── secretspass:[_]__.yaml + +1 directory, 2 files +.... + +. Display the contents of the discovery manifest: ++ +[subs="+quotes"] +.... +$ *cat __.yaml* +name: __ +timeout: 10 +docker: + image:myregistry/myapp:latest + username: *$(f0e9ea9e-1913-446f-8483-da9301373eef)* +disk: 512M +memory: 500M +instances: 1 +.... ++ +The sensitive data was replaced with a UUID (Universally Unique Identifier). + + +. Display the contents of the `secretspass:[_]__.yaml` file: ++ +[subs="+quotes,macros"] +.... +$ *cat secretspass:[_]__.yaml* +f0e9ea9e-1913-446f-8483-da9301373eef: docker-registry-user +.... ++ +The file contains the mapping of the UUID to the concealed sensitive data. \ No newline at end of file diff --git a/docs/topics/mta-cli/proc_generating-discovery-manifest.adoc b/docs/topics/mta-cli/proc_generating-discovery-manifest.adoc index 8294f959..8202aba9 100644 --- a/docs/topics/mta-cli/proc_generating-discovery-manifest.adoc +++ b/docs/topics/mta-cli/proc_generating-discovery-manifest.adoc @@ -11,9 +11,7 @@ You can generate the discovery manifest for the Cloud Foundry (CF) application b .Prerequisites * You have Cloud Foundry (v3) as a source platform. -* You have {ocp-short} as a target platform. -* You installed {ProductShortName} {CLIName} version 7.3.0. -* You have a CF application manifest as a YAML file. +* You installed {ProductShortName} {CLIName} version 7.3.0 or later. .Procedure @@ -26,13 +24,11 @@ You can generate the discovery manifest for the Cloud Foundry (CF) application b $ *mta-cli discover --list-platforms* ---- -. Generate the discovery manifest for a CF application as an output file: +. Generate the discovery manifest: + [subs="+quotes"] ---- -$ *mta-cli discover cloud-foundry \ ---input __ \ ---output __\* +$ *mta-cli discover cloud-foundry --input __ --output-dir __* ---- [role="_additional-resources"] diff --git a/docs/topics/mta-cli/proc_performing-a-live-discovery.adoc b/docs/topics/mta-cli/proc_performing-a-live-discovery.adoc new file mode 100644 index 00000000..90fa8b0b --- /dev/null +++ b/docs/topics/mta-cli/proc_performing-a-live-discovery.adoc @@ -0,0 +1,48 @@ +:_newdoc-version: 2.18.5 +:_template-generated: 2025-07-22 +:_mod-docs-content-type: PROCEDURE + +[id="performing-a-live-discovery_{context}"] += Performing a live discovery in a remote CF instance + +You can use a live discovery if you want to determine what is deployed in a certain Cloud Foundry (CF) cluster. For example, you can determine how many applications are in the cluster. You can also use the live discovery if you do not have access to manifest YAML files. + +You can run the live discovery for a remote CF instance by using the `mta-cli discover cloud-foundry --use-live-connection --spaces=__` command. + +IMPORTANT: You must always define Cloud Foundry spaces to analyze during a live discovery by using the `--spaces` option. + + +.Prerequisites +* You have permission to remotely connect to the CF instance. + +.Procedure +. Optional: Investigate the contents of the remote CF instance ++ +[subs="+quotes"] +.... +$ *cf spaces* +$ *cf apps* +.... + +. Copy the CF configuration file to the directory of your choice: ++ +[subs="+quotes"] +.... +$ *mkdir __/.cf* +.... + +. Run the live discovery in a remote CF instance: ++ +[subs="+quotes"] +.... +$ *mta-cli discover cloud-foundry --use-live-connection --spaces=__ --output-dir __ --cf-config=__* +.... ++ +The command runs the discovery for each application from each space. ++ +If you want to run the discovery for a specific application, enter, for example: ++ +[subs="+quotes"] +.... +$ *mta-cli discover cloud-foundry --use-live-connection --app-name=__ --spaces=__ --output-dir __ --cf-config=__* +.... \ No newline at end of file diff --git a/docs/topics/mta-cli/ref_discover-generate-command-options.adoc b/docs/topics/mta-cli/ref_discover-generate-command-options.adoc index 3113deeb..a4966580 100644 --- a/docs/topics/mta-cli/ref_discover-generate-command-options.adoc +++ b/docs/topics/mta-cli/ref_discover-generate-command-options.adoc @@ -13,25 +13,64 @@ You can use the following options together with the `discover` or `generate` com |=== | Command | Option | Description -.2+a|`discover` +.5+a|`discover` +a|`--app-name` +a|An application to run the discovery for. + a|`-h`, `--help` a|Display details for different command arguments. +a|`--list-apps` +a|List the available applications on the source platform, for example: + +[subs="+quotes"] +---- +$ *mta-cli discover cloud-foundry --use-live-connection --spaces=space,space-2 --cf-config=/home/gloria/ --list-apps* +INFO[0000] Cloud Foundry client created successfully +INFO[0000] Analyzing space space_name=space +INFO[0006] Apps discovered count=2 +INFO[0006] Analyzing space space_name=space-2 +INFO[0007] Apps discovered count=1 +Space: space +- nginx +- test-app +Space: space-2 +- test-app +---- a|`--list-platforms` a|List the supported platforms for the discovery process. +a|`--log-level` +a|Set the log level, for example, `discover --log-level 1`. The default log level is `4`. -.3+a|`discover cloud-foundry` +.6+a|`discover cloud-foundry` a| a|Discover Cloud Foundry applications. +a|`--conceal-sensitive-data` +a|Extract sensitive information from a discovery manifest and put it into a separate file. + a|`--input` -a|Specify the location of the __.yaml file to discover the application configurations. +a|Specify the location of the YAML manifest file to discover the CF applications, for example: + +* A path to the single application manifest. +* A path to the Cloud Foundry manifest. +* A path to the directory with multiple manifest files. a|`--output` a|Specify the location to save the __.yaml file. +a|`--spaces` +a|A comma-separated list of Cloud Foundry spaces to analyze during a live discovery, for example: + +---- +--spaces=space1,space2,… +---- + +a|`--use-live-connection` +a|Enable real-time discovery by using live platform connections. + a|`generate` a|`-h`, `--help` a|Display details for different command arguments.