Create an application

Create applications that are fully GitOps compliant in the Codefresh UI, from generating the application configuration manifest, committing it to Git, and then syncing and deploying to the cluster.

Creating an application in Codefresh includes defining:

  • Application definitions
  • General configuration settings
  • Advanced configuration settings

The create application wizard guides you through the process of creating an application. For how-to information, see How to: Create an application. For example Argo CD applications, see this repo.

After creating an application and it is synced to the cluster, it is displayed in the Applications dashboard where you can track its health and deployments.

Application definitions

Application definitions include the name, runtime, and the name of the YAML manifest. By default, the YAML manifest has the same name as that of the application.

Application definitions

Application definitions

General configuration settings

General configuration settings define the source, destination, and sync policies for the application.

General configuration settings

General configuration settings

Source

The Git repository to be tracked for changes to the application’s source code.

  • ArgoCD Project: The project group to which the application belongs. A project is useful to enforce restrictions on permitted sources and targets for applications, and roles. If not defined, the application is automatically assigned to the default project, which is created automatically by Argo CD and has no restrictions.
    For more information, see Argo CD's documentation on Projects.
  • Repository URL: The Git repo or the Helm package repo with the application source code, to be tracked for changes. If the Argo CD project is not the default project, make sure that the repo has the correct access roles for your application.
    • Revision and Path: Applies to Git repositories.
    • Chart: Applies to Helm repositories. The name of the Helm package with all the resource definitions for the application, and the version.
    For more information, see Tracking and Deployment Strategies.

Destination

The cluster and namespace to which to deploy the application.

  • Cluster: The cluster to which to deploy the application, defined as a URL, or as the user-defined display NAME.
  • Namespace: The namespace in the cluster to which to deploy the application.

Sync Settings

Sync Policy: The synchronization policy to apply when there are differences between the desired state in Git and the actual state in the cluster.

  • Manual: Manually sync the changes from the Argo CD UI.
  • Automatic: Automatically sync changes, with the following options if selected:
    • Prune resources:When selected, removes legacy resources that do not exist currently in Git.
    • Self heal: When selected, always enforces a sync to the desired state in Git, if and when there is a change to the actual state in the cluster. See Automatic self-healing.

    Sync Options: Common to both manual and automatic sync policies.

    • Skip schema validation: When selected, bypasses validating the YAML schema.
    • Auto-create namespace: When selected, automatically create the namespace if the specified namespace does not exist in the cluster.
    • Prune last: When selected, removes those resources that do not exist in the currently deployed version during the final wave of the sync operation. See Prune last.
    • Apply out of sync only: When selected, syncs only those resources in the application that have been changed and are OutOfSync, instead of syncing every resource regardless of their state. This option is useful to reduce load and save time when you have thousands of resources in an application. See Selective Sync.

    Prune propagation policy:
    Defines how resources are pruned, applying Kubernetes cascading deletion prune policies. For more information, see Kubernetes - Cascading deletion.

    • Foreground: The default prune propagation policy used by Argo CD. With this policy, Kubernetes changes the state of the owner resource to `deletion in progress`, until the controller deletes the dependent resources and finally the owner resource itself.
    • Background: When selected, Kubernetes deletes the owner resource immediately, and then deletes the dependent resources in the background.
    • Orphan: When selected, Kubernetes deletes the dependent resources that remain orphaned after the owner resource is deleted.

    All Prune propagation policies can be used with:

    Replace: When selected, Argo CD executes kubectl replace or kubectl create, instead of the default kubectl apply to enforce the changes in Git. This action will potentially recreate resources and should be used with care. See Replace Resource Instead Of Applying Change.

    Retry: When selected, retries a failed sync operation, based on the retry settings configured:

    • Maximum number of sync retries (Limit)
    • Duration of each retry attempt in seconds, minutes, or hours (Duration)
    • Maximum duration permitted for each retry (Max Duration)
    • Factor by which to multiply the Duration in the event of a failed retry (Factor). A factor of 2 for example, attempts the second retry in 2 X 2 seconds, where 2 seconds is the Duration.

    Advanced configuration settings

    Advanced settings define the tool used to create the application, and related settings.

    Advanced configuration settings

    Advanced configuration settings

    Type of Application

    The tool used to create the application’s manifests. Codefresh supports defining application manifests as a directory, Helm charts, or Kustomize. If you are using other tools to define application manifests, use the Plugin type. For more information, see the Argo CD’s documentation on Tools.

    • Directory: A directory application, which is the default application type in Argo CD.
      • Directory recurse: Optional. Select to include subdirectories.
      • Top-level arguments: Optional. Select and define parameters.
      • External variables: Optional. Select and define external variables.
    • Helm: Create the application as a Helm chart.
      • Values files: One or more values.yaml files to store the parameters.
      • Values: Optional. When defined, new values not in values.yaml files are added, and existing values are overridden.
    • Kustomize: Create a Kustomize application, with the following settings:
      • Version: The version of Kustomize used to create the application.
      • Name Prefix and Name Suffix: Optional. The prefix and suffix to be appended to the resources of the application.
    • Plugin: Use for any other tool.
      • Name: The name of the Plugin used to create the application.
      • External Variables: The variables to use in the application.

    For example applications, go to the Argo CD example applications repo.

    How to: create an Argo CD application

    Create a new application from the Applications dashboard with the Add Application wizard. Edit the manifest directly in YAML mode, or define the settings in the Form mode. Toggle between the modes as convenient. You can also edit the YAML manifest directly at all stages, after defining configuration settings, and before the final commit.

    Before you begin

    Review:
    General configuration
    Advanced configuration

    How to

    1. In the Codefresh UI, go to Applications.
    2. Select Add Application on the top-right.
    3. In the Add Application panel, add definitions for the application:
      • Application name: Must be unique within the cluster.
      • Runtime: The runtime to associate with the application.
      • YAML filename: The name of the application’s configuration manifest, assigned on commit to Git. By default, the manifest is assigned the application name. Change the name as required.

    The application definitions cannot be changed after you continue to the Configuration settings.

    Add Application panel

    Add Application panel
    1. Select Next to go to the Configuration tab.
      By default you are in Form mode. You can toggle between the Form and YAML modes as you define the application’s configuration settings. You can edit the YAML manifest.
    2. Define the General settings for the application.

    Add Application: General settings

    Add Application: General settings
    1. Define the Advanced settings for the application.

    Add Application: Advanced settings

    Add Application: Advanced settings
    1. To commit all your changes, select Commit.
      The Commit form is displayed with the application’s definition on the left, and the read-only version of the manifest with the configuration settings you defined on the right.
    2. Enter the path to the Git Source to which to commit the application configuration manifest.

    Add Application: Commit to Git

    Add Application: Commit to Git
    1. Add a commit message and then select Commit on the bottom-right of the panel.

    Your application is first committed to Git, and then synced to the cluster which may take a few moments.
    Track the application in the Applications dashboard.

    Applications dashboard