Managing applications
Application creation and deployment is one part of the continuous deployment/delivery process. An equally important part is optimizing deployed applications when needed.
-
Edit applications
Optimize deployed applications by changing application definitions when needed. -
Synchronize applications
Sync applications on-demand by manually applying sync options or selecting the resources to sync. -
Delete applications
Delete unused or legacy applications to avoid clutter and remove unnecessary resources. -
Manage rollouts for deployments
Control ongoing rollouts by resuming indefinitely paused steps, promoting rollouts, aborting, restarting and retrying rollouts.
Edit application definitions
Update General or Advanced configuration settings for a deployed application through the Configuration tab. 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.
How to
- In the Codefresh UI, go to the Applications dashboard.
- Do one of the following:
- Select the application to update, and then from the context menu on the right, select Edit.
- Click the application and then select the Configuration tab.
- Update the General or Advanced configuration settings as needed:
General configuration
Advanced configuration
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.
Manually synchronize an application
Manually synchronize an application to expedite Git-to-cluster sync. The sync options selected for manual sync override the sync options defined for the application.
The sync options, grouped into Revision and Additional Settings, are identical to the Sync options in the General settings when you created the application.
You can also synchronize application resources with sync statuses, such as
Service
,AnalysisTemplate
, andRollouts
resources for example, in the Current State tab. The context menu of the resource shows the Sync option.
Before you begin
- Review:
Revision settings for application sync
Additional Options for application sync
Synchronize resources
How to
- In the Codefresh UI, go to the Applications dashboard.
- Sync an application:
- Select the application to sync, and do one of the following:
- From the context menu on the right, select Synchronize.
- On the top-right, click Synchronize.
Sync a resource:
- Click the application with the resource to sync.
- In the Current State tab, open the context menu of the resource, and then select Sync.
- Select the Revision and Additional Options for the manual sync.
Review - Click Next.
- In the Synchronize Resources form, select the scope of the manual sync:
- To sync only specific resources, search for the resources by any part of their names, or define a Regex to filter by the required resources.
- All: Sync all resources regardless of their sync state.
- Out of sync: Sync only resources that are
Out of sync
.
Revision settings for application sync
Revision settings determine the behavior for the branch you select.
Revision The branch in Git to synchronize with the cluster.
Prune When selected, removes legacy resources from the cluster that do not exist currently in the Git branch.
Apply 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.
Dry run When selected, allows you to preview the application before changes are made to the cluster.
Force
When selected, orphans the dependents of a deleted resource during the sync operation. This option is useful to prevent
Additional Options for application sync
Sync Options
- Skip schema validation
When selected, bypasses validating the YAML schema. - Auto-create namespace
When selected, automatically creates the namespace if the specified namespace does not exist in the cluster. If the namespace already exists, this setting is ignored. - 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. - Respect ignore differences
When selected, Argo CD omits resources defined for thespec.ignoreDifferences
attribute from the sync. Otherwise, Argo CD implements the desired state ad-hoc during the sync operation. See Respect ignore difference configs.
Prune propagation policy
Defines how resources are pruned, applying Kubernetes cascading deletion prune policies. Read more at 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 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.
Synchronize resources
Synchronize Resource options allow you to selectively sync application resources. You can bypass sync settings at the application level, and directly select the resources you want to sync, by state or otherwise.
- All resources regardless of their sync states
- Only out-of-sync resources
- Only selected resources
By default, Synchronize Resources displays and selects all resources in the application.
You can search/filter resources using part of the resource names or regex strings, and then select the resources you want to sync.
For example, if you made changes to api
resources or audit
resources, type api
or audit
to locate the resources and then selectively sync those resources.
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.
Prune resources in the application’s General settings determines the scope of the delete action.
When selected, both the application and its resources are deleted. When cleared, only the application is deleted. For more information, review Sync settings.
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.
Manage rollouts for deployments
Control ongoing rollouts by resuming indefinitely paused steps, promoting rollouts, aborting, restarting and retrying rollouts.
Pause/resume ongoing rollouts
Pause and resume ongoing rollouts directly from the Timeline tab in the Applications dashboard.
If the rollout is already automatically paused as result of a step definition, this action pauses the rollout even after the pause duration.
- In the Codefresh UI, go to the Applications dashboard.
- Select the application and go to the Timelines tab.
- In the deployment record for the ongoing rollout, expand Updated Services.
- Based on the current state of the rollout, click Pause or Resume, as relevant.
Manage an ongoing rollout with the Rollout Player
Manage an ongoing rollout using the controls in the Rollout Player to skip steps, and promote rollouts.
- In the Codefresh UI, go to the Applications dashboard.
- Select the application and go to the Timelines tab.
- In the deployment record for the ongoing rollout, click the name of the rollout.
- Select the required option in the Rollout Player.
The table describes the controls in the Rollout Player.
Rollback player option | Description |
---|---|
Rollback | Not available currently. |
Pause | Pause the rollout. If the rollout is already automatically paused as the result of a step definition, clicking Pause pauses the rollout also after the pause duration. |
Resume | Resume a rollout that was paused either manually by clicking Pause, or automatically through the step’s definition. |
Skip step | Skip execution of current step. Such steps are marked as Skipped in the rollout visualization. |
Promote full | Skip all remaining steps, and deploy the current image. |
Manage the rollout
resource
Control the rollout through the options available for the Rollout resource.
- In the Codefresh UI, go to the Applications dashboard.
- Select the application and go to the Current State tab.
- Open the context menu of the
Rollout
resource, and select the relevant option.
The table describes the options for the Rollout
resource.
Option | Description |
---|---|
Abort | Terminate the current rollout. |
Pause | Pause the current rollout. |
Promote-full | Promote the current rollout by skipping all remaining stages in the rollout, and deploy the current image. |
Restart | Manually restart the pods of the rollout. |
Resume | Resume a rollout that has been paused. |
Retry | Retry a rollout that has been aborted. Available only when a rollout has been aborted. |
Skip-current-step | Skip executing the current step, and continue with the next step. |