Quarkus ArgoCD

Version

Generate Argo CD Application or Project as part of the Quarkus build or using the Quarkus CLI.

Features

  • Generate the Argo CD Application or AppProject Kubernetes custom resources for the Quarkus application

  • Command Line interface to install / uninstall and list Argo CD Application(s)

  • Integration with Quarkus Helm

  • DevServices able to install Argo CD on kubernetes cluster: kind or k3s

Requirements

  • Project added under a version control system and pushed on a repository (e.g. GitHub, etc.)

  • A Kubernetes cluster with Argo CD installed and supporting argoproj.io/v1alpha1.

Building

To build the extension use the following command:

mvn clean install

Usage

To get the Argo CD custom resources generated, it is needed to add the quarkus-argocd extension to a Quarkus project.

Add the extension to your project

To add the extension to the project, manually edit the pom.xml or build.gradle file.

Manually editing the pom.xml file

<dependency>
    <groupId>io.quarkiverse.argocd</groupId>
    <artifactId>quarkus-argocd</artifactId>
    <version>999-SNAPSHOT</version>
</dependency>

Manually editing the build.gradle file

dependencies {
    implementation 'io.quarkiverse.argocd:quarkus-argocd:999-SNAPSHOT'
}

After this step the Argo CD yaml files will be generated under the .argocd directory within the project root as part of the build.

Using the CLI

The project provides a companion CLI that can be used to generate, install / uninstall and list the Argo CD Applications. The CLI can be added with the following command:

quarkus plug add io.quarkiverse.argocd:quarkus-argocd-cli:999-SNAPSHOT

Regenerating the files:

To re-trigger the file generation:

quarkus argocd project generate

Note: Several parameters can be used to configure the generated CR. Use quarkus argocd generate -h to display the usage.

To install the generated Application and AppProject (optional) custom resources to the currently connected Kubernetes cluster:

quarkus argocd project install

Note: In case of un-committed or un-pushed changes the command will prompt users to decide if they want to proceed with the installation.

The currently connected Kubernetes cluster is the one that is configured in the ~/.kube/config file. It can be overridden by setting in applcation.properties a different API server URL and token. See the quarkus-kubernetes-client extension for more details.

To uninstall:

quarkus argocd project uninstall

Listing installed applications

To list all Applications installed

quarkus argocd project list

Installation

If you want to use this extension, you need to add the io.quarkiverse.argocd:quarkus-argocd extension first to your build file.

For instance, with Maven, add the following dependency to your POM file:

<dependency>
    <groupId>io.quarkiverse.argocd</groupId>
    <artifactId>quarkus-argocd</artifactId>
    <version>0.2.0</version>
</dependency>

Extension Configuration Reference

Remove this section if you don’t have Quarkus configuration properties in your extension.

Configuration property fixed at build time - All other configuration properties are overridable at runtime

Configuration property

Type

Default

Enable the ArgoCD DevService.

Environment variable: QUARKUS_ARGOCD_DEVSERVICES_ENABLED

boolean

true

Enable the debugging level.

Environment variable: QUARKUS_ARGOCD_DEVSERVICES_DEBUG_ENABLED

boolean

false

If logs should be shown from the Argocd container.

Environment variable: QUARKUS_ARGOCD_DEVSERVICES_SHOW_LOGS

boolean

false

The version of Argocd to be installed from the GitHub repository It can be: "latest" or a tagged release expressed as such: "v2.13.2"

Environment variable: QUARKUS_ARGOCD_DEVSERVICES_VERSION

string

v2.13.2

The Argocd control plane namespace where AppProject or Application CR are deployed The default namespace is: argocd

Environment variable: QUARKUS_ARGOCD_DEVSERVICES_CONTROL_PLANE_NAMESPACE

string

argocd

Time to wait till a resource is ready: pod, etc The default value is: 180 seconds

Environment variable: QUARKUS_ARGOCD_DEVSERVICES_TIME_OUT

long

180

The cluster type to be used: kind or k3 The default value is: kind

Environment variable: QUARKUS_ARGOCD_DEVSERVICES_CLUSTER_TYPE

string

kind

The hostname of the argocd ingress route

Environment variable: QUARKUS_ARGOCD_DEVSERVICES_HOST_NAME

string

argocd.localtest.me

The host port to be used on the host machine

Environment variable: QUARKUS_ARGOCD_DEVSERVICES_HOST_PORT

string

8443

The version of the Ingress controller to be installed from the GitHub repository If not specified, it will use the resources published on main branch The version to be used should be specified using the tagged release: v1.12.0, etc

Environment variable: QUARKUS_ARGOCD_DEVSERVICES_INGRESS_VERSION

string

latest

Enable to forward the ingress traffic from the container to the local host

Environment variable: QUARKUS_ARGOCD_DEVSERVICES_INGRESS_PORT_FORWARD_ENABLED

boolean

true

The Kubernetes API Server URL.

Environment variable: QUARKUS_ARGOCD_SERVER

string

https://kubernetes.default.svc

The target/destination namespace where the resources of the runtime should be installed from the Helm chart, kustomize, etc

Environment variable: QUARKUS_ARGOCD_DESTINATION_NAMESPACE

string

The target revision of the repository fetched by ArgoCd from the url Defaults to HEAD.

Environment variable: QUARKUS_ARGOCD_TARGET_REVISION

string

HEAD

The name of the ArgoCD AppProject CR. A AppProject CR exists by default with full permissions - https://argo-cd.readthedocs.io/en/stable/user-guide/projects/#the-default-project and is named "default"

Environment variable: QUARKUS_ARGOCD_APP_PROJECT_NAME

string

The AppProject CR namespace. This namespace refers to the Argocd control plane namespace. The value is either 'argocd' or 'openshift-gitops' and is calculated by the extension according to the DeploymentTarget platform: kubernetes or openshift. Remark: It is then not needed for a user to define it

Environment variable: QUARKUS_ARGOCD_APP_PROJECT_NAMESPACE

string

The namespace. The ApplicationCR should be installed under the Argocd control plan namespace like the AppProject CR Remark: It is nevertheless possible to install it in another namespace if "Application in any namespaces is enabled: https://argo-cd.readthedocs.io/en/stable/operator-manual/app-any-namespace/"

Environment variable: QUARKUS_ARGOCD_APPLICATION_NAMESPACE

string