Codefresh provides all the options and functionality to create and manage Argo CD applications in the Codefresh UI.
- Create Argo CD applications that are fully GitOps compliant, from generating the application configuration manifest, committing it to Git, and syncing and deploying to the cluster.
Creating an application in Codefresh includes:
- Application definitions
- General configuration settings
- Advanced configuration settings
- Edit and delete applications
Once the application is created and synced to the cluster, it is displayed in the Applications dashboard. Here, you can select an application to update the application’s configuration settings, or delete it.
To monitor the health and sync status, deployments, and resources for the application, see Applications dashboard.
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: General configuration settings
General configuration settings define the source, destination, and sync policies for the application.
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.
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.
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.
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.
Replace: When selected, Argo CD executes
kubectl create, instead of the default
kubectl applyto 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.
Application: Advanced configuration settings
Advanced settings define the tool used to create the application, and related toll-specific 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
directoryapplication, 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.yamlfiles to store the parameters.
- Values: Optional. When defined, new values not in
values.yamlfiles are added, and existing values are overridden.
- Values files: One or more
- 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.
Create an 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
- In the Codefresh UI, go to Applications.
- On the top-right, select Add Application.
- 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.
- 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.
- Define the General settings for the application.
- Define the Advanced settings for the application.
- 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.
- Enter the path to the Git Source to which to commit the application configuration manifest.
- 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.
Update application configuration
Update General or Advanced configuration settings for a deployed application. Once the application is deployed to the cluster, the Configuration tab is available on selecting the application in the Applications dashboard.
You cannot change application definitions (the application name and the selected runtime), and the Git Source selected for the application.
- In the Codefresh UI, go to the Applications dashboard.
- Select the application to update, and then select the Configuration tab.
- Update the General or Advanced configuration settings as needed:
When you change a setting, the Commit and Discard Changes buttons are displayed.
- Do one of the following:
- To commit all changes, click Commit. This final commit screen is displayed with a diff view of the changes.
- To undo all changes and return to the previous settings, click Discard Changes. This action removes all the changes you have made so far and returns you to the Applications dashboard.
If you change settings and then restore existing values for the same, Codefresh automatically removes the Commit and Discard Changes buttons as there are no new changes to commit or discard.
- To confirm all changes, at the bottom-left, click Commit. The changes are committed to Git, and in a few moments also synced to the cluster.
Delete an application
Delete an application from Codefresh. Deleting an application deletes the manifest from the Git repository, and then from the cluster where it is deployed. When deleted from the cluster, the application is removed from the Applications dashboard in Codefresh.
The Prune resources setting determines the scope of the delete action. When selected, both the application and its resources are deleted. When not selected, only the application is deleted. For more information, review Sync settings in this article.
Codefresh warns you of the implication of deleting the selected application in the Delete form.
- In the Codefresh UI, go to the Applications dashboard.
- Select the application to delete.
- Click the three dots for additional actions, and select Delete.
Pay attention to the impact of the delete action for the selected application that Codefresh displays.
- To confirm, click Commit & Delete.