diff --git a/README.md b/README.md index e0098e4..763e939 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# [ WIP ] ConsoleApplication Operator +# ConsoleApplication Operator + +**Note: For the latest updates, please refer to the `development` branch. Some features in this README may not be in main yet.** The ConsoleApplication Operator is a Kubernetes operator designed to automate the deployment of applications on OpenShift from Git URLs using custom resources. This operator provides a streamlined and efficient approach to manage application lifecycle processes such as building, deploying, and serving applications without needing to manually fill out forms in the OpenShift Web Console. @@ -10,6 +12,63 @@ The ConsoleApplication Operator is a Kubernetes operator designed to automate th - **Status Tracking**: Utilizes a database to persist state and track the progress of resource creation. - **Error Handling**: Ensures proper error handling and status updates for failed operations. +## Architecture Diagram + +ConsoleApplication Operator Architecture + +## Project Status + +**Project status:** *alpha* + +**Current API version:** `v1alpha1` + +## Getting Started + +Currently,you would need to have an OpenShift cluster, as the operator supports only BuildConfig to build container images from source. In the subsequent versions, we plan to substitute BuildConfig with Shipwright or tools like S2I and Buildah to build container images in any Kubernetes cluster. + +Ensure you have the following tools installed: + +- Golang compiler supported by the Go team (1.22+) +- Operator SDK version (1.35.x+) +- Access to OpenShift cluster +- Quay.io account to store container images + +## Installation + +Currently, the operator is not available in the OperatorHub. You can install the operator by building the operator image and deploying it to your OpenShift cluster. + +To install the operator, follow these steps: + +**Clone the repository:** + +```sh +git clone https://github.com/openshift-console/console-application-operator && cd console-application-operator +``` + +**Set the environment variables in the `.env` file:** + +```sh +QUAY_AUTH_TOKEN= +QUAY_USER_NAME= +``` + +**Build and push the operator image to Quay.io:** + +```sh +make container-build +make container-push +``` + +**Install the operator on the OpenShift cluster:** + +```sh +make install +``` + +## Development + +Please refer to the following [instructions](docs/DEVELOPMENT.md) . + ## License This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md new file mode 100644 index 0000000..788fe3c --- /dev/null +++ b/docs/DEVELOPMENT.md @@ -0,0 +1,75 @@ +# Development Guide + +This document provides guidelines and instructions for setting up the development environment and contributing to the project. + +## Set Environment Variables + +Create `.env` file in the root directory of the project and add the following environment variables: + +```sh +QUAY_AUTH_TOKEN= +QUAY_USER_NAME= +``` + +## Viewing available Make targets + +To view all available Make targets, run: + +```sh +make help +``` + +## Building Operator image + +To build and push the operator image to Quay.io, run: + +```sh +make container-build +make container-push +``` + +## Running Tests + +You can run the unit tests using the following command: + +```sh +make test +``` + +## Running Lint + +To run the lint checks, execute: + +```sh +make lint +``` + +## Deploying Operator + +Ensure KUBECONFIG points to target OpenShift cluster. To deploy the operator, run: + +```sh +make deploy +``` + +## Create `ConsoleApplication` Custom Resource (CR) + +To create a `ConsoleApplication` CR, run: + +```sh +kubectl create -k examples/success.yaml +``` + +## Uninstalling Operator + +Ensure KUBECONFIG points to target OpenShift cluster. Let's begin by deleting the payload image first with: + +```sh +kubectl delete -k examples/success.yaml +``` + +Subsequently, proceed with uninstalling the operator: + +```sh +make undeploy +``` diff --git a/docs/images/console-application-operator-architecture.png b/docs/images/console-application-operator-architecture.png new file mode 100644 index 0000000..d1d9d61 Binary files /dev/null and b/docs/images/console-application-operator-architecture.png differ