Application Management

Deploy an Application

You can create applications using both the dashboard and the CLI. The section below describes how to do it using both options.

Dashboard

You can create applications using our web dashboard by clicking on the Applications link on its side menu, which will take you to the application management screen.

Clicking on the Create button will prompt you with the screen and options below:

Name: the name of the application.
Cluster & Namespace: the deployment target (cluster + namespace) where the app will live)
Team: the team that should own the application
Tags: optional tags/labels to give to your app
Deployment source: whether the container image to deploy lives in a private or public registry
Container Image URL: the URL where your container image is hosted. Generally a registry (Docker, jFrog, etc)

Once you click on Deploy, it will show the application with an idle status and to Running when the deployment is completed.

CLI

The command below creates a new application deployment using the application name:

lapps app deploy <appname> [--plan/-p plan name][--team/-t team owner] [--environment environment  name] [--description/-d description] [--tag/-g tag] -i IMAGE_URL --volume VOLUME_NAME --volume-mount-path VOLUME_MOUNT_PATH

To create an application, Administrators must be a member of at least one team. All teams that a user is a member of (see team-list) can access the app.

Command options:

  • _--team _describes which team is responsible for the created app. This is only needed if the current user belongs to more than one team, in which case this parameter is mandatory.

  • --environment defines to which environment the application is deployed. Such an environment informs Lens AppIQ to target the deployment to a specific namespace within a cluster while using a specific framework (set of policies). Existing environments can be listed by running the command environment list.

  • --description sets a description for the application. It is an optional parameter. If it is not set, the application will not have a description associated with it.

  • --tag applies a tag to an application. Multiple --tag parameters can be applied.

  • -i/--image docker image URL

  • --port Application exposed port

  • --private-image App image is stored in a private registry and requires authentication

  • --shipa-yaml The path to shipa.yaml

  • --step-interval Time interval between each step. Supported min: m, hour:h, second:s. ex. 1m, 60s, 1h (default "0")

  • --step-weight Canary traffic weight percentage for step. Should be between 0 and 100 (default 1)

  • --steps Number of steps to roll out the new deployment (default 1)

  • --volume Name of the volume to bind to the application.

  • --volume-mount-options Options for volume mount. (default [])

  • --volume-mount-path Path to mount a volume

  • --run-as-user The user to use for running pod's processes; root if not set.

  • -e, --env An environment variable to inject to your application

Flags:

FlagDescription
-d, --description(= "") application description
-g, --tag(= []) application tag
--environment(= "") the environment to deploy the application
-t, --team(= "") team owner app
-i, --imageThe image to deploy in app
--portApplication exposed port
--internal-port stringsApplication internal port
--private-imageApp image is stored in a private registry and requires authentication
--run-as-userThe user to use for running pod's processes; root if not set.
--shipa-yamlPath to shipa-yaml
--step-intervalTime interval between each step. Supported min: m, hour:h, second:s. ex. 1m, 60s, 1h (default "0")
--step-weightCanary traffic weight percentage for step. Should be between 0 and 100 (default 1)
--stepsNumber of steps to roll out the new deployment (default 1)
--volumeName of the volume to bind to the application
--volume-mount-optionsOptions for volume mount. (default [])
--volume-mount-pathPath to mount a volume

Redeploying an application

You can redeploy applications using both the dashboard and the CLI. The section below describes how to do it using both options.

Dashboard

You can redeploy applications using the Lens AppIQ dashboard by clicking on your Lens AppIQ dashboard's Applications link, which will take you to the application management screen.

Clicking on the Deploy button will prompt you with the screen and options below:

From there, edit the options of your preference (namespace, team, tags, environment variables, etc), and once the settings are in the desired state, click the Deploy button. The process will result in a new deployment of your application.

CLI

The app deploy command should be used to update application deployments.

Allowing Access to an Application

Operators can use the app grant command to allow a team to access a specific application. A user needs to be a member of a team with access to the application to allow another team to access it.

lapps app grant <teamname> [-a/--app appname]

Flags:

FlagDescription
-a, --appapplication name

Revoking Access to an Application

Operators can use the app revoke command to revoke a team’s permission to access an application. Access to the application is first required to revoke access from a team.

lapps app revoke <teamname> [-a/--app appname]

Note: An application cannot be orphaned. It must always have at least one authorized team.

Flags:

FlagDescription
-a, --appapplication name

Moving an Application

You can move applications between namespaces if needed. To do so, simply redeploy your application pointing to a different namespace (or cluster) than the original one. Lens AppIQ will identify the change, deploy your app in the specified environment, and automatically remove it from the old one. Follow the section "Redeploying an application" to achieve so from the CLI or the dashboard.

Removing an Application

You can remove applications deployed with our engine using both, the dashboard and the CLI. The section below describes how to do it using both options.

Dashboard

You can remove an application deployed without engine using our dashboard by clicking on the Applications link of your Lens AppIQ dashboard.

To remove an application, use the Delete button.

CLI

lapps app remove [-a/--app appname] [-y/--assume-yes]

Users must be members of a team with access to the application before removing it. Users can remove any application listed when they run the app list command.

Flags:

FlagDescription
-a, --app(= "") application name
-y, --assume-yes(= false) don't ask for confirmation

Listing Applications

You can see available applications using both the dashboard and the CLI. The section below describes how to achieve this using both options.

Dashboard

You can list existing applications using our dashboard by clicking on the Applications link on the side menu.

CLI

To list all applications that a user has access to, use the app list command.

lapps app list

Teams control application access. If a user's team has access to an application, this user can also access it.

Flags can be used to filter the list of applications.

Flags:

FlagDescription
-g, --tag(= []) filter applications by tag. Can be used multiple times
-l, --locked(= false) filter applications by lock status
-n, --name(= "") filter applications by name
-q(= false) display only applications name
-s, --status(= "") filter applications by unit status. Accepts multiple values separated by commas. Possible values can be: building, created, starting, error, started, stopped, asleep
-t, --team(= "") filter applications by team owner
-u, --user(= "") filter applications by owner

Application Information

You can access detailed information about an application using both the dashboard and the CLI. The section below describes how to do it using both options.

Dashboard

You can see the details of an application using the dashboard by clicking on the Applications link on the side menu. Once on the application page, click on the application name.

This will present you with a complete workflow of information on a specific application.

You can also use the Application Map button to understand the Kubernetes objects composing your application

CLI

Use the app info command to display information about a specific application, its state, platform, Git repository, and more. Users need to be team members with access to the application to see information about it.

lapps app info -a app-name

Flags:

FlagDescription
-a, --app(= "") application name

Application Log

Dashboard

You can see the logs of your application by accessing the details of your app, and visiting the tab "Logs". Click on it, and immediately see the current logs captured by Lens AppIQ.

CLI

Use the _app log _command to show log entries for an application. These logs include everything the application sends to stdout and stderr, alongside logs from the Lens AppIQ server (deployments, restarts, etc.)

lapps app log [-a/--app appname] [-l/--lines numberOfLines] [-s/--source source] [-u/--unit unit] [-f/--follow]
  • --lines is optional, and by default, its value is 10.

  • --source is optional and allows filtering logs by log source (for example, application, the Shipa API).

  • --unit is optional and allows filtering by the unit. It's useful if the application has multiple units, and the user wants logs from a single unit.

  • --follow is optional and makes the command wait for additional log output

  • --no-date is optional and creates the log output without a date.

  • --no-source is optional and creates the log output without source information. This is useful when logs are very dense

Flags:

FlagDescription
-a, --app(= "") application name
-f, --follow(= false) follow logs
-l, --lines(= 10) the number of log lines to display
--no-date(= false) no date information
--no-source(= false) no source information
-s, --source(= "") the log from the given source
-u, --unit(= "") the log from the given unit

Stopping Applications

lapps app stop [-a/--app appname] [-p/--process processname]

Stops an application, or one of the processes of the application.

Flags:

FlagDescription
-a, --app(= "") application name
-p, --process(= "") the process name

Starting Applications

lapps app start [-a/--app appname] [-p/--process processname]

Starts an application, or one of the processes of the application.

Flags:

FlagDescription
-a, --app(= "") application name
-p, --process(= "") the process name

Restarting Applications

lapps app restart [-a/--app appname] [-p/--process processname]

Restarts an application, or one of the processes of the application.

Flags:

FlagDescription
-a, --app(= "") application name
-p, --process(= "") the process name

Adding Units to Applications

lapps unit add <# of units> [-a/--app appname] [-p/--process processname]

Adds new units to a process of an application. Users need to have access to the application to be able to add new units to it.

Flags:

FlagDescription
-a, --app(= "") application name
-p, --process(= "") the process name

Removing Units from Applications

lapps unit remove <# of units> [-a/--app appname] [-p/-process processname]

Removes units from a process of an application. Users need to have access to the application to be able to remove units from it.

Flags:

FlagDescription
-a, --app(= "") application name
-p, --process(= "") the process name

Running Commands Inside Applications

lapps app run <command> [commandarg1] [commandarg2] ... [commandargn] [-a/--app appname] [-o/--once] [-i/--isolated]

Runs an arbitrary command in the application's containers. The base directory for all commands is the root of the application.

If users use the --once flag, Lens AppIQ will only run the command in one unit. Otherwise, it will run the command in all units.

Flags:

FlagDescription
-a, --app(= "") application name
-i, --isolated(= false) running in ephemeral container
-o, --once(= false) running only one unit

Listing Deployments

lapps app deploy list [-a/--app <appname>]

List information about deploys for an application.

Flags:

FlagDescription
-a, --app(= "") application name

Rolling Back Deployments

You can roll back application deployments using both the dashboard and the CLI. The section below describes how to do it using both options.

Dashboard

You can roll back a deployment using the dashboard by visiting the Applications link on the side menu. Once on the application page, click on the application name.

Inside the application details page, you have the Lifecycle tab.

Rollbacks: You can see the images used on individual deployments and choose to roll back to a specific one. Note that performing a rollback will create a new event in the Events tab containing information on when the operation happened and who was the user who triggered it.

CLI

lapps app deploy rollback [-a/--app appname] [-y/--assume-yes] <image-name>

Deploys an existing image for an application. Users can list available images with the app deploy list command.

Flags:

FlagDescription
-a, --app(= "") application name
-y, --assume-yes(= false) don't ask for confirmation

Setting Application Certificate

lapps certificate set [-a/--app appname] [-c/--cname CNAME] [certificate] [key]

Creates or updates a TLS certificate into the specific application.

Flags:

FlagDescription
-a, --app(= "") application name
-c, --cname(= "") application CNAME

Unsetting Application Certificate

lapps certificate unset [-a/--app appname] [-c/--cname CNAME]

Unset a TLS certificate from a specific application.

Flags:

FlagDescription
-a, --app(= "") application name
-c, --cname(= "") application CNAME

Listing Application Certificates

lapps certificate list [-a/--app appname] [-r/--raw]

List an application TLS certificates.

Flags:

FlagDescription
-a, --app(= "") application name
-r, --raw(= false) display raw certificates